private void removeRecordsFromNewState(HollowProducer.WriteState newState, Map<String, BitSet> recordsToRemove) { for(Map.Entry<String, BitSet> removalEntry : recordsToRemove.entrySet()) { HollowTypeWriteState writeState = newState.getStateEngine().getTypeState(removalEntry.getKey()); BitSet typeRecordsToRemove = removalEntry.getValue(); int ordinalToRemove = typeRecordsToRemove.nextSetBit(0); while(ordinalToRemove != -1) { writeState.removeOrdinalFromThisCycle(ordinalToRemove); ordinalToRemove = typeRecordsToRemove.nextSetBit(ordinalToRemove+1); } } }
if(currentMutation instanceof FlatRecord) { if(flatRecordDumper == null) flatRecordDumper = new FlatRecordDumper(newState.getStateEngine()); flatRecordDumper.dump((FlatRecord)currentMutation); } else {
FlatRecordDumper dumper = new FlatRecordDumper(state.getStateEngine()); dumper.dump(flatten(new TypeA(1, "two", "three", "four", "five"))); dumper.dump(flatten(new TypeA(2, "two", "four", "six", "eight", "ten")));
FlatRecordDumper dumper = new FlatRecordDumper(state.getStateEngine()); dumper.dump(flatten(new TypeA(1, "two", "three", "four", "five"))); dumper.dump(flatten(new TypeA(2, "two", "four", "six", "eight", "é with acute accent", "ten")));
@Test public void getStateEngine_delegatesToObjectMapper() throws Exception { assertEquals(writeStateEngine, subject.getStateEngine()); }
@Test public void getStateEngine_whenClosed() { assertThrowsAfterClose(() -> subject.getStateEngine()); }
@Override public void populate(HollowProducer.WriteState newState) throws Exception { newState.getStateEngine().addAllObjectsFromPreviousCycle(); removeRecords(newState); addRecords(newState); }