@Override @SneakyThrows(IOException.class) public byte[] toBytes() { return SERIALIZER.serialize(this).getCopy(); }
@SneakyThrows(IOException.class) public byte[] toBytes() { return SERIALIZER.serialize(this).getCopy(); }
@SneakyThrows(IOException.class) public byte[] toBytes() { return SERIALIZER.serialize(this).getCopy(); }
@SneakyThrows(IOException.class) public byte[] toBytes() { return SERIALIZER.serialize(this).getCopy(); }
@SneakyThrows(IOException.class) public byte[] toBytes() { return SERIALIZER.serialize(this).getCopy(); }
@SneakyThrows(IOException.class) public byte[] toBytes() { return SERIALIZER.serialize(this).getCopy(); }
@SneakyThrows(IOException.class) public byte[] toBytes() { return SERIALIZER.serialize(this).getCopy(); }
@Override public void insert(Key key, ByteArraySegment data) { insert(key, data.getCopy()); }
@SneakyThrows(IOException.class) public byte[] toBytes() { return SERIALIZER.serialize(this).getCopy(); }
@SneakyThrows(IOException.class) public byte[] toBytes() { return SERIALIZER.serialize(this).getCopy(); }
@Override public void insert(Cache.Key key, ByteArraySegment data) { insert(key, data.getCopy()); }
@SneakyThrows(IOException.class) public byte[] toBytes() { return SERIALIZER.serialize(this).getCopy(); }
@SneakyThrows(IOException.class) public byte[] toBytes() { return SERIALIZER.serialize(this).getCopy(); }
@SneakyThrows(IOException.class) public byte[] toBytes() { return SERIALIZER.serialize(this).getCopy(); }
@SneakyThrows(IOException.class) public byte[] toBytes() { return SERIALIZER.serialize(this).getCopy(); }
@SneakyThrows(IOException.class) public byte[] toBytes() { return SERIALIZER.serialize(this).getCopy(); }
@SneakyThrows(IOException.class) public byte[] toBytes() { return SERIALIZER.serialize(this).getCopy(); }
@SneakyThrows(IOException.class) private Object writeReplace() throws ObjectStreamException { return new SerializedForm(SERIALIZER.serialize(this).getCopy()); }
@SneakyThrows(IOException.class) private Object writeReplace() throws ObjectStreamException { return new KeyVersionImpl.SerializedForm(SERIALIZER.serialize(this).getCopy()); }
CompletableFuture<ByteArraySegment> read(long offset, int length, Duration timeout) { return CompletableFuture.supplyAsync(() -> { synchronized (this.data) { if (this.checkOffsets.get()) { // We want to make sure that we actually read pages that we wrote, and not from arbitrary locations // in the data source. Preconditions.checkArgument(this.offsets.isEmpty() || this.offsets.getOrDefault(offset, false), "Offset not registered or already obsolete: " + offset); } return new ByteArraySegment(this.data.getData().subSegment((int) offset, length).getCopy()); } }, executorService()); }