MCPcopy Create free account
hub / github.com/bft-smart/library / size

Method size

src/main/java/bftsmart/demo/map/MapClient.java:98–121  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

96 }
97
98 @Override
99 public int size() {
100 byte[] rep;
101 try {
102 MapMessage<K,V> request = new MapMessage<>();
103 request.setType(MapRequestType.SIZE);
104
105 rep = serviceProxy.invokeUnordered(MapMessage.toBytes(request));
106 } catch (IOException e) {
107 System.out.println("Failed to send SIZE request " + e.getMessage());
108 return -1;
109 }
110 if (rep.length == 0) {
111 return -1;
112 }
113
114 try {
115 MapMessage<K,V> response = MapMessage.fromBytes(rep);
116 return response.getSize();
117 } catch (IOException | ClassNotFoundException ex) {
118 System.out.println("Failed to deserialized response of SIZE request: " + ex.getMessage());
119 return -1;
120 }
121 }
122
123 @Override
124 public Set<K> keySet() {

Callers 15

mainMethod · 0.95
addLastMethod · 0.80
getIdsMethod · 0.80
getPendingRequestsMethod · 0.80
requestReceivedMethod · 0.80
numClientsMethod · 0.80
getRepliesMethod · 0.80
enoughRepliesMethod · 0.80
SMReplyDeliverMethod · 0.80

Calls 5

setTypeMethod · 0.95
toBytesMethod · 0.95
fromBytesMethod · 0.95
invokeUnorderedMethod · 0.80
getSizeMethod · 0.80

Tested by 1

printMeasurementMethod · 0.64