Class NioEventLoop

java.lang.Object
com.aerospike.client.async.EventLoopBase
com.aerospike.client.async.NioEventLoop
All Implemented Interfaces:
EventLoop, Runnable

public final class NioEventLoop extends EventLoopBase implements Runnable
Aerospike wrapper around NIO Selector. Implements the Aerospike EventLoop interface.
  • Constructor Details

  • Method Details

    • execute

      public void execute(com.aerospike.client.cluster.Cluster cluster, com.aerospike.client.async.AsyncCommand command)
      Execute async command. Execute immediately if in event loop. Otherwise, place command on event loop queue.
      Specified by:
      execute in interface EventLoop
    • execute

      public void execute(Runnable command)
      Schedule execution of runnable command on event loop. Command is placed on event loop queue and is never executed directly.
      Specified by:
      execute in interface EventLoop
    • executeBatchRetry

      public void executeBatchRetry(Runnable other, com.aerospike.client.async.AsyncCommand command, long deadline)
      Execute async batch retry.
      Specified by:
      executeBatchRetry in interface EventLoop
    • schedule

      public void schedule(Runnable command, long delay, TimeUnit unit)
      Schedule execution of runnable command with delay in milliseconds.
      Specified by:
      schedule in interface EventLoop
    • schedule

      public void schedule(com.aerospike.client.async.ScheduleTask task, long delay, TimeUnit unit)
      Schedule execution with a reusable ScheduleTask. Saves memory allocation for repeatedly scheduled task.
      Specified by:
      schedule in interface EventLoop
    • createConnector

      public com.aerospike.client.async.AsyncConnector createConnector(com.aerospike.client.cluster.Cluster cluster, Node node, com.aerospike.client.async.AsyncConnector.Listener listener)
      Create async connector command.
      Specified by:
      createConnector in interface EventLoop
    • inEventLoop

      public boolean inEventLoop()
      Is current thread the event loop thread.
      Specified by:
      inEventLoop in interface EventLoop
    • createByteBuffer

      public static ByteBuffer createByteBuffer(int size)
    • getByteBuffer

      public ByteBuffer getByteBuffer()
    • putByteBuffer

      public void putByteBuffer(ByteBuffer byteBuffer)
    • run

      public void run()
      Specified by:
      run in interface Runnable
    • close

      public void close()