public void populate(HollowProducer.WriteState state) throws Exception { state.add(Integer.valueOf(1)); } });
public void populate(HollowProducer.WriteState state) throws Exception { state.add(Integer.valueOf(1)); } });
public void populate(WriteState state) throws Exception { state.add(Integer.valueOf(cycleNumber)); } });
@Test public void add_whenClosed() { assertThrowsAfterClose(() -> subject.add("Nope!")); }
public void populate(HollowProducer.WriteState state) throws Exception { state.add(null); } });
private long runCycle(HollowProducer producer, final int cycleNumber) { return producer.runCycle(state -> state.add(cycleNumber)); } }
public void populate(WriteState state) throws Exception { state.add(new TypeA(1, "one", 1)); } });
public void populate(WriteState state) throws Exception { state.add(new TypeA(1, "one", 1)); } });
public void populate(WriteState newState) throws Exception { newState.add(new TypeWithPrimaryKey(1, "Brad Pitt", "klsdjfla;sdjkf")); newState.add(new TypeWithPrimaryKey(2, "Angelina Jolie", "as;dlkfjasd;l")); newState.add(new TypeWithPrimaryKey(3, "Angelina Jolie1", "as;dlkfjasd;l")); newState.add(new TypeWithPrimaryKey(4, "Angelina Jolie2", "as;dlkfjasd;l")); newState.add(new TypeWithPrimaryKey(5, "Angelina Jolie3", "as;dlkfjasd;l")); newState.add(new TypeWithPrimaryKey(6, "Angelina Jolie4", "as;dlkfjasd;l")); newState.add(new TypeWithPrimaryKey(7, "Angelina Jolie5", "as;dlkfjasd;l")); } });
private long testPublishV1(HollowProducer producer, final int size, final int valueMultiplier) { producer.runCycle(newState -> { for (int i = 1; i <= size; i++) { newState.add(new TestPojoV1(i, i * valueMultiplier)); } }); Assert.assertNotNull(lastProducerStatus); Assert.assertEquals(Status.SUCCESS, lastProducerStatus.getStatus()); return lastProducerStatus.getVersion(); }
private long testPublishV2(HollowProducer producer, final int size, final int valueMultiplier) { producer.runCycle(newState -> { for (int i = 1; i <= size; i++) { newState.add(new TestPojoV2(i, i * valueMultiplier, i * valueMultiplier)); } }); Assert.assertNotNull(lastProducerStatus); Assert.assertEquals(Status.SUCCESS, lastProducerStatus.getStatus()); return lastProducerStatus.getVersion(); }
private void initializeData(HollowProducer producer) { producer.runCycle(state -> { for (int i = 0; i < ELEMENTS; ++i) { state.add(new SimpleType(i, i)); } }); }
public void populate(WriteState state) throws Exception { state.add(new TypeA(1, "one", 1)); state.add(new TypeA(2, "two", 2)); state.add(new TypeA(3, "three", 3)); state.add(new TypeA(4, "four", 4)); state.add(new TypeA(5, "five", 5)); state.add(new TypeB(1, "1")); state.add(new TypeB(2, "2")); state.add(new TypeB(3, "3")); state.add(new TypeB(4, "4")); } });
@Test public void add_delegatesToObjectMapper() { subject.add("Yes!"); verify(objectMapper).add("Yes!"); }
@Test public void publishAndLoadASnapshot() { HollowProducer producer = HollowProducer.withPublisher(blobStore) .withBlobStager(new HollowInMemoryBlobStager()) .build(); /// Showing verbose version of `runCycle(producer, 1);` long version = producer.runCycle(state -> state.add(1)); HollowConsumer consumer = HollowConsumer.withBlobRetriever(blobStore).build(); consumer.triggerRefreshTo(version); Assert.assertEquals(version, consumer.getCurrentVersionId()); }