public Serde<byte[]> getSerde(String name, Config config) { return new ByteSerde(); } }
public Serde<byte[]> getSerde(String name, Config config) { return new ByteSerde(); } }
@Test public void testEmptyValueDeserialization() { byte[] bytesWithNoValue = new byte[8]; ByteBuffer.wrap(bytesWithNoValue).putLong(1234L); TimestampedValueSerde<byte[]> timestampedValueSerde = new TimestampedValueSerde<>(new ByteSerde()); TimestampedValue<byte[]> timestampedValue = timestampedValueSerde.fromBytes(bytesWithNoValue); assertEquals(1234L, timestampedValue.getTimestamp()); assertEquals(0, timestampedValue.getValue().length); }
private static <K> TimeSeriesStore<K, byte[]> newTimeSeriesStore(Serde<K> keySerde, boolean appendMode) { KeyValueStore<TimeSeriesKey<K>, byte[]> kvStore = new TestInMemoryStore(new TimeSeriesKeySerde<>(keySerde), new ByteSerde()); return new TimeSeriesStoreImpl<>(kvStore, appendMode); } }