SPI implementation

This commit is contained in:
leventov
2015-05-27 00:03:20 +01:00
parent 8e4027da08
commit b4c8554b77
111 changed files with 13637 additions and 3991 deletions
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,21 @@
package net.openhft.chronicle.map.impl;
import net.openhft.chronicle.map.MapEntry;
import net.openhft.chronicle.map.MapKeyContext;
import java.util.function.Predicate;
public interface IterationContextInterface<K, V> extends MapEntry<K, V>, AutoCloseable {
long pos();
void initTheSegmentIndex(int segmentIndex);
MapKeyContext<K, V> deprecatedMapKeyContextOnIteration();
boolean forEachRemoving(Predicate<? super MapEntry<K, V>> action);
@Override
void close();
long size();
}
@@ -0,0 +1,25 @@
package net.openhft.chronicle.map.impl;
import net.openhft.chronicle.hash.Value;
import net.openhft.chronicle.map.impl.ret.InstanceReturnValue;
import org.jetbrains.annotations.NotNull;
public final class NullReturnValue implements InstanceReturnValue {
private static final NullReturnValue NULL_RETURN_VALUE = new NullReturnValue();
public static <V> InstanceReturnValue<V> get() {
return NULL_RETURN_VALUE;
}
private NullReturnValue() {}
@Override
public Object returnValue() {
return null;
}
@Override
public void returnValue(@NotNull Value value) {
// ignore
}
}
@@ -0,0 +1,34 @@
package net.openhft.chronicle.map.impl;
import net.openhft.chronicle.hash.Value;
import net.openhft.chronicle.hash.impl.value.instance.KeyInitableValue;
import net.openhft.chronicle.map.ExternalMapQueryContext;
import net.openhft.chronicle.map.MapKeyContext;
import net.openhft.chronicle.map.impl.ret.InstanceReturnValue;
import net.openhft.chronicle.map.impl.ret.UsableReturnValue;
import net.openhft.chronicle.map.impl.value.instance.ValueInitableValue;
public interface QueryContextInterface<K, V, R> extends ExternalMapQueryContext<K, V, R> {
void initInputKey(Value<K, ?> inputKey);
KeyInitableValue<K, ?> inputKeyInstanceValue();
InstanceReturnValue<V> defaultReturnValue();
UsableReturnValue<V> usingReturnValue();
ValueInitableValue<V, ?> inputValueInstanceValue();
MapKeyContext<K, V> deprecatedMapKeyContext();
MapKeyContext<K, V> deprecatedMapAcquireContext();
void initTheSegmentIndex(int segmentIndex);
boolean theSegmentIndexInit();
void initEntry(long pos);
void clear();
}
@@ -0,0 +1,7 @@
package net.openhft.chronicle.map.impl.ret;
import net.openhft.chronicle.map.ReturnValue;
public interface InstanceReturnValue<V> extends ReturnValue<V> {
V returnValue();
}
@@ -0,0 +1,7 @@
package net.openhft.chronicle.map.impl.ret;
public interface UsableReturnValue<V> extends InstanceReturnValue<V> {
Object USING_RETURN_VALUE_UNINT = new Object();
void initUsingReturnValue(V usingValue);
}
@@ -0,0 +1,8 @@
package net.openhft.chronicle.map.impl.value.instance;
import net.openhft.chronicle.hash.Value;
public interface ValueInitableValue<V, T> extends Value<V, T> {
void initValue(V value);
}