com.hazelcast.spi.impl
Class BasicOperationScheduler

java.lang.Object
  extended by com.hazelcast.spi.impl.BasicOperationScheduler

public final class BasicOperationScheduler
extends Object

The BasicOperationProcessor belongs to the BasicOperationService and is responsible for scheduling operations/packets to the correct threads.

The actual processing of the 'task' that is scheduled, is forwarded to the BasicDispatcher. So this class is purely responsible for assigning a 'task' to a particular thread.

The execute(Object, int, boolean) accepts an Object instead of a runnable to prevent needing to create wrapper runnables around tasks. This is done to reduce the amount of object litter and therefor reduce pressure on the gc.

There are 2 category of operation threads:

  1. partition specific operation threads: these threads are responsible for executing e.g. a map.put. Operations for the same partition, always end up in the same thread.
  2. generic operation threads: these threads are responsible for executing operations that are not specific to a partition. E.g. a heart beat.


Field Summary
static int TERMINATION_TIMEOUT_SECONDS
           
 
Constructor Summary
BasicOperationScheduler(Node node, ExecutionService executionService, BasicDispatcher dispatcher)
           
 
Method Summary
 void dumpPerformanceMetrics(StringBuffer sb)
           
 void execute(Operation op)
           
 void execute(Packet packet)
           
 void execute(Runnable task, int partitionId)
           
 int getOperationExecutorQueueSize()
           
 int getPriorityOperationExecutorQueueSize()
           
 int getResponseQueueSize()
           
 void shutdown()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TERMINATION_TIMEOUT_SECONDS

public static final int TERMINATION_TIMEOUT_SECONDS
See Also:
Constant Field Values
Constructor Detail

BasicOperationScheduler

public BasicOperationScheduler(Node node,
                               ExecutionService executionService,
                               BasicDispatcher dispatcher)
Method Detail

getOperationExecutorQueueSize

public int getOperationExecutorQueueSize()

getPriorityOperationExecutorQueueSize

public int getPriorityOperationExecutorQueueSize()

getResponseQueueSize

public int getResponseQueueSize()

execute

public void execute(Operation op)

execute

public void execute(Runnable task,
                    int partitionId)

execute

public void execute(Packet packet)

shutdown

public void shutdown()

toString

public String toString()
Overrides:
toString in class Object

dumpPerformanceMetrics

public void dumpPerformanceMetrics(StringBuffer sb)


Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.