mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
CE-23 added map.putAll()
This commit is contained in:
@@ -353,13 +353,6 @@ public class MapWireHandler<K, V> implements WireHandler, Consumer<WireHandlers>
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (putAll.contentEquals(eventName)) {
|
||||
putAll(tid);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (longSize.contentEquals(eventName)) {
|
||||
write(b -> outWire.write(reply).int64(b.longSize()));
|
||||
return;
|
||||
@@ -395,14 +388,10 @@ public class MapWireHandler<K, V> implements WireHandler, Consumer<WireHandlers>
|
||||
valueIn.marshallable(wire -> {
|
||||
|
||||
final Params[] params = getAndPut.params();
|
||||
final byte[] key1 = wire.read(params[0]).bytes();
|
||||
|
||||
final byte[] value1 = wire.read(params[1]).bytes();
|
||||
|
||||
MapWireHandler.this.writeValue(b -> {
|
||||
final byte[] result = b.put(key1, value1);
|
||||
return result;
|
||||
});
|
||||
MapWireHandler.this.writeValue(b -> b.put(
|
||||
wire.read(params[0]).bytes(),
|
||||
wire.read(params[1]).bytes()));
|
||||
|
||||
});
|
||||
|
||||
@@ -419,6 +408,28 @@ public class MapWireHandler<K, V> implements WireHandler, Consumer<WireHandlers>
|
||||
return;
|
||||
}
|
||||
|
||||
if (putAll.contentEquals(eventName)) {
|
||||
|
||||
final Map data = new HashMap();
|
||||
|
||||
writeVoid(b -> {
|
||||
|
||||
while (valueIn.hasNext()) {
|
||||
|
||||
valueIn.sequence(v -> valueIn.marshallable(wire -> data.put(
|
||||
wire.read(getAndPut.params()[0]).bytes(),
|
||||
wire.read(getAndPut.params()[1]).bytes())));
|
||||
}
|
||||
|
||||
b.delegate.putAll(data);
|
||||
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (replace.contentEquals(eventName)) {
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user