Package org.jppf.node.protocol
Class JPPFTaskBundle
java.lang.Object
org.jppf.utils.collections.MetadataImpl
org.jppf.node.protocol.JPPFTaskBundle
- All Implemented Interfaces:
Serializable,Comparable<JPPFTaskBundle>,JPPFDistributedJob,TaskBundle,Metadata
Instances of this class group tasks from the same client together, so they are sent to the same node,
avoiding unnecessary transport overhead.
The goal is to provide a performance enhancement through an adaptive bundling of tasks originating from the same client. The bundle size is computed dynamically, depending on the number of nodes connected to the server, and other factors.
The goal is to provide a performance enhancement through an adaptive bundling of tasks originating from the same client. The bundle size is computed dynamically, depending on the number of nodes connected to the server, and other factors.
- Author:
- Laurent Cohen
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intThe current number of tasks in this bundle.protected intThe number of tasks in this bundle at the time it is received by a driver.protected intThe initial number of tasks in this bundle.protected intThe number of tasks in this bundle.Fields inherited from class org.jppf.utils.collections.MetadataImpl
parameters -
Constructor Summary
ConstructorsConstructorDescriptionInitialize this task bundle and set its build number.JPPFTaskBundle(TraversalList<String> uuidPath) Initialize this task bundle with the specified uuid path. -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(JPPFTaskBundle bundle) Compare two task bundles, based on their respective priorities.
Note: this class has a natural ordering that is inconsistent with equals.copy()Make a copy of this bundle.intGet the current number of tasks in this bundle.intGet the number of tasks in this bundle at the time it is received by a driver.longGet the time at which the bundle is taken out of the queue for sending to a node.intGet the initial task count of this bundle.Get the user-defined metadata associated with this job.getName()Get the user-defined display name for this job.longGet the time it took a node to execute this task.getSLA()Get the service level agreement between the job and the server.intGet the number of tasks in the job.getUuid()Get the universal unique id for this job.Get the uuid path of the applications (driver or client) in whose classpath the class definition may be found.booleanDetermine whether this object is used for handshake instead of execution.booleanGet the job requeue flag.booleanGet the job requeue flag.voidsetCurrentTaskCount(int currentTaskCount) Set the current number of tasks in this bundle.voidsetDriverQueueTaskCount(int driverQueueTaskCount) Set the number of tasks in this bundle at the time it is received by a driver.voidsetExecutionStartTime(long executionStartTime) Set the time at which the bundle is taken out of the queue for sending to a node.voidsetHandshake(boolean handshake) Specify whether this object is used for handshake instead of execution.voidsetInitialTaskCount(int initialTaskCount) Set the initial number of tasks in this bundle.voidsetMetadata(JobMetadata jobMetadata) Set this bundle's metadata.voidSet the user-defined display name for the job.voidsetNodeExecutionTime(long nodeExecutionTime) Set the time it took a node to execute this task.voidsetRequeue(boolean requeue) Set the job requeue flag.voidGet the service level agreement between the job and the server.voidsetTaskCount(int taskCount) Set the number of tasks in this bundle.voidSet the uuid of the initial job.voidsetUuidPath(TraversalList<String> uuidPath) Set the uuid path of the applications (driver or client) in whose classpath the class definition may be found.toString()Methods inherited from class org.jppf.utils.collections.MetadataImpl
clear, getAll, getParameter, getParameter, hasParameter, removeParameter, setParameterMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jppf.utils.collections.Metadata
clear, getAll, getParameter, getParameter, hasParameter, removeParameter, setParameterMethods inherited from interface org.jppf.node.protocol.TaskBundle
getBundleId, isNotification, setBundleId
-
Field Details
-
driverQueueTaskCount
protected int driverQueueTaskCountThe number of tasks in this bundle at the time it is received by a driver. -
taskCount
protected int taskCountThe number of tasks in this bundle. -
currentTaskCount
protected int currentTaskCountThe current number of tasks in this bundle. -
initialTaskCount
protected int initialTaskCountThe initial number of tasks in this bundle.
-
-
Constructor Details
-
JPPFTaskBundle
public JPPFTaskBundle()Initialize this task bundle and set its build number. -
JPPFTaskBundle
Initialize this task bundle with the specified uuid path.- Parameters:
uuidPath- the uuidPath to set.
-
-
Method Details
-
getUuidPath
Description copied from interface:TaskBundleGet the uuid path of the applications (driver or client) in whose classpath the class definition may be found.- Specified by:
getUuidPathin interfaceTaskBundle- Returns:
- the uuid path as a list of string elements.
-
setUuidPath
Description copied from interface:TaskBundleSet the uuid path of the applications (driver or client) in whose classpath the class definition may be found.- Specified by:
setUuidPathin interfaceTaskBundle- Parameters:
uuidPath- the uuid path as a list of string elements.
-
getNodeExecutionTime
public long getNodeExecutionTime()Description copied from interface:TaskBundleGet the time it took a node to execute this task.- Specified by:
getNodeExecutionTimein interfaceTaskBundle- Returns:
- the time in milliseconds as a long value.
-
setNodeExecutionTime
public void setNodeExecutionTime(long nodeExecutionTime) Description copied from interface:TaskBundleSet the time it took a node to execute this task.- Specified by:
setNodeExecutionTimein interfaceTaskBundle- Parameters:
nodeExecutionTime- the time in milliseconds as a long value.
-
getTaskCount
public int getTaskCount()Description copied from interface:JPPFDistributedJobGet the number of tasks in the job.- Specified by:
getTaskCountin interfaceJPPFDistributedJob- Returns:
- the number fo tasks.
-
setTaskCount
public void setTaskCount(int taskCount) Description copied from interface:TaskBundleSet the number of tasks in this bundle.- Specified by:
setTaskCountin interfaceTaskBundle- Parameters:
taskCount- the number of tasks as an int.
-
setInitialTaskCount
public void setInitialTaskCount(int initialTaskCount) Description copied from interface:TaskBundleSet the initial number of tasks in this bundle.- Specified by:
setInitialTaskCountin interfaceTaskBundle- Parameters:
initialTaskCount- the number of tasks as an int.
-
compareTo
Compare two task bundles, based on their respective priorities.
Note: this class has a natural ordering that is inconsistent with equals.- Specified by:
compareToin interfaceComparable<JPPFTaskBundle>- Parameters:
bundle- the bundle compare this one to.- Returns:
- a positive int if this bundle is greater, 0 if both are equal, or a negative int if this bundle is less than the other.
-
copy
Description copied from interface:TaskBundleMake a copy of this bundle.- Specified by:
copyin interfaceTaskBundle- Returns:
- a new
JPPFTaskBundleinstance.
-
getExecutionStartTime
public long getExecutionStartTime()Description copied from interface:TaskBundleGet the time at which the bundle is taken out of the queue for sending to a node.- Specified by:
getExecutionStartTimein interfaceTaskBundle- Returns:
- the time as a long value.
-
setExecutionStartTime
public void setExecutionStartTime(long executionStartTime) Description copied from interface:TaskBundleSet the time at which the bundle is taken out of the queue for sending to a node.- Specified by:
setExecutionStartTimein interfaceTaskBundle- Parameters:
executionStartTime- the time as a long value.
-
getInitialTaskCount
public int getInitialTaskCount()Description copied from interface:TaskBundleGet the initial task count of this bundle.- Specified by:
getInitialTaskCountin interfaceTaskBundle- Returns:
- the task count as an int.
-
getSLA
Description copied from interface:JPPFDistributedJobGet the service level agreement between the job and the server.- Specified by:
getSLAin interfaceJPPFDistributedJob- Returns:
- an instance of
JobSLA.
-
setSLA
Description copied from interface:TaskBundleGet the service level agreement between the job and the server.- Specified by:
setSLAin interfaceTaskBundle- Parameters:
jobSLA- an instance ofJobSLA.
-
toString
- Overrides:
toStringin classMetadataImpl
-
getName
Description copied from interface:JPPFDistributedJobGet the user-defined display name for this job. This is the name displayed in the administration console.- Specified by:
getNamein interfaceJPPFDistributedJob- Returns:
- the name as a string.
-
setName
Description copied from interface:TaskBundleSet the user-defined display name for the job.- Specified by:
setNamein interfaceTaskBundle- Parameters:
name- the display name as a string.
-
getMetadata
Description copied from interface:JPPFDistributedJobGet the user-defined metadata associated with this job.- Specified by:
getMetadatain interfaceJPPFDistributedJob- Returns:
- a
JobMetadatainstance.
-
setMetadata
Description copied from interface:TaskBundleSet this bundle's metadata.- Specified by:
setMetadatain interfaceTaskBundle- Parameters:
jobMetadata- aJobMetadatainstance.
-
getUuid
Description copied from interface:JPPFDistributedJobGet the universal unique id for this job.- Specified by:
getUuidin interfaceJPPFDistributedJob- Returns:
- the uuid as a string.
-
setUuid
Description copied from interface:TaskBundleSet the uuid of the initial job.- Specified by:
setUuidin interfaceTaskBundle- Parameters:
jobUuid- the uuid as a string.
-
getCurrentTaskCount
public int getCurrentTaskCount()Description copied from interface:TaskBundleGet the current number of tasks in this bundle.- Specified by:
getCurrentTaskCountin interfaceTaskBundle- Returns:
- the current number of tasks as an int.
-
setCurrentTaskCount
public void setCurrentTaskCount(int currentTaskCount) Description copied from interface:TaskBundleSet the current number of tasks in this bundle.- Specified by:
setCurrentTaskCountin interfaceTaskBundle- Parameters:
currentTaskCount- the current number of tasks as an int.
-
isPending
public boolean isPending()Description copied from interface:TaskBundleGet the job requeue flag.- Specified by:
isPendingin interfaceTaskBundle- Returns:
- job requeue flag.
-
isRequeue
public boolean isRequeue()Description copied from interface:TaskBundleGet the job requeue flag.- Specified by:
isRequeuein interfaceTaskBundle- Returns:
- job requeue flag.
-
setRequeue
public void setRequeue(boolean requeue) Description copied from interface:TaskBundleSet the job requeue flag.- Specified by:
setRequeuein interfaceTaskBundle- Parameters:
requeue- job requeue flag.
-
getDriverQueueTaskCount
public int getDriverQueueTaskCount()Description copied from interface:TaskBundleGet the number of tasks in this bundle at the time it is received by a driver.- Specified by:
getDriverQueueTaskCountin interfaceTaskBundle- Returns:
- the number of tasks as an int.
-
setDriverQueueTaskCount
public void setDriverQueueTaskCount(int driverQueueTaskCount) Description copied from interface:TaskBundleSet the number of tasks in this bundle at the time it is received by a driver.- Specified by:
setDriverQueueTaskCountin interfaceTaskBundle- Parameters:
driverQueueTaskCount- the number of tasks as an int.
-
isHandshake
public boolean isHandshake()Description copied from interface:TaskBundleDetermine whether this object is used for handshake instead of execution.- Specified by:
isHandshakein interfaceTaskBundle- Returns:
trueif this bundle is a handshake bundle,falseotherwise.
-
setHandshake
public void setHandshake(boolean handshake) Description copied from interface:TaskBundleSpecify whether this object is used for handshake instead of execution.- Specified by:
setHandshakein interfaceTaskBundle- Parameters:
handshake-trueif this bundle is a handshake bundle,falseotherwise.
-