@Override public void serialize( WritableChannel channel ) throws IOException { channel.put( NeoCommandType.INDEX_CREATE_COMMAND ); writeIndexCommandHeader( channel ); channel.putShort( (short) getConfig().size() ); for ( Map.Entry<String,String> entry : getConfig().entrySet() ) { write2bLengthAndString( channel, entry.getKey() ); write2bLengthAndString( channel, entry.getValue() ); } } }
@Test public void testVisitIndexCreateCommand() throws Exception { IndexCommand.CreateCommand cmd = mock( IndexCommand.CreateCommand.class ); when( cmd.handle( any( CommandVisitor.class ) ) ).thenCallRealMethod(); // WHEN boolean result = facade.visitIndexCreateCommand( cmd ); // THEN InOrder inOrder = inOrder( txApplier1, txApplier2, txApplier3 ); inOrder.verify( txApplier1 ).visitIndexCreateCommand( cmd ); inOrder.verify( txApplier2 ).visitIndexCreateCommand( cmd ); inOrder.verify( txApplier3 ).visitIndexCreateCommand( cmd ); inOrder.verifyNoMoreInteractions(); assertFalse( result ); }
private Command visitIndexCreateCommand( ReadableChannel channel ) throws IOException { IndexCommandHeader header = readIndexCommandHeader( channel ); Map<String,String> config = read2bMap( channel ); CreateCommand command = new CreateCommand(); command.init( header.indexNameId, header.entityType, config ); return command; }
private Command visitIndexCreateCommand( ReadableChannel channel ) throws IOException { IndexCommandHeader header = readIndexCommandHeader( channel ); Map<String,String> config = read2bMap( channel ); CreateCommand command = new CreateCommand(); command.init( header.indexNameId, header.entityType, config ); return command; }
private Command visitIndexCreateCommand( ReadableChannel channel ) throws IOException { IndexCommandHeader header = readIndexCommandHeader( channel ); Map<String,String> config = read2bMap( channel ); CreateCommand command = new CreateCommand(); command.init( header.indexNameId, header.entityType, config ); return command; }
@Override public void createIndex( IndexEntityType entityType, String indexName, Map<String, String> config ) { CreateCommand command = new CreateCommand(); command.init( definitions().getOrAssignIndexNameId( indexName ), entityType.id(), config ); addCommand( indexName, command ); }
@Override public void serialize( WritableChannel channel ) throws IOException { channel.put( NeoCommandType.INDEX_CREATE_COMMAND ); writeIndexCommandHeader( channel ); channel.putShort( (short) getConfig().size() ); for ( Map.Entry<String,String> entry : getConfig().entrySet() ) { write2bLengthAndString( channel, entry.getKey() ); write2bLengthAndString( channel, entry.getValue() ); } } }
@Override public boolean visitIndexCreateCommand( IndexCommand.CreateCommand command ) throws IOException { indexConfigStore.setIfNecessary( IndexEntityType.byId( command.getEntityType() ).entityClass(), defineCommand.getIndexName( command.getIndexNameId() ), command.getConfig() ); return applier( command ).visitIndexCreateCommand( command ); }
private Command visitIndexCreateCommand( ReadableChannel channel ) throws IOException { IndexCommandHeader header = readIndexCommandHeader( channel ); Map<String,String> config = read2bMap( channel ); CreateCommand command = new CreateCommand(); command.init( header.indexNameId, header.entityType, config ); return command; }
private Command visitIndexCreateCommand( ReadableChannel channel ) throws IOException { IndexCommandHeader header = readIndexCommandHeader( channel ); Map<String,String> config = read2bMap( channel ); CreateCommand command = new CreateCommand(); command.init( header.indexNameId, header.entityType, config ); return command; }
@Override public void createIndex( IndexEntityType entityType, String indexName, Map<String, String> config ) { CreateCommand command = new CreateCommand(); command.init( definitions().getOrAssignIndexNameId( indexName ), entityType.id(), config ); addCommand( indexName, command ); }
private Command visitIndexCreateCommand( ReadableChannel channel ) throws IOException { IndexCommandHeader header = readIndexCommandHeader( channel ); Map<String,String> config = read2bMap( channel ); CreateCommand command = new CreateCommand(); command.init( header.indexNameId, header.entityType, config ); return command; }
private Command visitIndexCreateCommand( ReadableChannel channel ) throws IOException { IndexCommandHeader header = readIndexCommandHeader( channel ); Map<String,String> config = read2bMap( channel ); CreateCommand command = new CreateCommand(); command.init( header.indexNameId, header.entityType, config ); return command; }
private Command visitIndexCreateCommand( ReadableChannel channel ) throws IOException { IndexCommandHeader header = readIndexCommandHeader( channel ); Map<String,String> config = read2bMap( channel ); CreateCommand command = new CreateCommand(); command.init( header.indexNameId, header.entityType, config ); return command; }
@Override public boolean visitIndexCreateCommand( IndexCommand.CreateCommand command ) throws IOException { indexConfigStore.setIfNecessary( IndexEntityType.byId( command.getEntityType() ).entityClass(), defineCommand.getIndexName( command.getIndexNameId() ), command.getConfig() ); return applier( command ).visitIndexCreateCommand( command ); }