mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
Renamed wrapValueAsValue() to wrapValueAsData after Value -> Data rename
This commit is contained in:
@@ -55,5 +55,5 @@ public interface MapContext<K, V, R> extends HashContext<K>, MapEntryOperations<
|
||||
* @param value the value object to wrap
|
||||
* @return the value as {@code Data}
|
||||
*/
|
||||
Data<V> wrapValueAsValue(V value);
|
||||
Data<V> wrapValueAsData(V value);
|
||||
}
|
||||
|
||||
@@ -174,7 +174,7 @@ public interface MapMethods<K, V, R> {
|
||||
* 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());
|
||||
* }</pre>
|
||||
*/
|
||||
@@ -184,7 +184,7 @@ public interface MapMethods<K, V, R> {
|
||||
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<K, V, R> {
|
||||
* V oldValue = entry != null ? entry.value().get() : null;
|
||||
* V newValue = remappingFunction.apply(q.queriedKey().get(), oldValue);
|
||||
* if (newValue != null) {
|
||||
* Data<V, ?> newValueData = q.wrapValueAsValue(newValue);
|
||||
* Data<V, ?> newValueData = q.wrapValueAsData(newValue);
|
||||
* if (entry != null) {
|
||||
* q.replaceValue(entry, newValueData);
|
||||
* } else {
|
||||
@@ -337,7 +337,7 @@ public interface MapMethods<K, V, R> {
|
||||
V oldValue = entry != null ? entry.value().get() : null;
|
||||
V newValue = remappingFunction.apply(q.queriedKey().get(), oldValue);
|
||||
if (newValue != null) {
|
||||
Data<V> newValueData = q.wrapValueAsValue(newValue);
|
||||
Data<V> newValueData = q.wrapValueAsData(newValue);
|
||||
if (entry != null) {
|
||||
q.replaceValue(entry, newValueData);
|
||||
} else {
|
||||
@@ -361,7 +361,7 @@ public interface MapMethods<K, V, R> {
|
||||
* 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<K, V, R> {
|
||||
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<K, V, R> {
|
||||
* 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<K, V, R> {
|
||||
q.remove(entry);
|
||||
return;
|
||||
}
|
||||
newValueData = q.wrapValueAsValue(newValue);
|
||||
newValueData = q.wrapValueAsData(newValue);
|
||||
q.replaceValue(entry, newValueData);
|
||||
} else {
|
||||
newValueData = value;
|
||||
|
||||
@@ -438,7 +438,7 @@ public class VanillaChronicleMap<K, KI, MKI extends MetaBytesInterop<K, ? super
|
||||
checkValue(newValue);
|
||||
try (QueryContextInterface<K, V, R> 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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -36,7 +36,7 @@ public class DeprecatedMapKeyContextOnIteration<K, V> implements MapKeyContext<K
|
||||
@Override
|
||||
public boolean valueEqualTo(V value) {
|
||||
checkOnEachPublicOperation.checkOnEachPublicOperation();
|
||||
return Data.bytesEquivalent(e.entryValue, it.context().wrapValueAsValue(value));
|
||||
return Data.bytesEquivalent(e.entryValue, it.context().wrapValueAsData(value));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -54,7 +54,7 @@ public class DeprecatedMapKeyContextOnIteration<K, V> implements MapKeyContext<K
|
||||
@Override
|
||||
public boolean put(V newValue) {
|
||||
checkOnEachPublicOperation.checkOnEachPublicOperation();
|
||||
ops.replaceValue(it, it.context().wrapValueAsValue(newValue));
|
||||
ops.replaceValue(it, it.context().wrapValueAsData(newValue));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ public abstract class WrappedValueInstanceValueHolder<K, V, R> implements MapCon
|
||||
|
||||
|
||||
@Override
|
||||
public Data<V> wrapValueAsValue(V value) {
|
||||
public Data<V> wrapValueAsData(V value) {
|
||||
checkOnEachPublicOperation.checkOnEachPublicOperation();
|
||||
WrappedValueInstanceData<V, ?, ?> wrapped = this.wrappedValueInstanceValue;
|
||||
wrapped = wrapped.getUnusedWrappedValue();
|
||||
|
||||
+3
-3
@@ -53,7 +53,7 @@ public class DeprecatedMapAcquireContextOnQuery<K, V> implements MapKeyContext<K
|
||||
@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
|
||||
@@ -73,9 +73,9 @@ public class DeprecatedMapAcquireContextOnQuery<K, V> implements MapKeyContext<K
|
||||
updateLock().lock();
|
||||
MapEntry<K, V> 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;
|
||||
}
|
||||
|
||||
+3
-3
@@ -51,7 +51,7 @@ public class DeprecatedMapKeyContextOnQuery<K, V> implements MapKeyContext<K, V>
|
||||
@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<K, V> implements MapKeyContext<K, V>
|
||||
updateLock().lock();
|
||||
MapEntry<K, V> 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;
|
||||
}
|
||||
|
||||
@@ -69,6 +69,6 @@ public class MapAbsent<K, V> implements MapAbsentEntry<K, V> {
|
||||
@Override
|
||||
public Data<V> defaultValue() {
|
||||
checkOnEachPublicOperation.checkOnEachPublicOperation();
|
||||
return q.wrapValueAsValue(mh.m().defaultValue(deprecatedMapKeyContext));
|
||||
return q.wrapValueAsData(mh.m().defaultValue(deprecatedMapKeyContext));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user