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

Method keySet

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

Source from the content-addressed store, hash-verified

121 }
122
123 @Override
124 public Set<K> keySet() {
125 byte[] rep;
126 try {
127 MapMessage<K,V> request = new MapMessage<>();
128 request.setType(MapRequestType.KEYSET);
129
130 //invokes BFT-SMaRt
131 rep = serviceProxy.invokeUnordered(MapMessage.toBytes(request));
132 } catch (IOException e) {
133 System.out.println("Failed to send KEYSET request: " + e.getMessage());
134 return Collections.emptySet();
135 }
136
137 if (rep.length == 0) {
138 return Collections.emptySet();
139 }
140 try {
141 MapMessage<K,V> response = MapMessage.fromBytes(rep);
142 return response.getKeySet();
143 } catch (ClassNotFoundException | IOException ex) {
144 System.out.println("Failed to deserialized response of KEYSET request: " + ex.getMessage());
145 return Collections.emptySet();
146 }
147 }
148
149 public void close() {
150 serviceProxy.close();

Callers 15

mainMethod · 0.95
executeUpdatesMethod · 0.80
writeExternalMethod · 0.80
toStringMethod · 0.80
equalsMethod · 0.80
getHostsIdsMethod · 0.80
removeOutOfContextsMethod · 0.80
removeStopsMethod · 0.80

Calls 5

setTypeMethod · 0.95
toBytesMethod · 0.95
fromBytesMethod · 0.95
invokeUnorderedMethod · 0.80
getKeySetMethod · 0.80

Tested by

no test coverage detected