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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckPermission(Permission permission) Check if the current Subject has the given permission granted (or implied).Processor classloader configured viaJobConfig.addCustomClasspath(String, String)A service to accessDataConnections in processors.longReturns the job execution ID.com.hazelcast.spi.impl.NodeEngineImplReturns the current Hazelcast instance.booleanReturns if this job runs as a light job, seeJetService.newLightJob(Pipeline).Deprecated.Returns theJobConfig.longjobId()Returns the job ID.intReturns the number of processors that eachProcessorSupplierwill be asked to create once deserialized on each member.logger()Returns a logger for the associatedProcessorMetaSupplier.protected StringlongReturns the maximum number of records that can be accumulated by any singleProcessor.intReturns 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.voidsetMaxProcessorAccumulatedRecords(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.intReturns the total number ofProcessors 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, waitMethods 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.ContextReturns the current Hazelcast instance.- Specified by:
hazelcastInstancein interfaceProcessorMetaSupplier.Context
-
jetInstance
Deprecated.Description copied from interface:ProcessorMetaSupplier.ContextReturns the current Jet instance.- Specified by:
jetInstancein interfaceProcessorMetaSupplier.Context
-
setHazelcastInstance
@Nonnull public TestProcessorMetaSupplierContext setHazelcastInstance(@Nonnull HazelcastInstance instance) Sets the Hazelcast instance. -
jobId
public long jobId()Description copied from interface:ProcessorMetaSupplier.ContextReturns 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:
jobIdin interfaceProcessorMetaSupplier.Context
-
setJobId
Sets the job ID. -
executionId
public long executionId()Description copied from interface:ProcessorMetaSupplier.ContextReturns the job execution ID. It's unique for one execution, but changes when the job restarts.- Specified by:
executionIdin interfaceProcessorMetaSupplier.Context
-
setExecutionId
Sets the execution ID. -
jobConfig
Description copied from interface:ProcessorMetaSupplier.ContextReturns theJobConfig.- Specified by:
jobConfigin interfaceProcessorMetaSupplier.Context
-
setJobConfig
Sets the config for the job. -
totalParallelism
public int totalParallelism()Description copied from interface:ProcessorMetaSupplier.ContextReturns the total number ofProcessors 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:
totalParallelismin interfaceProcessorMetaSupplier.Context
-
setTotalParallelism
Sets the total parallelism. -
localParallelism
public int localParallelism()Description copied from interface:ProcessorMetaSupplier.ContextReturns the number of processors that eachProcessorSupplierwill 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:
localParallelismin interfaceProcessorMetaSupplier.Context
-
setLocalParallelism
Sets local parallelism. -
logger
Description copied from interface:ProcessorMetaSupplier.ContextReturns a logger for the associatedProcessorMetaSupplier.- Specified by:
loggerin interfaceProcessorMetaSupplier.Context
-
setLogger
Sets the logger. -
memberCount
public int memberCount()Description copied from interface:ProcessorMetaSupplier.ContextReturns 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:
memberCountin interfaceProcessorMetaSupplier.Context
-
vertexName
Description copied from interface:ProcessorMetaSupplier.ContextReturns the name of the associated vertex.- Specified by:
vertexNamein interfaceProcessorMetaSupplier.Context
-
setVertexName
Sets the vertex name. -
loggerName
-
processingGuarantee
Description copied from interface:ProcessorMetaSupplier.ContextReturns the guarantee for current job.- Specified by:
processingGuaranteein interfaceProcessorMetaSupplier.Context
-
setProcessingGuarantee
@Nonnull public TestProcessorMetaSupplierContext setProcessingGuarantee(@Nonnull ProcessingGuarantee processingGuarantee) Sets the processing guarantee. -
maxProcessorAccumulatedRecords
public long maxProcessorAccumulatedRecords()Description copied from interface:ProcessorMetaSupplier.ContextReturns the maximum number of records that can be accumulated by any singleProcessor. The returned value is strictly positive (>=1).- Specified by:
maxProcessorAccumulatedRecordsin interfaceProcessorMetaSupplier.Context
-
setMaxProcessorAccumulatedRecords
public void setMaxProcessorAccumulatedRecords(long maxProcessorAccumulatedRecords) -
isLightJob
public boolean isLightJob()Description copied from interface:ProcessorMetaSupplier.ContextReturns if this job runs as a light job, seeJetService.newLightJob(Pipeline).- Specified by:
isLightJobin interfaceProcessorMetaSupplier.Context
-
setIsLightJob
Sets the isLightJob flag. -
partitionAssignment
Description copied from interface:ProcessorMetaSupplier.ContextReturns 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:
partitionAssignmentin interfaceProcessorMetaSupplier.Context
-
setPartitionAssignment
@Nonnull public TestProcessorMetaSupplierContext setPartitionAssignment(Map<Address, int[]> partitionAssignment) Sets the partition assignment. -
classLoader
Description copied from interface:ProcessorMetaSupplier.ContextProcessor classloader configured viaJobConfig.addCustomClasspath(String, String)- Specified by:
classLoaderin interfaceProcessorMetaSupplier.Context- Returns:
- processor classloader, null if no custom classpath elements are configured
-
dataConnectionService
Description copied from interface:ProcessorMetaSupplier.ContextA service to accessDataConnections in processors.- Specified by:
dataConnectionServicein interfaceProcessorMetaSupplier.Context
-
getNodeEngine
public com.hazelcast.spi.impl.NodeEngineImpl getNodeEngine() -
setClassLoader
-
checkPermission
Description copied from interface:ProcessorMetaSupplier.ContextCheck if the current Subject has the given permission granted (or implied).- Specified by:
checkPermissionin 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
-