use of com.questdb.net.ha.producer.HugeBufferProducer in project questdb by bluestreak01.
the class MetadataReplicationTest method testReplication.
@Test
public void testReplication() {
try (JournalWriter w = getFactory().writer(Quote.class)) {
MockByteChannel channel = new MockByteChannel();
HugeBufferProducer p = new HugeBufferProducer(new File(w.getLocation(), JournalConfiguration.FILE_NAME));
HugeBufferConsumer c = new HugeBufferConsumer(new File(w.getLocation(), "_remote"));
p.write(channel);
c.read(channel);
try (JournalWriter w2 = getFactory().writer(new JournalMetadata<>(c.getHb(), "xyz"))) {
Assert.assertTrue(w.getMetadata().isCompatible(w2.getMetadata(), false));
}
p.free();
c.free();
} catch (Exception e) {
e.printStackTrace();
}
}
Aggregations