Package com.hazelcast.jet.core.test
Class TestProcessorMetaSupplierContext
java.lang.Object
com.hazelcast.jet.core.test.TestProcessorMetaSupplierContext
- All Implemented Interfaces:
ProcessorMetaSupplier.Context
- Direct Known Subclasses:
TestProcessorSupplierContext
public class TestProcessorMetaSupplierContext
extends Object
implements ProcessorMetaSupplier.Context
ProcessorMetaSupplier.Context
implementation suitable to be used
in tests.- Since:
- Jet 3.0
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
checkPermission
(Permission permission) Check if the current Subject has the given permission granted (or implied).Processor classloader configured viaJobConfig.addCustomClasspath(String, String)
A service to accessDataConnection
s in processors.long
Returns the job execution ID.com.hazelcast.spi.impl.NodeEngineImpl
Returns the current Hazelcast instance.boolean
Returns if this job runs as a light job, seeJetService.newLightJob(Pipeline)
.Deprecated.Returns theJobConfig
.long
jobId()
Returns the job ID.int
Returns the number of processors that eachProcessorSupplier
will be asked to create once deserialized on each member.logger()
Returns a logger for the associatedProcessorMetaSupplier
.protected String
long
Returns the maximum number of records that can be accumulated by any singleProcessor
.int
Returns the number of members running this job.Returns the partition assignment used by this job.Returns the guarantee for current job.setClassLoader
(ClassLoader classLoader) setExecutionId
(long executionId) Sets the execution ID.setHazelcastInstance
(HazelcastInstance instance) Sets the Hazelcast instance.setIsLightJob
(boolean isLightJob) Sets the isLightJob flag.setJobConfig
(JobConfig jobConfig) Sets the config for the job.setJobId
(long jobId) Sets the job ID.setLocalParallelism
(int localParallelism) Sets local parallelism.Sets the logger.void
setMaxProcessorAccumulatedRecords
(long maxProcessorAccumulatedRecords) setPartitionAssignment
(Map<Address, int[]> partitionAssignment) Sets the partition assignment.setProcessingGuarantee
(ProcessingGuarantee processingGuarantee) Sets the processing guarantee.setTotalParallelism
(int totalParallelism) Sets the total parallelism.setVertexName
(String vertexName) Sets the vertex name.int
Returns the total number ofProcessor
s that will be created across the cluster.Returns the name of the associated vertex.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.hazelcast.jet.core.ProcessorMetaSupplier.Context
snapshottingEnabled
-
Field Details
-
logger
-
-
Constructor Details
-
TestProcessorMetaSupplierContext
public TestProcessorMetaSupplierContext()
-
-
Method Details
-
hazelcastInstance
Description copied from interface:ProcessorMetaSupplier.Context
Returns the current Hazelcast instance.- Specified by:
hazelcastInstance
in interfaceProcessorMetaSupplier.Context
-
jetInstance
Deprecated.Description copied from interface:ProcessorMetaSupplier.Context
Returns the current Jet instance.- Specified by:
jetInstance
in interfaceProcessorMetaSupplier.Context
-
setHazelcastInstance
@Nonnull public TestProcessorMetaSupplierContext setHazelcastInstance(@Nonnull HazelcastInstance instance) Sets the Hazelcast instance. -
jobId
public long jobId()Description copied from interface:ProcessorMetaSupplier.Context
Returns the job ID. Job id is unique for job submission and doesn't change when the job restarts. It's also unique for all running and archived jobs.- Specified by:
jobId
in interfaceProcessorMetaSupplier.Context
-
setJobId
Sets the job ID. -
executionId
public long executionId()Description copied from interface:ProcessorMetaSupplier.Context
Returns the job execution ID. It's unique for one execution, but changes when the job restarts.- Specified by:
executionId
in interfaceProcessorMetaSupplier.Context
-
setExecutionId
Sets the execution ID. -
jobConfig
Description copied from interface:ProcessorMetaSupplier.Context
Returns theJobConfig
.- Specified by:
jobConfig
in interfaceProcessorMetaSupplier.Context
-
setJobConfig
Sets the config for the job. -
totalParallelism
public int totalParallelism()Description copied from interface:ProcessorMetaSupplier.Context
Returns the total number ofProcessor
s that will be created across the cluster. This number remains stable for entire job execution. It is equal toProcessorMetaSupplier.Context.memberCount()
*ProcessorMetaSupplier.Context.localParallelism()
.- Specified by:
totalParallelism
in interfaceProcessorMetaSupplier.Context
-
setTotalParallelism
Sets the total parallelism. -
localParallelism
public int localParallelism()Description copied from interface:ProcessorMetaSupplier.Context
Returns the number of processors that eachProcessorSupplier
will be asked to create once deserialized on each member. All members have equal local parallelism. The count doesn't change unless the job restarts.- Specified by:
localParallelism
in interfaceProcessorMetaSupplier.Context
-
setLocalParallelism
Sets local parallelism. -
logger
Description copied from interface:ProcessorMetaSupplier.Context
Returns a logger for the associatedProcessorMetaSupplier
.- Specified by:
logger
in interfaceProcessorMetaSupplier.Context
-
setLogger
Sets the logger. -
memberCount
public int memberCount()Description copied from interface:ProcessorMetaSupplier.Context
Returns the number of members running this job.Note that the value might be lower than current member count if members were added after the job started. The count doesn't change unless the job restarts.
- Specified by:
memberCount
in interfaceProcessorMetaSupplier.Context
-
vertexName
Description copied from interface:ProcessorMetaSupplier.Context
Returns the name of the associated vertex.- Specified by:
vertexName
in interfaceProcessorMetaSupplier.Context
-
setVertexName
Sets the vertex name. -
loggerName
-
processingGuarantee
Description copied from interface:ProcessorMetaSupplier.Context
Returns the guarantee for current job.- Specified by:
processingGuarantee
in interfaceProcessorMetaSupplier.Context
-
setProcessingGuarantee
@Nonnull public TestProcessorMetaSupplierContext setProcessingGuarantee(@Nonnull ProcessingGuarantee processingGuarantee) Sets the processing guarantee. -
maxProcessorAccumulatedRecords
public long maxProcessorAccumulatedRecords()Description copied from interface:ProcessorMetaSupplier.Context
Returns the maximum number of records that can be accumulated by any singleProcessor
. The returned value is strictly positive (>=1).- Specified by:
maxProcessorAccumulatedRecords
in interfaceProcessorMetaSupplier.Context
-
setMaxProcessorAccumulatedRecords
public void setMaxProcessorAccumulatedRecords(long maxProcessorAccumulatedRecords) -
isLightJob
public boolean isLightJob()Description copied from interface:ProcessorMetaSupplier.Context
Returns if this job runs as a light job, seeJetService.newLightJob(Pipeline)
.- Specified by:
isLightJob
in interfaceProcessorMetaSupplier.Context
-
setIsLightJob
Sets the isLightJob flag. -
partitionAssignment
Description copied from interface:ProcessorMetaSupplier.Context
Returns the partition assignment used by this job. This is the assignment partitioned edges will use and the assignment processors dealing with Hazelcast data structures should use. Each mapped partitions id array must be sorted.- Specified by:
partitionAssignment
in interfaceProcessorMetaSupplier.Context
-
setPartitionAssignment
@Nonnull public TestProcessorMetaSupplierContext setPartitionAssignment(Map<Address, int[]> partitionAssignment) Sets the partition assignment. -
classLoader
Description copied from interface:ProcessorMetaSupplier.Context
Processor classloader configured viaJobConfig.addCustomClasspath(String, String)
- Specified by:
classLoader
in interfaceProcessorMetaSupplier.Context
- Returns:
- processor classloader, null if no custom classpath elements are configured
-
dataConnectionService
Description copied from interface:ProcessorMetaSupplier.Context
A service to accessDataConnection
s in processors.- Specified by:
dataConnectionService
in interfaceProcessorMetaSupplier.Context
-
getNodeEngine
public com.hazelcast.spi.impl.NodeEngineImpl getNodeEngine() -
setClassLoader
-
checkPermission
Description copied from interface:ProcessorMetaSupplier.Context
Check if the current Subject has the given permission granted (or implied).- Specified by:
checkPermission
in interfaceProcessorMetaSupplier.Context
- Parameters:
permission
- Permission to be checked- Throws:
AccessControlException
- when the security is enabled and the checked permission is not implied for the currentSubject
-