mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
Revert 'Make working with new bytes' and a couple of fixes
This commit is contained in:
@@ -40,7 +40,7 @@ public class BiMapTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void put(MapQueryContext<K, V, DualLockSuccess> q, Data<V, ?> value,
|
||||
public void put(MapQueryContext<K, V, DualLockSuccess> q, Data<V> value,
|
||||
ReturnValue<V> returnValue) {
|
||||
while (true) {
|
||||
q.updateLock().lock();
|
||||
@@ -59,7 +59,7 @@ public class BiMapTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void putIfAbsent(MapQueryContext<K, V, DualLockSuccess> q, Data<V, ?> value,
|
||||
public void putIfAbsent(MapQueryContext<K, V, DualLockSuccess> q, Data<V> value,
|
||||
ReturnValue<V> returnValue) {
|
||||
while (true) {
|
||||
try {
|
||||
@@ -88,7 +88,7 @@ public class BiMapTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean remove(MapQueryContext<K, V, DualLockSuccess> q, Data<V, ?> value) {
|
||||
public boolean remove(MapQueryContext<K, V, DualLockSuccess> q, Data<V> value) {
|
||||
while (true) {
|
||||
q.updateLock().lock();
|
||||
MapEntry<K, V> entry = q.entry();
|
||||
@@ -116,14 +116,14 @@ public class BiMapTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void replace(MapQueryContext<K, V, DualLockSuccess> q, Data<V, ?> value,
|
||||
public void replace(MapQueryContext<K, V, DualLockSuccess> q, Data<V> value,
|
||||
ReturnValue<V> returnValue) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean replace(MapQueryContext<K, V, DualLockSuccess> q, Data<V, ?> oldValue,
|
||||
Data<V, ?> newValue) {
|
||||
public boolean replace(MapQueryContext<K, V, DualLockSuccess> q, Data<V> oldValue,
|
||||
Data<V> newValue) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ public class BiMapTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void merge(MapQueryContext<K, V, DualLockSuccess> q, Data<V, ?> value,
|
||||
public void merge(MapQueryContext<K, V, DualLockSuccess> q, Data<V> value,
|
||||
BiFunction<? super V, ? super V, ? extends V> remappingFunction,
|
||||
ReturnValue<V> returnValue) {
|
||||
throw new UnsupportedOperationException();
|
||||
@@ -171,13 +171,13 @@ public class BiMapTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public DualLockSuccess replaceValue(@NotNull MapEntry<K, V> entry, Data<V, ?> newValue) {
|
||||
public DualLockSuccess replaceValue(@NotNull MapEntry<K, V> entry, Data<V> newValue) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public DualLockSuccess insert(@NotNull MapAbsentEntry<K, V> absentEntry,
|
||||
Data<V, ?> value) {
|
||||
Data<V> value) {
|
||||
try (ExternalMapQueryContext<V, K, ?> rq = reverse.queryContext(value)) {
|
||||
if (!rq.updateLock().tryLock())
|
||||
return FAIL;
|
||||
@@ -187,7 +187,7 @@ public class BiMapTest {
|
||||
reverseAbsentEntry.doInsert(absentEntry.absentKey());
|
||||
return SUCCESS;
|
||||
} else {
|
||||
Data<K, ?> reverseKey = rq.entry().value();
|
||||
Data<K> reverseKey = rq.entry().value();
|
||||
if (reverseKey.equals(absentEntry.absentKey())) {
|
||||
// recover
|
||||
absentEntry.doInsert(value);
|
||||
|
||||
Reference in New Issue
Block a user