test_class.file: jimsql/jim-rpc/src/test/java/io/jimdb/rpc/client/NettyClientTest.java
test_class.identifier: NettyClientTest
test_class.superclass: extends BaseTest
test_case.body: @Test
    public void sendTest() {
      int len = 1000;
      NettyClient nettyClient = new NettyClient(getNettyClientConfig(HEARTBEATINTERVAL * 30), TBaseCommand::new, () -> {
        return new LineBasedFrameDecoder(len);
      }, new THeartbeatCommand());
  
      for (int i = 0; i < 10; i++) {
        TBaseCommand request = new TBaseCommand((short) 1, (long) i, i + "---i am ct. hello server.\n");
        nettyClient.send(ADDRESS, request, new TCallback());
      }
      sleep(5000);
    }
test_case.class_method_signature: NettyClientTest.sendTest()
test_case.full_signature: @Test public void sendTest()
test_case.identifier: sendTest
test_case.invocations: getNettyClientConfig send sleep
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void sendTest()
focal_class.declarator: config
focal_class.modifier: private final
focal_class.original_string: private final NettyClientConfig config;
focal_class.type: NettyClientConfig
focal_class.var_name: config
focal_class.declarator: poolMap
focal_class.modifier: private final
focal_class.original_string: private final ConcurrentMap<String, ConnectPool> poolMap;
focal_class.type: ConcurrentMap<String, ConnectPool>
focal_class.var_name: poolMap
focal_class.declarator: evictPools
focal_class.modifier: private final
focal_class.original_string: private final List<ConnectPool> evictPools;
focal_class.type: List<ConnectPool>
focal_class.var_name: evictPools
focal_class.declarator: bootstrap
focal_class.modifier: private final
focal_class.original_string: private final Bootstrap bootstrap;
focal_class.type: Bootstrap
focal_class.var_name: bootstrap
focal_class.declarator: connectHandler
focal_class.modifier: private final
focal_class.original_string: private final ConnectHandler connectHandler;
focal_class.type: ConnectHandler
focal_class.var_name: connectHandler
focal_class.declarator: commandHandler
focal_class.modifier: private final
focal_class.original_string: private final CommandHandler commandHandler;
focal_class.type: CommandHandler
focal_class.var_name: commandHandler
focal_class.declarator: eventBus
focal_class.modifier: private final
focal_class.original_string: private final EventBus eventBus;
focal_class.type: EventBus
focal_class.var_name: eventBus
focal_class.declarator: idleExecutor
focal_class.modifier: private final
focal_class.original_string: private final ScheduledExecutorService idleExecutor;
focal_class.type: ScheduledExecutorService
focal_class.var_name: idleExecutor
focal_class.declarator: timeoutExecutor
focal_class.modifier: private final
focal_class.original_string: private final ScheduledExecutorService timeoutExecutor;
focal_class.type: ScheduledExecutorService
focal_class.var_name: timeoutExecutor
focal_class.declarator: eventExecutor
focal_class.modifier: private final
focal_class.original_string: private final ScheduledExecutorService eventExecutor;
focal_class.type: ScheduledExecutorService
focal_class.var_name: eventExecutor
focal_class.file: jimsql/jim-rpc/src/main/java/io/jimdb/rpc/client/NettyClient.java
focal_class.identifier: NettyClient
focal_class.interfaces: implements Closeable
focal_class.class_method_signature: NettyClient.NettyClient(final NettyClientConfig config, final Supplier<? extends Command> commandSupplier,
                       final Supplier<? extends ByteToMessageDecoder> decoderSupplier, final HeartbeatCommand heartbeat)
focal_class.full_signature: public  NettyClient(final NettyClientConfig config, final Supplier<? extends Command> commandSupplier,
                       final Supplier<? extends ByteToMessageDecoder> decoderSupplier, final HeartbeatCommand heartbeat)
focal_class.identifier: NettyClient
focal_class.modifiers: public
focal_class.parameters: (final NettyClientConfig config, final Supplier<? extends Command> commandSupplier,
                       final Supplier<? extends ByteToMessageDecoder> decoderSupplier, final HeartbeatCommand heartbeat)
focal_class.signature:  NettyClient(final NettyClientConfig config, final Supplier<? extends Command> commandSupplier,
                       final Supplier<? extends ByteToMessageDecoder> decoderSupplier, final HeartbeatCommand heartbeat)
focal_class.class_method_signature: NettyClient.addListener(final EventListener listener)
focal_class.full_signature: public boolean addListener(final EventListener listener)
focal_class.identifier: addListener
focal_class.modifiers: public
focal_class.parameters: (final EventListener listener)
focal_class.return: boolean
focal_class.signature: boolean addListener(final EventListener listener)
focal_class.class_method_signature: NettyClient.removeListener(final EventListener listener)
focal_class.full_signature: public boolean removeListener(final EventListener listener)
focal_class.identifier: removeListener
focal_class.modifiers: public
focal_class.parameters: (final EventListener listener)
focal_class.return: boolean
focal_class.signature: boolean removeListener(final EventListener listener)
focal_class.class_method_signature: NettyClient.publish(final Event e)
focal_class.full_signature: public void publish(final Event e)
focal_class.identifier: publish
focal_class.modifiers: public
focal_class.parameters: (final Event e)
focal_class.return: void
focal_class.signature: void publish(final Event e)
focal_class.class_method_signature: NettyClient.send(final String addr, final T command, final C callback)
focal_class.full_signature: public void send(final String addr, final T command, final C callback)
focal_class.identifier: send
focal_class.modifiers: public
focal_class.parameters: (final String addr, final T command, final C callback)
focal_class.return: void
focal_class.signature: void send(final String addr, final T command, final C callback)
focal_class.class_method_signature: NettyClient.getConn(String addr)
focal_class.full_signature: private Connection getConn(String addr)
focal_class.identifier: getConn
focal_class.modifiers: private
focal_class.parameters: (String addr)
focal_class.return: Connection
focal_class.signature: Connection getConn(String addr)
focal_class.class_method_signature: NettyClient.buildBootstrap()
focal_class.full_signature: private Bootstrap buildBootstrap()
focal_class.identifier: buildBootstrap
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: Bootstrap
focal_class.signature: Bootstrap buildBootstrap()
focal_class.class_method_signature: NettyClient.close()
focal_class.full_signature: @Override public void close()
focal_class.identifier: close
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void close()
focal_method.body: public <T extends Command, C extends CommandCallback<T>> void send(final String addr, final T command, final C callback) {
      try {
        getConn(addr).request(command, callback);
      } catch (Exception ex) {
        if (callback != null) {
          callback.onFailed(command, ex);
        } else {
          throw ex;
        }
      }
    }
focal_method.class_method_signature: NettyClient.send(final String addr, final T command, final C callback)
focal_method.full_signature: public void send(final String addr, final T command, final C callback)
focal_method.identifier: send
focal_method.invocations: request getConn onFailed
focal_method.modifiers: public
focal_method.parameters: (final String addr, final T command, final C callback)
focal_method.return: void
focal_method.signature: void send(final String addr, final T command, final C callback)