From 00ad3068eef1c4e93aab94f1fdfaf462acf0e7bd Mon Sep 17 00:00:00 2001 From: leventov Date: Wed, 22 Jul 2015 20:46:50 +0300 Subject: [PATCH] Renamed wrapValueAsValue() to wrapValueAsData after Value -> Data rename --- .../net/openhft/chronicle/map/MapContext.java | 2 +- .../net/openhft/chronicle/map/MapMethods.java | 16 ++++++++-------- .../chronicle/map/VanillaChronicleMap.java | 2 +- .../iter/DeprecatedMapKeyContextOnIteration.java | 4 ++-- .../map/WrappedValueInstanceValueHolder.java | 2 +- .../DeprecatedMapAcquireContextOnQuery.java | 6 +++--- .../query/DeprecatedMapKeyContextOnQuery.java | 6 +++--- .../map/impl/stage/query/MapAbsent.java | 2 +- .../map/replication/MapRemoteOperations.java | 2 +- .../net/openhft/chronicle/map/ListenersTest.java | 4 ++-- .../map/TcpReplicationSoakCrdtTest.java | 6 +++--- 11 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/main/java/net/openhft/chronicle/map/MapContext.java b/src/main/java/net/openhft/chronicle/map/MapContext.java index a9274f9ba..e31ae7ccb 100644 --- a/src/main/java/net/openhft/chronicle/map/MapContext.java +++ b/src/main/java/net/openhft/chronicle/map/MapContext.java @@ -55,5 +55,5 @@ public interface MapContext extends HashContext, MapEntryOperations< * @param value the value object to wrap * @return the value as {@code Data} */ - Data wrapValueAsValue(V value); + Data wrapValueAsData(V value); } diff --git a/src/main/java/net/openhft/chronicle/map/MapMethods.java b/src/main/java/net/openhft/chronicle/map/MapMethods.java index 3228bd28a..d1a400a94 100644 --- a/src/main/java/net/openhft/chronicle/map/MapMethods.java +++ b/src/main/java/net/openhft/chronicle/map/MapMethods.java @@ -174,7 +174,7 @@ public interface MapMethods { * return; * } * // Key is absent - * q.insert(q.absentEntry(), q.wrapValueAsValue(mappingFunction.apply(q.queriedKey().get()))); + * q.insert(q.absentEntry(), q.wrapValueAsData(mappingFunction.apply(q.queriedKey().get()))); * returnValue.returnValue(q.entry().value()); * } */ @@ -184,7 +184,7 @@ public interface MapMethods { if (tryReturnCurrentValueIfPresent(q, returnValue)) return; // Key is absent - q.insert(q.absentEntry(), q.wrapValueAsValue(mappingFunction.apply(q.queriedKey().get()))); + q.insert(q.absentEntry(), q.wrapValueAsData(mappingFunction.apply(q.queriedKey().get()))); returnValue.returnValue(q.entry().value()); } @@ -317,7 +317,7 @@ public interface MapMethods { * V oldValue = entry != null ? entry.value().get() : null; * V newValue = remappingFunction.apply(q.queriedKey().get(), oldValue); * if (newValue != null) { - * Data newValueData = q.wrapValueAsValue(newValue); + * Data newValueData = q.wrapValueAsData(newValue); * if (entry != null) { * q.replaceValue(entry, newValueData); * } else { @@ -337,7 +337,7 @@ public interface MapMethods { V oldValue = entry != null ? entry.value().get() : null; V newValue = remappingFunction.apply(q.queriedKey().get(), oldValue); if (newValue != null) { - Data newValueData = q.wrapValueAsValue(newValue); + Data newValueData = q.wrapValueAsData(newValue); if (entry != null) { q.replaceValue(entry, newValueData); } else { @@ -361,7 +361,7 @@ public interface MapMethods { * V oldValue = entry.value().get(); * V newValue = remappingFunction.apply(q.queriedKey().get(), oldValue); * if (newValue != null ) { - * q.replaceValue(entry, q.wrapValueAsValue(newValue)); + * q.replaceValue(entry, q.wrapValueAsData(newValue)); * returnValue.returnValue(q.entry().value()); * } else { * q.remove(entry); @@ -377,7 +377,7 @@ public interface MapMethods { V oldValue = entry.value().get(); V newValue = remappingFunction.apply(q.queriedKey().get(), oldValue); if (newValue != null ) { - q.replaceValue(entry, q.wrapValueAsValue(newValue)); + q.replaceValue(entry, q.wrapValueAsData(newValue)); returnValue.returnValue(q.entry().value()); } else { q.remove(entry); @@ -399,7 +399,7 @@ public interface MapMethods { * q.remove(entry); * return; * } - * newValueData = q.wrapValueAsValue(newValue); + * newValueData = q.wrapValueAsData(newValue); * q.replaceValue(entry, newValueData); * } else { * newValueData = value; @@ -422,7 +422,7 @@ public interface MapMethods { q.remove(entry); return; } - newValueData = q.wrapValueAsValue(newValue); + newValueData = q.wrapValueAsData(newValue); q.replaceValue(entry, newValueData); } else { newValueData = value; diff --git a/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java b/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java index d66d06b07..f34995c24 100755 --- a/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java +++ b/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java @@ -438,7 +438,7 @@ public class VanillaChronicleMap q = queryContext(key)) { q.inputValueInstanceValue().initValue(oldValue); - return methods.replace(q, q.inputValueInstanceValue(), q.wrapValueAsValue(newValue)); + return methods.replace(q, q.inputValueInstanceValue(), q.wrapValueAsData(newValue)); } } diff --git a/src/main/java/net/openhft/chronicle/map/impl/stage/iter/DeprecatedMapKeyContextOnIteration.java b/src/main/java/net/openhft/chronicle/map/impl/stage/iter/DeprecatedMapKeyContextOnIteration.java index 8fc57cf99..6d7a23970 100644 --- a/src/main/java/net/openhft/chronicle/map/impl/stage/iter/DeprecatedMapKeyContextOnIteration.java +++ b/src/main/java/net/openhft/chronicle/map/impl/stage/iter/DeprecatedMapKeyContextOnIteration.java @@ -36,7 +36,7 @@ public class DeprecatedMapKeyContextOnIteration implements MapKeyContext implements MapKeyContext implements MapCon @Override - public Data wrapValueAsValue(V value) { + public Data wrapValueAsData(V value) { checkOnEachPublicOperation.checkOnEachPublicOperation(); WrappedValueInstanceData wrapped = this.wrappedValueInstanceValue; wrapped = wrapped.getUnusedWrappedValue(); diff --git a/src/main/java/net/openhft/chronicle/map/impl/stage/query/DeprecatedMapAcquireContextOnQuery.java b/src/main/java/net/openhft/chronicle/map/impl/stage/query/DeprecatedMapAcquireContextOnQuery.java index 7d3860a04..8575c31a2 100644 --- a/src/main/java/net/openhft/chronicle/map/impl/stage/query/DeprecatedMapAcquireContextOnQuery.java +++ b/src/main/java/net/openhft/chronicle/map/impl/stage/query/DeprecatedMapAcquireContextOnQuery.java @@ -53,7 +53,7 @@ public class DeprecatedMapAcquireContextOnQuery implements MapKeyContext implements MapKeyContext entry = q.entry(); if (entry != null) { - q.replaceValue(entry, q.wrapValueAsValue(newValue)); + q.replaceValue(entry, q.wrapValueAsData(newValue)); } else { - q.insert(q.absentEntry(), q.wrapValueAsValue(newValue)); + q.insert(q.absentEntry(), q.wrapValueAsData(newValue)); } return true; } diff --git a/src/main/java/net/openhft/chronicle/map/impl/stage/query/DeprecatedMapKeyContextOnQuery.java b/src/main/java/net/openhft/chronicle/map/impl/stage/query/DeprecatedMapKeyContextOnQuery.java index cead32685..3d282e6d7 100644 --- a/src/main/java/net/openhft/chronicle/map/impl/stage/query/DeprecatedMapKeyContextOnQuery.java +++ b/src/main/java/net/openhft/chronicle/map/impl/stage/query/DeprecatedMapKeyContextOnQuery.java @@ -51,7 +51,7 @@ public class DeprecatedMapKeyContextOnQuery implements MapKeyContext @Override public boolean valueEqualTo(V value) { checkOnEachPublicOperation.checkOnEachPublicOperation(); - return Data.bytesEquivalent(e.entryValue, q.wrapValueAsValue(value)); + return Data.bytesEquivalent(e.entryValue, q.wrapValueAsData(value)); } @Override @@ -70,9 +70,9 @@ public class DeprecatedMapKeyContextOnQuery implements MapKeyContext updateLock().lock(); MapEntry entry = q.entry(); if (entry != null) { - q.replaceValue(entry, q.wrapValueAsValue(newValue)); + q.replaceValue(entry, q.wrapValueAsData(newValue)); } else { - q.insert(q.absentEntry(), q.wrapValueAsValue(newValue)); + q.insert(q.absentEntry(), q.wrapValueAsData(newValue)); } return true; } diff --git a/src/main/java/net/openhft/chronicle/map/impl/stage/query/MapAbsent.java b/src/main/java/net/openhft/chronicle/map/impl/stage/query/MapAbsent.java index ca4f56951..5f305d481 100644 --- a/src/main/java/net/openhft/chronicle/map/impl/stage/query/MapAbsent.java +++ b/src/main/java/net/openhft/chronicle/map/impl/stage/query/MapAbsent.java @@ -69,6 +69,6 @@ public class MapAbsent implements MapAbsentEntry { @Override public Data defaultValue() { checkOnEachPublicOperation.checkOnEachPublicOperation(); - return q.wrapValueAsValue(mh.m().defaultValue(deprecatedMapKeyContext)); + return q.wrapValueAsData(mh.m().defaultValue(deprecatedMapKeyContext)); } } diff --git a/src/main/java/net/openhft/chronicle/map/replication/MapRemoteOperations.java b/src/main/java/net/openhft/chronicle/map/replication/MapRemoteOperations.java index d8fe5998d..f605d1e71 100644 --- a/src/main/java/net/openhft/chronicle/map/replication/MapRemoteOperations.java +++ b/src/main/java/net/openhft/chronicle/map/replication/MapRemoteOperations.java @@ -52,7 +52,7 @@ import static net.openhft.chronicle.hash.replication.DefaultEventualConsistencyS * if (entry != null) { * Set<E> merged = new HashSet<>(entry.value().get()); * merged.addAll(newValue.get()); - * q.replaceValue(entry, q.wrapValueAsValue(merged)); + * q.replaceValue(entry, q.wrapValueAsData(merged)); * } else { * q.insert(q.absentEntry(), newValue); * q.entry().updateOrigin(q.remoteIdentifier(), q.remoteTimestamp()); diff --git a/src/test/java/net/openhft/chronicle/map/ListenersTest.java b/src/test/java/net/openhft/chronicle/map/ListenersTest.java index 1e1577959..7af93f87b 100644 --- a/src/test/java/net/openhft/chronicle/map/ListenersTest.java +++ b/src/test/java/net/openhft/chronicle/map/ListenersTest.java @@ -124,7 +124,7 @@ public class ListenersTest { public void get(MapQueryContext q, ReturnValue returnValue) { if (q.queriedKey().get() == 2) { - returnValue.returnValue(q.wrapValueAsValue(42)); + returnValue.returnValue(q.wrapValueAsData(42)); return; } c.incrementAndGet(); @@ -159,7 +159,7 @@ public class ListenersTest { return; } if (q.queriedKey().get() == 3) { - MapMethods.super.put(q, q.wrapValueAsValue(value.get() + 1), + MapMethods.super.put(q, q.wrapValueAsData(value.get() + 1), returnValue); return; } diff --git a/src/test/java/net/openhft/chronicle/map/TcpReplicationSoakCrdtTest.java b/src/test/java/net/openhft/chronicle/map/TcpReplicationSoakCrdtTest.java index 971cb8774..e06aae726 100644 --- a/src/test/java/net/openhft/chronicle/map/TcpReplicationSoakCrdtTest.java +++ b/src/test/java/net/openhft/chronicle/map/TcpReplicationSoakCrdtTest.java @@ -63,7 +63,7 @@ public class TcpReplicationSoakCrdtTest { if (entry != null) { Set merged = new HashSet<>(entry.value().get()); merged.addAll(newValue.get()); - q.replaceValue(entry, q.wrapValueAsValue(merged)); + q.replaceValue(entry, q.wrapValueAsData(merged)); } else { q.insert(q.absentEntry(), newValue); q.entry().updateOrigin(q.remoteIdentifier(), q.remoteTimestamp()); @@ -185,10 +185,10 @@ public class TcpReplicationSoakCrdtTest { if (entry != null) { Set value = entry.value().get(); value.add(rnd.nextInt(20)); - q.replaceValue(entry, q.wrapValueAsValue(value)); + q.replaceValue(entry, q.wrapValueAsData(value)); } else { HashSet value = new HashSet<>(); - q.insert(q.absentEntry(), q.wrapValueAsValue(value)); + q.insert(q.absentEntry(), q.wrapValueAsData(value)); } } }