mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
HCOLL-352 Changed garbage-free Chronicle-Map iterations API from old to new Contexts; Add SegmentContexts API
This commit is contained in:
@@ -257,12 +257,12 @@ public class ReplicationCheckingMap<K, V> implements ChronicleMap<K, V> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean forEachEntryWhile(Predicate<? super MapKeyContext<K, V>> predicate) {
|
||||
public boolean forEachEntryWhile(Predicate<? super MapEntry<K, V>> predicate) {
|
||||
return map1.forEachEntryWhile(predicate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forEachEntry(Consumer<? super MapKeyContext<K, V>> action) {
|
||||
public void forEachEntry(Consumer<? super MapEntry<K, V>> action) {
|
||||
map1.forEachEntry(action);
|
||||
}
|
||||
|
||||
@@ -295,6 +295,11 @@ public class ReplicationCheckingMap<K, V> implements ChronicleMap<K, V> {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public MapSegmentContext<K, V, ?> segmentContext(int segmentIndex) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public File file() {
|
||||
throw new UnsupportedOperationException();
|
||||
|
||||
+2
-2
@@ -68,8 +68,8 @@ public class SimpleMapOperationsListeningTest {
|
||||
map.acquireUsing(3, value).addAtomicValue(1);
|
||||
IntValue value2 = DataValueClasses.newDirectInstance(IntValue.class);
|
||||
value2.setValue(5);
|
||||
map.forEachEntry(c -> c.put(value2));
|
||||
map.forEachEntry(c -> c.remove());
|
||||
map.forEachEntry(e -> e.context().replaceValue(e, e.context().wrapValueAsData(value2)));
|
||||
map.forEachEntry(e -> e.context().remove(e));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,6 +128,11 @@ public class StatelessChronicleMapTest extends JSR166TestCase {
|
||||
return d.queryContext(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MapSegmentContext<K, V, ?> segmentContext(int segmentIndex) {
|
||||
return d.segmentContext(segmentIndex);
|
||||
}
|
||||
|
||||
@Override
|
||||
public V get(Object key) {
|
||||
return d.get(key);
|
||||
@@ -217,12 +222,12 @@ public class StatelessChronicleMapTest extends JSR166TestCase {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean forEachEntryWhile(Predicate<? super MapKeyContext<K, V>> predicate) {
|
||||
public boolean forEachEntryWhile(Predicate<? super MapEntry<K, V>> predicate) {
|
||||
return d.forEachEntryWhile(predicate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forEachEntry(Consumer<? super MapKeyContext<K, V>> action) {
|
||||
public void forEachEntry(Consumer<? super MapEntry<K, V>> action) {
|
||||
d.forEachEntry(action);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user