mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
Remove the complexity and API-transparency of implementing and supporting built-in serializability for marshallers and core implementation classes, as this is replaced with Wire Marshallable
This commit is contained in:
@@ -22,11 +22,9 @@ import net.openhft.chronicle.wire.WireIn;
|
||||
import net.openhft.chronicle.wire.WireOut;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import static net.openhft.chronicle.core.Maths.isPowerOf2;
|
||||
|
||||
public interface HashSplitting extends Serializable, Marshallable {
|
||||
public interface HashSplitting extends Marshallable {
|
||||
|
||||
int segmentIndex(long hash);
|
||||
long segmentHash(long hash);
|
||||
@@ -62,7 +60,6 @@ public interface HashSplitting extends Serializable, Marshallable {
|
||||
}
|
||||
|
||||
class ForPowerOf2Segments implements HashSplitting {
|
||||
private static final long serialVersionUID = 0L;
|
||||
|
||||
private int mask;
|
||||
private int bits;
|
||||
@@ -97,7 +94,6 @@ public interface HashSplitting extends Serializable, Marshallable {
|
||||
|
||||
//TODO optimize?
|
||||
class ForNonPowerOf2Segments implements HashSplitting {
|
||||
private static final long serialVersionUID = 0L;
|
||||
|
||||
private static final int MASK = Integer.MAX_VALUE;
|
||||
private static final int BITS = 31;
|
||||
|
||||
@@ -29,7 +29,6 @@ import net.openhft.chronicle.hash.serialization.SizeMarshaller;
|
||||
import net.openhft.chronicle.hash.serialization.SizedReader;
|
||||
import net.openhft.chronicle.hash.serialization.impl.SerializationBuilder;
|
||||
import net.openhft.chronicle.map.ChronicleMapBuilder;
|
||||
import net.openhft.chronicle.map.impl.IterationContext;
|
||||
import net.openhft.chronicle.values.Values;
|
||||
import net.openhft.chronicle.wire.Marshallable;
|
||||
import net.openhft.chronicle.wire.WireIn;
|
||||
@@ -38,18 +37,19 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.*;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.RandomAccessFile;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.channels.FileChannel;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import static java.lang.Long.numberOfTrailingZeros;
|
||||
import static java.lang.Math.max;
|
||||
import static java.nio.channels.FileChannel.MapMode.READ_WRITE;
|
||||
import static java.util.stream.Collectors.toSet;
|
||||
import static net.openhft.chronicle.algo.MemoryUnit.*;
|
||||
import static net.openhft.chronicle.algo.bytes.Access.nativeAccess;
|
||||
import static net.openhft.chronicle.bytes.NativeBytesStore.lazyNativeBytesStoreWithFixedCapacity;
|
||||
@@ -60,12 +60,10 @@ import static net.openhft.chronicle.hash.impl.DummyReferenceCounted.DUMMY_REFERE
|
||||
public abstract class VanillaChronicleHash<K,
|
||||
C extends HashEntry<K>, SC extends HashSegmentContext<K, ?>,
|
||||
ECQ extends ExternalHashQueryContext<K>>
|
||||
implements ChronicleHash<K, C, SC, ECQ>, Serializable, Marshallable {
|
||||
implements ChronicleHash<K, C, SC, ECQ>, Marshallable {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(VanillaChronicleHash.class);
|
||||
|
||||
private static final long serialVersionUID = 0L;
|
||||
|
||||
public static final long TIER_COUNTERS_AREA_SIZE = 64;
|
||||
public static final long RESERVED_GLOBAL_MUTABLE_STATE_BYTES = 1024;
|
||||
|
||||
@@ -543,11 +541,6 @@ public abstract class VanillaChronicleHash<K,
|
||||
bytesStore.zeroOut(tierOffset, tierOffset + tierSize - tierEntrySpaceOuterSize);
|
||||
}
|
||||
|
||||
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
|
||||
in.defaultReadObject();
|
||||
initOwnTransients();
|
||||
}
|
||||
|
||||
public void onHeaderCreated() {
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,10 @@ public final class BuildVersion {
|
||||
|
||||
private static String version = null;
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(version());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return version of ChronicleMap being used, or NULL if its not known
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user