First step in separation of core ChronicleHash functionality from Map and Set; Start Java 8 adoption; Bug fixes

This commit is contained in:
leventov
2015-02-12 15:24:24 +07:00
parent 7bfaa87d5d
commit 16f85e4c5e
45 changed files with 2841 additions and 2279 deletions
@@ -16,12 +16,14 @@
package net.openhft.chronicle.map;
import net.openhft.chronicle.hash.impl.util.Objects;
import net.openhft.lang.io.Bytes;
import org.jetbrains.annotations.NotNull;
import java.io.File;
import java.util.Set;
public class BytesChronicleMap extends AbstractChronicleMap<Bytes, Bytes> {
public class BytesChronicleMap implements AbstractChronicleMap<Bytes, Bytes> {
private final VanillaChronicleMap<?, ?, ?, ?, ?, ?> delegate;
TcpReplicator.TcpSocketChannelEntryWriter output;
@@ -31,22 +33,17 @@ public class BytesChronicleMap extends AbstractChronicleMap<Bytes, Bytes> {
}
@Override
void putDefaultValue(VanillaContext context) {
public void putDefaultValue(VanillaContext context) {
delegate.putDefaultValue(context);
}
@Override
int actualSegments() {
public int actualSegments() {
return delegate.actualSegments();
}
@Override
VanillaContext<Bytes, ?, ?, Bytes, ?, ?> rawContext() {
return delegate.rawBytesContext();
}
@Override
VanillaContext<Bytes, ?, ?, Bytes, ?, ?> mapContext() {
public VanillaContext<Bytes, ?, ?, Bytes, ?, ?> mapContext() {
VanillaContext context = delegate.bytesMapContext();
context.output = output;
return context;
@@ -71,7 +68,7 @@ public class BytesChronicleMap extends AbstractChronicleMap<Bytes, Bytes> {
}
@Override
void checkValue(Bytes value) {
public void checkValue(Bytes value) {
Objects.requireNonNull(value);
}
@@ -122,4 +119,20 @@ public class BytesChronicleMap extends AbstractChronicleMap<Bytes, Bytes> {
entries.position(entryPosition);
}
}
@Override
public int size() {
return delegate.size();
}
@Override
public void clear() {
delegate.clear();
}
@NotNull
@Override
public Set<Entry<Bytes, Bytes>> entrySet() {
throw new UnsupportedOperationException();
}
}