Skip to content

Commit de5bab0

Browse files
author
root
committed
adds client scripts
1 parent 3c4219c commit de5bab0

File tree

3 files changed

+26
-14
lines changed

3 files changed

+26
-14
lines changed

client/copy-all-script

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,24 @@ import sys
77
import fossildbapi_pb2 as proto
88
import fossildbapi_pb2_grpc as proto_rpc
99

10+
MAX_MESSAGE_LENGTH = 1073741824
1011

1112
def main():
12-
verbose = False
13+
verbose = True
1314

1415
collections = ['skeletons', 'volumes', 'volumeData', 'skeletonUpdates']
1516

16-
srcPort = 7156
17-
dstPort = 7155
18-
1917
listKeysBatchSize = 300
2018

19+
srcPort = 2000
20+
dstPort = 7155
2121

22-
23-
24-
srcChannel = grpc.insecure_channel('localhost:{}'.format(srcPort))
22+
srcChannel = grpc.insecure_channel('localhost:{}'.format(srcPort), options=[('grpc.max_send_message_length', MAX_MESSAGE_LENGTH), (
23+
'grpc.max_receive_message_length', MAX_MESSAGE_LENGTH)])
2524
srcStub = proto_rpc.FossilDBStub(srcChannel)
2625

27-
dstChannel = grpc.insecure_channel('localhost:{}'.format(dstPort))
26+
dstChannel = grpc.insecure_channel('localhost:{}'.format(dstPort), options=[('grpc.max_send_message_length', MAX_MESSAGE_LENGTH), (
27+
'grpc.max_receive_message_length', MAX_MESSAGE_LENGTH)])
2828
dstStub = proto_rpc.FossilDBStub(dstChannel)
2929

3030
testHealth(srcStub, 'source fossildb at {}'.format(srcPort))
@@ -34,7 +34,7 @@ def main():
3434

3535
for collection in collections:
3636
print('copying collection ' + collection)
37-
lastKey = ''
37+
lastKey = None
3838
while True:
3939
listKeysReply = srcStub.ListKeys(proto.ListKeysRequest(collection=collection, limit=listKeysBatchSize, startAfterKey=lastKey))
4040
assertSuccess(listKeysReply)

client/copy-some-script

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,27 @@ import sys
77
import fossildbapi_pb2 as proto
88
import fossildbapi_pb2_grpc as proto_rpc
99

10+
MAX_MESSAGE_LENGTH = 1073741824
11+
1012
def main():
11-
verbose = False
13+
verbose = True
1214

1315
collectionsByTyp = {
1416
'skeleton': ['skeletons', 'skeletonUpdates'],
1517
'volume': ['volumes', 'volumeData']
1618
}
1719

18-
srcPort = 7156
19-
dstPort = 7156
20+
srcPort = 2000
21+
dstPort = 7155
2022

2123
tracingReferences = json.load(open('tracingReferences.json'))
2224

23-
srcChannel = grpc.insecure_channel('localhost:{}'.format(srcPort))
25+
srcChannel = grpc.insecure_channel('localhost:{}'.format(srcPort), options=[('grpc.max_send_message_length', MAX_MESSAGE_LENGTH), (
26+
'grpc.max_receive_message_length', MAX_MESSAGE_LENGTH)])
2427
srcStub = proto_rpc.FossilDBStub(srcChannel)
2528

26-
dstChannel = grpc.insecure_channel('localhost:{}'.format(dstPort))
29+
dstChannel = grpc.insecure_channel('localhost:{}'.format(dstPort), options=[('grpc.max_send_message_length', MAX_MESSAGE_LENGTH), (
30+
'grpc.max_receive_message_length', MAX_MESSAGE_LENGTH)])
2731
dstStub = proto_rpc.FossilDBStub(dstChannel)
2832

2933
testHealth(srcStub, 'source fossildb at {}'.format(srcPort))

docker-compose.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ services:
2121
links:
2222
- fossildb
2323

24+
client:
25+
image: scalableminds/fossildb-client:${FOSSILDB_CLIENT_TAG:-master}
26+
volumes:
27+
- ".:/app"
28+
working_dir: /app
29+
entrypoint: /bin/bash
30+
network_mode: host
31+
2432
sbt:
2533
image: scalableminds/sbt:${SBT_VERSION_TAG:-sbt-0.13.15_mongo-3.2.17_node-8.x_jdk-8}
2634
environment:

0 commit comments

Comments
 (0)