diff --git a/block-storage/src/main/java/org/lucares/pdb/blockstorage/BSFile.java b/block-storage/src/main/java/org/lucares/pdb/blockstorage/BSFile.java index fc73026..1f4f9d3 100644 --- a/block-storage/src/main/java/org/lucares/pdb/blockstorage/BSFile.java +++ b/block-storage/src/main/java/org/lucares/pdb/blockstorage/BSFile.java @@ -159,7 +159,7 @@ public class BSFile implements AutoCloseable { public void flush() { - LOGGER.trace("flush bsFile={} dirty={}", rootBlockOffset, dirty); + LOGGER.trace("flush bsFile={} dirty={} file={}", rootBlockOffset, dirty, diskStorage.getRelativeDatabaseFileForLogging()); if (dirty) { buffer.writeAsync(); } diff --git a/block-storage/src/main/java/org/lucares/pdb/diskstorage/DiskStorage.java b/block-storage/src/main/java/org/lucares/pdb/diskstorage/DiskStorage.java index c3dd8fd..29d4eb7 100644 --- a/block-storage/src/main/java/org/lucares/pdb/diskstorage/DiskStorage.java +++ b/block-storage/src/main/java/org/lucares/pdb/diskstorage/DiskStorage.java @@ -25,7 +25,11 @@ public class DiskStorage implements AutoCloseable { private final FileChannel fileChannel; - public DiskStorage(final Path databaseFile) { + private Path relativeDatabaseFileForLogging; + + + public DiskStorage(final Path databaseFile, Path storageBasePath) { + this.relativeDatabaseFileForLogging = storageBasePath != null ? storageBasePath.relativize(databaseFile): databaseFile; try { Files.createDirectories(databaseFile.getParent()); @@ -47,7 +51,7 @@ public class DiskStorage implements AutoCloseable { public DiskBlock getDiskBlock(final long blockOffset, final int blockSize) { try { - LOGGER.trace("read block={}", blockOffset); + LOGGER.trace("read block={} file={}", blockOffset, relativeDatabaseFileForLogging); final var byteBuffer = fileChannel.map(MapMode.READ_WRITE, blockOffset, blockSize); @@ -56,6 +60,10 @@ public class DiskStorage implements AutoCloseable { throw new DiskStorageException(e); } } + + public Path getRelativeDatabaseFileForLogging() { + return relativeDatabaseFileForLogging; + } @Override public void close() { diff --git a/block-storage/src/main/java/org/lucares/pdb/map/PersistentMap.java b/block-storage/src/main/java/org/lucares/pdb/map/PersistentMap.java index aa12ea8..f029036 100644 --- a/block-storage/src/main/java/org/lucares/pdb/map/PersistentMap.java +++ b/block-storage/src/main/java/org/lucares/pdb/map/PersistentMap.java @@ -48,6 +48,8 @@ public class PersistentMap implements AutoCloseable { public default Function asEncoder() { return plain -> this.encode(plain); } + + public byte[] getEmptyValue(); } private static final class StringCoder implements EncoderDecoder { @@ -61,6 +63,10 @@ public class PersistentMap implements AutoCloseable { public String decode(final byte[] bytes) { return bytes == null ? null : new String(bytes, StandardCharsets.UTF_8); } + + public byte[] getEmptyValue() { + return new byte[] {0}; + } } private static final class LongCoder implements EncoderDecoder { @@ -74,6 +80,10 @@ public class PersistentMap implements AutoCloseable { public Long decode(final byte[] bytes) { return bytes == null ? null : VariableByteEncoder.decodeFirstValue(bytes); } + + public byte[] getEmptyValue() { + return new byte[] {0}; + } } private static final class UUIDCoder implements EncoderDecoder { @@ -94,6 +104,10 @@ public class PersistentMap implements AutoCloseable { return new UUID(mostSignificantBits, leastSignificantBits); } + + public byte[] getEmptyValue() { + return new byte[] {0}; + } } private static final class EmptyCoder implements EncoderDecoder { @@ -112,6 +126,10 @@ public class PersistentMap implements AutoCloseable { return Empty.INSTANCE; } + + public byte[] getEmptyValue() { + return new byte[] {}; + } } public static final EncoderDecoder LONG_CODER = new LongCoder(); @@ -134,8 +152,8 @@ public class PersistentMap implements AutoCloseable { private final LRUCache valueCache = new LRUCache<>(1_000); - public PersistentMap(final Path path, final EncoderDecoder keyEncoder, final EncoderDecoder valueEncoder) { - this.diskStore = new DiskStorage(path); + public PersistentMap(final Path path, final Path storageBasePath, final EncoderDecoder keyEncoder, final EncoderDecoder valueEncoder) { + this.diskStore = new DiskStorage(path, storageBasePath); this.keyEncoder = keyEncoder; this.valueEncoder = valueEncoder; initIfNew(); @@ -169,7 +187,7 @@ public class PersistentMap implements AutoCloseable { writeNodeOffsetOfRootNode(blockOffset); // 5. insert a dummy entry with a 'maximum' key - putValue(MAX_KEY, new byte[] { }); + putValue(MAX_KEY, valueEncoder.getEmptyValue()); } } diff --git a/block-storage/src/test/java/org/lucares/pdb/blockstorage/BSFileTest.java b/block-storage/src/test/java/org/lucares/pdb/blockstorage/BSFileTest.java index ba10653..c247084 100644 --- a/block-storage/src/test/java/org/lucares/pdb/blockstorage/BSFileTest.java +++ b/block-storage/src/test/java/org/lucares/pdb/blockstorage/BSFileTest.java @@ -43,8 +43,8 @@ public class BSFileTest { long blockOffset = -1; long start = System.nanoTime(); - // - try (final DiskStorage ds = new DiskStorage(file)) { + + try (final DiskStorage ds = new DiskStorage(file, dataDirectory)) { try (final BSFile bsFile = BSFile.newFile(ds, NullCustomizer.INSTANCE)) { @@ -64,7 +64,7 @@ public class BSFileTest { System.out.println("duration write: " + (System.nanoTime() - start) / 1_000_000.0 + "ms"); start = System.nanoTime(); - try (final DiskStorage ds = new DiskStorage(file)) { + try (final DiskStorage ds = new DiskStorage(file, dataDirectory)) { final BSFile bsFile = BSFile.existingFile(blockOffset, ds, NullCustomizer.INSTANCE); final LongList actualLongs = bsFile.asLongList(); final LongList expectedLongs = LongList.rangeClosed(0, numLongs - 1); @@ -83,7 +83,7 @@ public class BSFileTest { final Map expected = new HashMap<>(); final List> futures = new ArrayList<>(); final long start = System.nanoTime(); - try (final DiskStorage ds = new DiskStorage(file)) { + try (final DiskStorage ds = new DiskStorage(file, dataDirectory)) { for (int i = 0; i < threads; i++) { final Future future = pool.submit(() -> { @@ -117,7 +117,7 @@ public class BSFileTest { System.out.println("duration write: " + (System.nanoTime() - start) / 1_000_000.0 + "ms"); // verification - try (final DiskStorage ds = new DiskStorage(file)) { + try (final DiskStorage ds = new DiskStorage(file, dataDirectory)) { for (final Entry entry : expected.entrySet()) { final long rootBlockNumber = entry.getKey(); final LongList expectedValues = entry.getValue(); diff --git a/block-storage/src/test/java/org/lucares/pdb/blockstorage/TimeSeriesFileTest.java b/block-storage/src/test/java/org/lucares/pdb/blockstorage/TimeSeriesFileTest.java index a143426..1ace4d0 100644 --- a/block-storage/src/test/java/org/lucares/pdb/blockstorage/TimeSeriesFileTest.java +++ b/block-storage/src/test/java/org/lucares/pdb/blockstorage/TimeSeriesFileTest.java @@ -37,7 +37,7 @@ public class TimeSeriesFileTest { long start = System.nanoTime(); long lastEpochMilli = 0; // - try (final DiskStorage ds = new DiskStorage(file)) { + try (final DiskStorage ds = new DiskStorage(file, dataDirectory)) { try (final TimeSeriesFile bsFile = TimeSeriesFile.newFile(ds)) { @@ -72,7 +72,7 @@ public class TimeSeriesFileTest { System.out.println("duration write: " + (System.nanoTime() - start) / 1_000_000.0 + "ms"); start = System.nanoTime(); - try (final DiskStorage ds = new DiskStorage(file)) { + try (final DiskStorage ds = new DiskStorage(file, dataDirectory)) { final TimeSeriesFile bsFile = TimeSeriesFile.existingFile(blockNumber, ds); final LongList actualLongs = bsFile.asTimeValueLongList(); diff --git a/block-storage/src/test/java/org/lucares/pdb/diskstorage/DiskStorageTest.java b/block-storage/src/test/java/org/lucares/pdb/diskstorage/DiskStorageTest.java index f31c95d..d6ec734 100644 --- a/block-storage/src/test/java/org/lucares/pdb/diskstorage/DiskStorageTest.java +++ b/block-storage/src/test/java/org/lucares/pdb/diskstorage/DiskStorageTest.java @@ -43,7 +43,7 @@ public class DiskStorageTest { final Path databaseFile = dataDirectory.resolve("db.ds"); Files.deleteIfExists(databaseFile); - try (DiskStorage ds = new DiskStorage(databaseFile)) { + try (DiskStorage ds = new DiskStorage(databaseFile, dataDirectory)) { final int numBlocks = 10; allocateBlocks(ds, numBlocks, BLOCK_SIZE); @@ -81,7 +81,7 @@ public class DiskStorageTest { // // But it does see the changes. Most likely, because both channels // use the same buffers from the operating system. - try (DiskStorage ds2 = new DiskStorage(databaseFile)) { + try (DiskStorage ds2 = new DiskStorage(databaseFile, dataDirectory)) { for (int i = 0; i < numBlocks; i++) { final DiskBlock diskBlock = ds2.getDiskBlock(i, BLOCK_SIZE); assertAllValuesAreEqual(diskBlock, (byte) i); @@ -98,7 +98,7 @@ public class DiskStorageTest { final ExecutorService pool = Executors.newCachedThreadPool(); - try (DiskStorage ds = new DiskStorage(databaseFile)) { + try (DiskStorage ds = new DiskStorage(databaseFile, dataDirectory)) { final int numBlocks = 10; final long[] blockOffsets = allocateBlocks(ds, numBlocks, BLOCK_SIZE); @@ -140,7 +140,7 @@ public class DiskStorageTest { public void testAllocationSmallerThanMinimalBlockSize() throws Exception { final Path databaseFile = dataDirectory.resolve("db.ds"); - try (DiskStorage ds = new DiskStorage(databaseFile)) { + try (DiskStorage ds = new DiskStorage(databaseFile, dataDirectory)) { final int blockSize = 31; // minimal block size is 32 ds.allocateBlock(blockSize); @@ -151,7 +151,7 @@ public class DiskStorageTest { public void testAllocateAndFreeSingleBlockInFreeList() throws Exception { final Path databaseFile = dataDirectory.resolve("db.ds"); - try (DiskStorage ds = new DiskStorage(databaseFile)) { + try (DiskStorage ds = new DiskStorage(databaseFile, dataDirectory)) { final int blockSize = 32; final long block_8_39 = ds.allocateBlock(blockSize); @@ -175,7 +175,7 @@ public class DiskStorageTest { public void testAllocateAndFreeMultipleBlocksInFreeList() throws Exception { final Path databaseFile = dataDirectory.resolve("db.ds"); - try (DiskStorage ds = new DiskStorage(databaseFile)) { + try (DiskStorage ds = new DiskStorage(databaseFile, dataDirectory)) { final int blockSize = 32; ds.allocateBlock(blockSize); @@ -212,7 +212,7 @@ public class DiskStorageTest { public void testAllocateAndFreeInsertFreeNodeInTheMiddleOfTheFreeList() throws Exception { final Path databaseFile = dataDirectory.resolve("db.ds"); - try (DiskStorage ds = new DiskStorage(databaseFile)) { + try (DiskStorage ds = new DiskStorage(databaseFile, dataDirectory)) { final int blockSize = 32; ds.allocateBlock(blockSize); @@ -242,7 +242,7 @@ public class DiskStorageTest { public void testAllocateAndFreeMultipleBlocksWithDifferentSizes() throws Exception { final Path databaseFile = dataDirectory.resolve("db.ds"); - try (DiskStorage ds = new DiskStorage(databaseFile)) { + try (DiskStorage ds = new DiskStorage(databaseFile, dataDirectory)) { final int blockSizeSmall = 32; final int blockSizeBig = 64; diff --git a/block-storage/src/test/java/org/lucares/pdb/map/PersistentMapTest.java b/block-storage/src/test/java/org/lucares/pdb/map/PersistentMapTest.java index 53f7dbb..d7f11de 100644 --- a/block-storage/src/test/java/org/lucares/pdb/map/PersistentMapTest.java +++ b/block-storage/src/test/java/org/lucares/pdb/map/PersistentMapTest.java @@ -41,7 +41,7 @@ public class PersistentMapTest { final String value = "value1"; final String key = "key1"; - try (final PersistentMap map = new PersistentMap<>(file, PersistentMap.STRING_CODER, + try (final PersistentMap map = new PersistentMap<>(file, dataDirectory, PersistentMap.STRING_CODER, PersistentMap.STRING_CODER)) { Assert.assertNull(map.getValue(key)); @@ -50,7 +50,7 @@ public class PersistentMapTest { Assert.assertEquals(map.getValue(key), value); } - try (final PersistentMap map = new PersistentMap<>(file, PersistentMap.STRING_CODER, + try (final PersistentMap map = new PersistentMap<>(file, dataDirectory,PersistentMap.STRING_CODER, PersistentMap.STRING_CODER)) { Assert.assertEquals(map.getValue(key), value); @@ -64,7 +64,7 @@ public class PersistentMapTest { final Random rnd = new Random(1); - try (final PersistentMap map = new PersistentMap<>(file, PersistentMap.STRING_CODER, + try (final PersistentMap map = new PersistentMap<>(file,dataDirectory, PersistentMap.STRING_CODER, PersistentMap.STRING_CODER)) { map.setMaxEntriesInNode(2); @@ -98,7 +98,7 @@ public class PersistentMapTest { } } - try (final PersistentMap map = new PersistentMap<>(file, PersistentMap.STRING_CODER, + try (final PersistentMap map = new PersistentMap<>(file,dataDirectory, PersistentMap.STRING_CODER, PersistentMap.STRING_CODER)) { // map.print(PersistentMap.STRING_DECODER, PersistentMap.STRING_DECODER); final AtomicInteger maxDepth = new AtomicInteger(); @@ -127,7 +127,7 @@ public class PersistentMapTest { final SecureRandom rnd = new SecureRandom(); rnd.setSeed(1); - try (final PersistentMap map = new PersistentMap<>(file, PersistentMap.LONG_CODER, + try (final PersistentMap map = new PersistentMap<>(file,dataDirectory, PersistentMap.LONG_CODER, PersistentMap.LONG_CODER)) { for (int i = 0; i < 1000; i++) { @@ -159,7 +159,7 @@ public class PersistentMapTest { } } - try (final PersistentMap map = new PersistentMap<>(file, PersistentMap.LONG_CODER, + try (final PersistentMap map = new PersistentMap<>(file,dataDirectory, PersistentMap.LONG_CODER, PersistentMap.LONG_CODER)) { // map.print(PersistentMap.LONG_DECODER, PersistentMap.LONG_DECODER); final AtomicInteger counter = new AtomicInteger(); @@ -187,7 +187,7 @@ public class PersistentMapTest { final SecureRandom rnd = new SecureRandom(); rnd.setSeed(1); - try (final PersistentMap map = new PersistentMap<>(file, PersistentMap.LONG_CODER, + try (final PersistentMap map = new PersistentMap<>(file,dataDirectory, PersistentMap.LONG_CODER, PersistentMap.EMPTY_ENCODER)) { for (int i = 0; i < 1500; i++) { @@ -219,7 +219,7 @@ public class PersistentMapTest { } } - try (final PersistentMap map = new PersistentMap<>(file, PersistentMap.LONG_CODER, + try (final PersistentMap map = new PersistentMap<>(file,dataDirectory, PersistentMap.LONG_CODER, PersistentMap.EMPTY_ENCODER)) { map.print(); final AtomicInteger counter = new AtomicInteger(); @@ -247,7 +247,7 @@ public class PersistentMapTest { final Queue numbers = new LinkedList<>(Arrays.asList(1, 15, 11, 4, 16, 3, 13)); - try (final PersistentMap map = new PersistentMap<>(file, PersistentMap.STRING_CODER, + try (final PersistentMap map = new PersistentMap<>(file,dataDirectory, PersistentMap.STRING_CODER, PersistentMap.STRING_CODER)) { final int numbersSize = numbers.size(); @@ -275,7 +275,7 @@ public class PersistentMapTest { } } - try (final PersistentMap map = new PersistentMap<>(file, PersistentMap.STRING_CODER, + try (final PersistentMap map = new PersistentMap<>(file,dataDirectory, PersistentMap.STRING_CODER, PersistentMap.STRING_CODER)) { // map.print(PersistentMap.STRING_DECODER, PersistentMap.STRING_DECODER); @@ -309,13 +309,13 @@ public class PersistentMapTest { input.put(UUID.randomUUID().toString(), UUID.randomUUID().toString()); } - try (final PersistentMap map = new PersistentMap<>(file, PersistentMap.STRING_CODER, + try (final PersistentMap map = new PersistentMap<>(file,dataDirectory, PersistentMap.STRING_CODER, PersistentMap.STRING_CODER)) { map.putAllValues(input); } - try (final PersistentMap map = new PersistentMap<>(file, PersistentMap.STRING_CODER, + try (final PersistentMap map = new PersistentMap<>(file,dataDirectory, PersistentMap.STRING_CODER, PersistentMap.STRING_CODER)) { { @@ -336,7 +336,7 @@ public class PersistentMapTest { final SecureRandom rnd = new SecureRandom(); rnd.setSeed(1); - try (final PersistentMap map = new PersistentMap<>(file, PersistentMap.LONG_CODER, + try (final PersistentMap map = new PersistentMap<>(file,dataDirectory, PersistentMap.LONG_CODER, PersistentMap.LONG_CODER)) { for (int i = 0; i < 1_000; i++) { @@ -368,7 +368,7 @@ public class PersistentMapTest { } } - try (final PersistentMap map = new PersistentMap<>(file, PersistentMap.LONG_CODER, + try (final PersistentMap map = new PersistentMap<>(file,dataDirectory, PersistentMap.LONG_CODER, PersistentMap.LONG_CODER)) { final AtomicInteger counter = new AtomicInteger(); final AtomicInteger maxDepth = new AtomicInteger(); diff --git a/data-store/src/main/java/org/lucares/pdb/datastore/internal/DocEncoderDecoder.java b/data-store/src/main/java/org/lucares/pdb/datastore/internal/DocEncoderDecoder.java index a780bcd..dd005fc 100644 --- a/data-store/src/main/java/org/lucares/pdb/datastore/internal/DocEncoderDecoder.java +++ b/data-store/src/main/java/org/lucares/pdb/datastore/internal/DocEncoderDecoder.java @@ -43,4 +43,8 @@ class DocEncoderDecoder implements PartitionAwareEncoderDecoder { } return t; } + + public byte[] getEmptyValue() { + return new byte[] {0}; + } } diff --git a/data-store/src/main/java/org/lucares/pdb/datastore/internal/PartitionAwareWrapper.java b/data-store/src/main/java/org/lucares/pdb/datastore/internal/PartitionAwareWrapper.java index 14e175c..0ba33fc 100644 --- a/data-store/src/main/java/org/lucares/pdb/datastore/internal/PartitionAwareWrapper.java +++ b/data-store/src/main/java/org/lucares/pdb/datastore/internal/PartitionAwareWrapper.java @@ -33,4 +33,8 @@ public final class PartitionAwareWrapper implements PartitionAwareEncoderDeco public static PartitionAwareEncoderDecoder wrap(final EncoderDecoder encoder) { return new PartitionAwareWrapper<>(encoder); } + + public byte[] getEmptyValue() { + return delegate.getEmptyValue(); + } } \ No newline at end of file diff --git a/data-store/src/main/java/org/lucares/pdb/datastore/internal/PartitionDiskStore.java b/data-store/src/main/java/org/lucares/pdb/datastore/internal/PartitionDiskStore.java index fd53e4b..b2df65e 100644 --- a/data-store/src/main/java/org/lucares/pdb/datastore/internal/PartitionDiskStore.java +++ b/data-store/src/main/java/org/lucares/pdb/datastore/internal/PartitionDiskStore.java @@ -24,7 +24,7 @@ public class PartitionDiskStore { creator = partitionId -> { final Path file = storageBasePath.resolve(partitionId.getPartitionId()).resolve(filename); final boolean isNew = !Files.exists(file); - final DiskStorage diskStorage = new DiskStorage(file); + final DiskStorage diskStorage = new DiskStorage(file, storageBasePath); if (isNew) { diskStorage.ensureAlignmentForNewBlocks(BSFile.BLOCK_SIZE); } @@ -33,7 +33,7 @@ public class PartitionDiskStore { supplier = partitionId -> { final Path file = storageBasePath.resolve(partitionId.getPartitionId()).resolve(filename); if (Files.exists(file)) { - return new DiskStorage(file); + return new DiskStorage(file, storageBasePath); } return null; }; diff --git a/data-store/src/main/java/org/lucares/pdb/datastore/internal/PartitionPersistentMap.java b/data-store/src/main/java/org/lucares/pdb/datastore/internal/PartitionPersistentMap.java index e02fdd9..5e8ba43 100644 --- a/data-store/src/main/java/org/lucares/pdb/datastore/internal/PartitionPersistentMap.java +++ b/data-store/src/main/java/org/lucares/pdb/datastore/internal/PartitionPersistentMap.java @@ -38,12 +38,12 @@ public class PartitionPersistentMap implements AutoCloseable { this.valueEncoder = valueEncoder; creator = partitionId -> { final Path file = storageBasePath.resolve(partitionId.getPartitionId()).resolve(filename); - return new PersistentMap<>(file, keyEncoder, valueEncoder); + return new PersistentMap<>(file, storageBasePath, keyEncoder, valueEncoder); }; supplier = partitionId -> { final Path file = storageBasePath.resolve(partitionId.getPartitionId()).resolve(filename); if (Files.exists(file)) { - return new PersistentMap<>(file, keyEncoder, valueEncoder); + return new PersistentMap<>(file, storageBasePath, keyEncoder, valueEncoder); } return null; }; diff --git a/data-store/src/main/java/org/lucares/pdb/datastore/internal/QueryCompletionIndex.java b/data-store/src/main/java/org/lucares/pdb/datastore/internal/QueryCompletionIndex.java index c3bba05..daf4f3a 100644 --- a/data-store/src/main/java/org/lucares/pdb/datastore/internal/QueryCompletionIndex.java +++ b/data-store/src/main/java/org/lucares/pdb/datastore/internal/QueryCompletionIndex.java @@ -164,6 +164,11 @@ public class QueryCompletionIndex implements AutoCloseable { return new TwoTags(tagA, tagB); } + + @Override + public byte[] getEmptyValue() { + return new byte[] {0,0,0,0}; + } } private static final class EncoderTag implements EncoderDecoder { @@ -188,6 +193,11 @@ public class QueryCompletionIndex implements AutoCloseable { return new Tag(key, value); } + + @Override + public byte[] getEmptyValue() { + return new byte[] {0}; + } } private static final class EncoderField implements EncoderDecoder { @@ -207,6 +217,11 @@ public class QueryCompletionIndex implements AutoCloseable { final long compressedString = VariableByteEncoder.decodeFirstValue(bytes); return Tags.STRING_COMPRESSOR.get((int) compressedString); } + + @Override + public byte[] getEmptyValue() { + return new byte[] {0}; + } } private final PartitionPersistentMap tagToTagIndex; diff --git a/data-store/src/main/java/org/lucares/pdb/datastore/internal/TagEncoderDecoder.java b/data-store/src/main/java/org/lucares/pdb/datastore/internal/TagEncoderDecoder.java index 4cd3540..d807eb1 100644 --- a/data-store/src/main/java/org/lucares/pdb/datastore/internal/TagEncoderDecoder.java +++ b/data-store/src/main/java/org/lucares/pdb/datastore/internal/TagEncoderDecoder.java @@ -56,4 +56,9 @@ class TagEncoderDecoder implements EncoderDecoder { return result; } + + @Override + public byte[] getEmptyValue() { + return new byte[] {0}; + } } diff --git a/data-store/src/main/java/org/lucares/pdb/datastore/internal/TagsEncoderDecoder.java b/data-store/src/main/java/org/lucares/pdb/datastore/internal/TagsEncoderDecoder.java index e1a051c..f2933d5 100644 --- a/data-store/src/main/java/org/lucares/pdb/datastore/internal/TagsEncoderDecoder.java +++ b/data-store/src/main/java/org/lucares/pdb/datastore/internal/TagsEncoderDecoder.java @@ -13,4 +13,9 @@ class TagsEncoderDecoder implements EncoderDecoder { public Tags decode(final byte[] bytes) { return Tags.fromBytes(bytes); } + + @Override + public byte[] getEmptyValue() { + return new byte[] {}; + } } diff --git a/pdb-ui/src/main/java/org/lucares/pdbui/TcpIngestor.java b/pdb-ui/src/main/java/org/lucares/pdbui/TcpIngestor.java index 325f566..0ac9bbe 100644 --- a/pdb-ui/src/main/java/org/lucares/pdbui/TcpIngestor.java +++ b/pdb-ui/src/main/java/org/lucares/pdbui/TcpIngestor.java @@ -322,6 +322,10 @@ public class TcpIngestor implements Ingestor, AutoCloseable, DisposableBean { public TcpIngestor(final PerformanceDb db) { this.db = db; } + + public PerformanceDb getDb() { + return db; + } @Async @Override