private NeoStoreRecord readNeoStoreRecord( ReadableChannel channel ) throws IOException { long nextProp = channel.getLong(); NeoStoreRecord record = new NeoStoreRecord(); record.setNextProp( nextProp ); return record; }
private static String neoStoreRecord( boolean used, long nextProp ) { NeoStoreRecord record = new NeoStoreRecord(); record.setInUse( used ); record.setNextProp( nextProp ); return record.toString(); } }
@Override public NeoStoreRecord clone() { NeoStoreRecord neoStoreRecord = new NeoStoreRecord(); neoStoreRecord.setNextProp( getNextProp() ); return neoStoreRecord; } }
@Override public String toString() { return getClass().getSimpleName() + "[" + "used=" + inUse() + ",prop=" + getNextProp() + "]"; }
@Test void shouldNotReportAnythingForRecordWithNoPropertyReference() { // given NeoStoreRecord record = new NeoStoreRecord(); // when ConsistencyReport.NeoStoreConsistencyReport report = check( record ); // then verifyNoMoreInteractions( report ); }
public NeoStoreRecord() { super( -1 ); setInUse( true ); }
private void writeNeoStoreRecord( WritableChannel channel, NeoStoreRecord record ) throws IOException { channel.putLong( record.getNextProp() ); } }
@Override public void clear() { initialize( false, -1 ); }
@Test void shouldFormatLogForChangedRecord() { // when logger.error( RecordType.NEO_STORE, new NeoStoreRecord(), new NeoStoreRecord(), "sample message", 1, 2 ); // then logProvider.assertExactly( INLOG.error( join( "sample message", "- " + neoStoreRecord( true, -1 ), "+ " + neoStoreRecord( true, -1 ), "Inconsistent with: 1 2" ) ) ); }
public NeoStoreRecord() { super( -1 ); setInUse( true ); }
@Override public String toString() { return getClass().getSimpleName() + "[" + "used=" + inUse() + ",prop=" + getNextProp() + "]"; }
@Override public boolean visitNeoStoreCommand( Command.NeoStoreCommand command ) { neoStores.getMetaDataStore().setGraphNextProp( selectRecordByCommandVersion( command ).getNextProp() ); return false; }
@Override public void clear() { initialize( false, -1 ); }
public NeoStoreRecord graphPropertyRecord() { NeoStoreRecord result = new NeoStoreRecord(); result.setNextProp( getGraphNextProp() ); return result; }
@Test public void shouldApplyNeoStoreCommandToTheStore() throws Exception { // given final BatchTransactionApplier applier = newApplier( false ); final NeoStoreRecord before = new NeoStoreRecord(); final NeoStoreRecord after = new NeoStoreRecord(); after.setNextProp( 42 ); final Command command = new Command.NeoStoreCommand( before, after ); // when boolean result = apply( applier, command::handle, transactionToApply ); // then assertFalse( result ); verify( metaDataStore, times( 1 ) ).setGraphNextProp( after.getNextProp() ); }
private String neoStoreRecord( boolean used, long nextProp ) { NeoStoreRecord record = new NeoStoreRecord(); record.setInUse( used ); record.setNextProp( nextProp ); return record.toString(); }
@Test void shouldFlattenAMultiLineMessageToASingleLine() { // when logger.error( RecordType.NEO_STORE, new NeoStoreRecord(), "multiple\n line\r\n message", 1, 2 ); // then logProvider.assertExactly( INLOG.error( join( "multiple line message", neoStoreRecord( true, -1 ), "Inconsistent with: 1 2" ) ) ); }
private void writeNeoStoreRecord( WritableChannel channel, NeoStoreRecord record ) throws IOException { channel.putLong( record.getNextProp() ); } }
private NeoStoreRecord readNeoStoreRecord( ReadableChannel channel ) throws IOException { long nextProp = channel.getLong(); NeoStoreRecord record = new NeoStoreRecord(); record.setNextProp( nextProp ); return record; }
@Test public void shouldApplyNeoStoreCommandToTheStoreInRecovery() throws Exception { // given final BatchTransactionApplier applier = newApplier( true ); final NeoStoreRecord before = new NeoStoreRecord(); final NeoStoreRecord after = new NeoStoreRecord(); after.setNextProp( 42 ); final Command command = new Command.NeoStoreCommand( before, after ); // when boolean result = apply( applier, command::handle, transactionToApply ); // then assertFalse( result ); verify( metaDataStore, times( 1 ) ).setGraphNextProp( after.getNextProp() ); }