private static IndexDefineCommand definitions( MutableObjectIntMap<String> names, MutableObjectIntMap<String> keys ) { IndexDefineCommand definitions = new IndexDefineCommand(); definitions.init( names, keys ); return definitions; }
private static IndexDefineCommand definitions( MutableObjectIntMap<String> names, MutableObjectIntMap<String> keys ) { IndexDefineCommand definitions = new IndexDefineCommand(); definitions.init( names, keys ); return definitions; } }
private Command visitIndexDefineCommand( ReadableChannel channel ) throws IOException { readIndexCommandHeader( channel ); MutableObjectIntMap<String> indexNames = readMap( channel ); MutableObjectIntMap<String> keys = readMap( channel ); IndexDefineCommand command = new IndexDefineCommand(); command.init( indexNames, keys ); return command; }
private Command visitIndexDefineCommand( ReadableChannel channel ) throws IOException { readIndexCommandHeader( channel ); MutableObjectIntMap<String> indexNames = readMap( channel ); MutableObjectIntMap<String> keys = readMap( channel ); IndexDefineCommand command = new IndexDefineCommand(); command.init( indexNames, keys ); return command; }
private Command visitIndexDefineCommand( ReadableChannel channel ) throws IOException { readIndexCommandHeader( channel ); MutableObjectIntMap<String> indexNames = readMap( channel ); MutableObjectIntMap<String> keys = readMap( channel ); IndexDefineCommand command = new IndexDefineCommand(); command.init( indexNames, keys ); return command; }
private Command visitIndexDefineCommand( ReadableChannel channel ) throws IOException { readIndexCommandHeader( channel ); MutableObjectIntMap<String> indexNames = readMap( channel ); MutableObjectIntMap<String> keys = readMap( channel ); IndexDefineCommand command = new IndexDefineCommand(); command.init( indexNames, keys ); return command; }
private IndexDefineCommand initIndexDefineCommand( int nbrOfEntries ) { IndexDefineCommand command = new IndexDefineCommand(); MutableObjectIntMap<String> indexNames = initMap( nbrOfEntries ); MutableObjectIntMap<String> keys = initMap( nbrOfEntries ); command.init( indexNames, keys ); return command; }
@Test public void shouldFailToWriteIndexDefineCommandIfMapIsLargerThanShort() throws IOException { // GIVEN InMemoryClosableChannel channel = new InMemoryClosableChannel( 1000 ); IndexDefineCommand command = new IndexDefineCommand(); MutableObjectIntMap<String> largeMap = initMap( 0xFFFF + 1 ); command.init( largeMap, largeMap ); // WHEN assertTrue( serialize( channel, command ) ); }
@Test public void shouldReadNoKeyIdAsMinusOne() throws Exception { // GIVEN InMemoryClosableChannel channel = new InMemoryClosableChannel(); IndexDefineCommand definitions = new IndexDefineCommand(); int indexNameId = 10; definitions.init( ObjectIntHashMap.newWithKeysValues( "myindex", indexNameId ), new ObjectIntHashMap<>() ); definitions.serialize( channel ); RemoveCommand removeCommand = new IndexCommand.RemoveCommand(); removeCommand.init( indexNameId, IndexEntityType.Node.id(), 1234, -1, null ); removeCommand.serialize( channel ); // WHEN PhysicalLogCommandReaderV2_2_4 reader = new PhysicalLogCommandReaderV2_2_4(); assertTrue( reader.read( channel ) instanceof IndexDefineCommand ); RemoveCommand readRemoveCommand = (RemoveCommand) reader.read( channel ); // THEN assertEquals( removeCommand.getIndexNameId(), readRemoveCommand.getIndexNameId() ); assertEquals( removeCommand.getEntityType(), readRemoveCommand.getEntityType() ); assertEquals( removeCommand.getEntityId(), readRemoveCommand.getEntityId() ); assertEquals( removeCommand.getKeyId(), readRemoveCommand.getKeyId() ); assertNull( removeCommand.getValue() ); } }
private Command visitIndexDefineCommand( ReadableChannel channel ) throws IOException { readIndexCommandHeader( channel ); MutableObjectIntMap<String> indexNames = readMap( channel ); MutableObjectIntMap<String> keys = readMap( channel ); IndexDefineCommand command = new IndexDefineCommand(); command.init( indexNames, keys ); return command; }
private Command visitIndexDefineCommand( ReadableChannel channel ) throws IOException { readIndexCommandHeader( channel ); MutableObjectIntMap<String> indexNames = readMap( channel ); MutableObjectIntMap<String> keys = readMap( channel ); IndexDefineCommand command = new IndexDefineCommand(); command.init( indexNames, keys ); return command; }
private Command visitIndexDefineCommand( ReadableChannel channel ) throws IOException { readIndexCommandHeader( channel ); MutableObjectIntMap<String> indexNames = readMap( channel ); MutableObjectIntMap<String> keys = readMap( channel ); IndexDefineCommand command = new IndexDefineCommand(); command.init( indexNames, keys ); return command; }
private Command visitIndexDefineCommand( ReadableChannel channel ) throws IOException { readIndexCommandHeader( channel ); MutableObjectIntMap<String> indexNames = readMap( channel ); MutableObjectIntMap<String> keys = readMap( channel ); IndexDefineCommand command = new IndexDefineCommand(); command.init( indexNames, keys ); return command; }