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

Method remove

src/main/java/bftsmart/demo/map/MapClient.java:71–96  ·  view source on GitHub ↗
(Object key)

Source from the content-addressed store, hash-verified

69 }
70
71 @Override
72 public V remove(Object key) {
73 byte[] rep;
74 try {
75 MapMessage<K,V> request = new MapMessage<>();
76 request.setType(MapRequestType.REMOVE);
77 request.setKey(key);
78
79 //invokes BFT-SMaRt
80 rep = serviceProxy.invokeOrdered(MapMessage.toBytes(request));
81 } catch (IOException e) {
82 System.out.println("Failed to send REMOVE request: " + e.getMessage());
83 return null;
84 }
85 if (rep.length == 0) {
86 return null;
87 }
88
89 try {
90 MapMessage<K,V> response = MapMessage.fromBytes(rep);
91 return response.getValue();
92 } catch (ClassNotFoundException | IOException ex) {
93 System.out.println("Failed to deserialized response of PUT request: " + ex.getMessage());
94 return null;
95 }
96 }
97
98 @Override
99 public int size() {

Callers 15

mainMethod · 0.95
initMethod · 0.45
getViewStoreClassMethod · 0.45
initMethod · 0.45
cleanAsynchRequestMethod · 0.45
restartMethod · 0.45
removeConsensusMethod · 0.45
removeOutOfContextsMethod · 0.45
processOutOfContextMethod · 0.45
getToForwardMethod · 0.45
removeStopsMethod · 0.45

Calls 6

setTypeMethod · 0.95
setKeyMethod · 0.95
toBytesMethod · 0.95
fromBytesMethod · 0.95
invokeOrderedMethod · 0.80
getValueMethod · 0.45

Tested by

no test coverage detected