File tree Expand file tree Collapse file tree 4 files changed +9
-17
lines changed
main/java/com/hedera/block/server/persistence/storage
test/java/com/hedera/block/server/persistence Expand file tree Collapse file tree 4 files changed +9
-17
lines changed Original file line number Diff line number Diff line change @@ -5,11 +5,12 @@ echo "Starting consumer..."
5
5
# Set the gRPC server address and method
6
6
GRPC_SERVER=" localhost:8080"
7
7
GRPC_METHOD=" BlockStreamGrpc/StreamSource"
8
+ PATH_TO_PROTO=" ./protos/src/main/protobuf/blockstream.proto"
8
9
9
10
trap " echo 'Received SIGINT, stopping...'; exit 0" SIGINT
10
11
11
- payload= " { \" id \" : 0} "
12
-
12
+ # Generate and push messages to the gRPC server as a consumer.
13
+ # Response block messages from the gRPC server are printed to stdout.
13
14
(
14
15
iter=$1
15
16
while true ; do
@@ -21,14 +22,9 @@ payload="{\"id\": 0}"
21
22
22
23
(( iter++ ))
23
24
25
+ # Configure the message speed
24
26
sleep 0.25
25
27
26
28
done
27
- ) | grpcurl -plaintext -proto ./protos/src/main/protobuf/blockstream.proto -d @ $GRPC_SERVER $GRPC_METHOD
28
-
29
- # grpcurl -vv -plaintext -proto ./protos/src/main/protobuf/blockstream.proto -d "$payload" localhost:8080 BlockStreamGrpc/StreamSource
29
+ ) | grpcurl -plaintext -proto $PATH_TO_PROTO -d @ $GRPC_SERVER $GRPC_METHOD
30
30
31
- # Initiate the bidirectional streaming connection
32
- # grpcurl -vv -plaintext -proto ./protos/src/main/protobuf/blockstream.proto -d "$payload" $GRPC_SERVER $GRPC_METHOD | handle_streaming | grpcurl -plaintext -d @ $GRPC_SERVER $GRPC_METHOD
33
- # grpcurl -plaintext -proto ./protos/src/main/protobuf/blockstream.proto -d @ $GRPC_SERVER $GRPC_METHOD
34
- # handle_streaming | grpcurl -plaintext -d @ $GRPC_SERVER $GRPC_METHOD --format json
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
- #! /bin/bash
4
-
5
3
usage_error () {
6
4
echo " Usage: $0 <integer> [positive-integer]"
7
5
exit 1
26
24
27
25
GRPC_SERVER=" localhost:8080"
28
26
GRPC_METHOD=" BlockStreamGrpc/StreamSink"
27
+ PATH_TO_PROTO=" ./protos/src/main/protobuf/blockstream.proto"
29
28
30
29
echo " Starting producer..."
31
30
@@ -39,7 +38,8 @@ function cleanup {
39
38
# Trap SIGINT
40
39
trap cleanup SIGINT
41
40
42
- # Generate a new message every second and send to grpcurl
41
+ # Generate and push messages to the gRPC server as a producer.
42
+ # Response messages from the gRPC server are printed to stdout.
43
43
(
44
44
iter=$1
45
45
while true ; do
@@ -53,7 +53,7 @@ trap cleanup SIGINT
53
53
54
54
sleep 0.25
55
55
done
56
- ) | grpcurl -vv -plaintext -proto ./protos/src/main/protobuf/blockstream.proto -d @ $GRPC_SERVER $GRPC_METHOD &
56
+ ) | grpcurl -vv -plaintext -proto $PATH_TO_PROTO -d @ $GRPC_SERVER $GRPC_METHOD &
57
57
58
58
GRPC_PID=$!
59
59
Original file line number Diff line number Diff line change @@ -128,5 +128,4 @@ private String resolvePath(Long id) {
128
128
129
129
return fullPath .toString ();
130
130
}
131
-
132
131
}
Original file line number Diff line number Diff line change @@ -74,13 +74,10 @@ public void testReadRangeWhenBlocksLessThanWindow() {
74
74
}
75
75
76
76
int window = 10 ;
77
- int numOfWindows = 1 ;
78
77
79
- // verifyReadRange(window, numOfWindows, blockPersistenceHandler);
80
78
Queue <BlockStreamServiceGrpcProto .Block > results = blockPersistenceHandler .readRange (1 , window );
81
79
assertNotNull (results );
82
80
assertEquals (numOfBlocks , results .size ());
83
-
84
81
}
85
82
86
83
private static void verifyReadRange (
You can’t perform that action at this time.
0 commit comments