Package com.aerospike.client.async
Class NioEventLoop
java.lang.Object
com.aerospike.client.async.EventLoopBase
com.aerospike.client.async.NioEventLoop
Aerospike wrapper around NIO Selector.
Implements the Aerospike EventLoop interface.
-
Constructor Summary
ConstructorsConstructorDescriptionNioEventLoop(EventPolicy policy, SelectorProvider provider, int index, boolean daemon, String poolName) Construct Aerospike event loop wrapper from NIO Selector. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()static ByteBuffercreateByteBuffer(int size) com.aerospike.client.async.AsyncConnectorcreateConnector(com.aerospike.client.cluster.Cluster cluster, Node node, com.aerospike.client.async.AsyncConnector.Listener listener) Create async connector command.voidexecute(com.aerospike.client.cluster.Cluster cluster, com.aerospike.client.async.AsyncCommand command) Execute async command.voidSchedule execution of runnable command on event loop.voidexecuteBatchRetry(Runnable other, com.aerospike.client.async.AsyncCommand command, long deadline) Execute async batch retry.booleanIs current thread the event loop thread.voidputByteBuffer(ByteBuffer byteBuffer) voidrun()voidSchedule execution with a reusable ScheduleTask.voidSchedule execution of runnable command with delay in milliseconds.Methods inherited from class com.aerospike.client.async.EventLoopBase
createState, getIndex, getProcessSize, getQueueSize
-
Constructor Details
-
NioEventLoop
public NioEventLoop(EventPolicy policy, SelectorProvider provider, int index, boolean daemon, String poolName) throws IOException Construct Aerospike event loop wrapper from NIO Selector.- Throws:
IOException
-
-
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. -
execute
Schedule execution of runnable command on event loop. Command is placed on event loop queue and is never executed directly. -
executeBatchRetry
public void executeBatchRetry(Runnable other, com.aerospike.client.async.AsyncCommand command, long deadline) Execute async batch retry.- Specified by:
executeBatchRetryin interfaceEventLoop
-
schedule
Schedule execution of runnable command with delay in milliseconds. -
schedule
Schedule execution with a reusable ScheduleTask. Saves memory allocation for repeatedly scheduled task. -
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:
createConnectorin interfaceEventLoop
-
inEventLoop
public boolean inEventLoop()Is current thread the event loop thread.- Specified by:
inEventLoopin interfaceEventLoop
-
createByteBuffer
-
getByteBuffer
-
putByteBuffer
-
run
public void run() -
close
public void close()
-