public MappedNativeBytes(@NotNull final MappedFile mappedFile, boolean isSingleThreaded) { this.isSingleThreaded = isSingleThreaded; this.mappedFile = mappedFile; this.start = 0; this.position = start; this.limit = this.capacity = Long.MAX_VALUE; this.chronicleUnsafe = (isSingleThreaded) ? new ChronicleUnsafe(mappedFile) : null; }
public MappedNativeBytes(@NotNull final MappedFile mappedFile, boolean isSingleThreaded) { this.isSingleThreaded = isSingleThreaded; this.mappedFile = mappedFile; this.start = 0; this.position = start; this.limit = this.capacity = Long.MAX_VALUE; this.chronicleUnsafe = (isSingleThreaded) ? new ChronicleUnsafe(mappedFile) : null; }
@NotNull public ChronicleUnsafe getChronicleUnsafe() { if (isSingleThreaded) return chronicleUnsafe; ChronicleUnsafe chronicleUnsafe = threadLocal.get(); if (chronicleUnsafe == null) { chronicleUnsafe = new ChronicleUnsafe(mappedFile); threadLocal.set(chronicleUnsafe); } return chronicleUnsafe; } }
@NotNull public ChronicleUnsafe getChronicleUnsafe() { if (isSingleThreaded) return chronicleUnsafe; ChronicleUnsafe chronicleUnsafe = threadLocal.get(); if (chronicleUnsafe == null) { chronicleUnsafe = new ChronicleUnsafe(mappedFile); threadLocal.set(chronicleUnsafe); } return chronicleUnsafe; } }
public MappedNativeBytes(ObjectSerializer objectSerializer, long sliceStart, long capacity, @NotNull AtomicInteger refCount, @NotNull MappedFile mappedFile, boolean singleThreaded) { this.isSingleThreaded = singleThreaded; setObjectSerializer(objectSerializer); this.start = sliceStart; this.position = 0; this.capacity = capacity; this.refCount.set(refCount.get()); this.mappedFile = mappedFile; this.chronicleUnsafe = (isSingleThreaded) ? new ChronicleUnsafe(mappedFile) : null; }
public MappedNativeBytes(ObjectSerializer objectSerializer, long sliceStart, long capacity, @NotNull AtomicInteger refCount, @NotNull MappedFile mappedFile, boolean singleThreaded) { this.isSingleThreaded = singleThreaded; setObjectSerializer(objectSerializer); this.start = sliceStart; this.position = 0; this.capacity = capacity; this.refCount.set(refCount.get()); this.mappedFile = mappedFile; this.chronicleUnsafe = (isSingleThreaded) ? new ChronicleUnsafe(mappedFile) : null; }