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 java.lang.Object implements ProcessorMetaSupplier.Context
ProcessorMetaSupplier.Context
implementation suitable to be used in tests.- Since:
- Jet 3.0
-
-
Constructor Summary
Constructors Constructor Description TestProcessorMetaSupplierContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
checkPermission(java.security.Permission permission)
Check if the current Subject has the given permission granted (or implied).java.lang.ClassLoader
classLoader()
Processor classloader configured viaJobConfig.addCustomClasspath(String, String)
DataConnectionService
dataConnectionService()
A service to accessDataConnection
s in processors.long
executionId()
Returns the job execution ID.com.hazelcast.spi.impl.NodeEngineImpl
getNodeEngine()
HazelcastInstance
hazelcastInstance()
Returns the current Hazelcast instance.boolean
isLightJob()
Returns if this job runs as a light job, seeJetService.newLightJob(Pipeline)
.JetInstance
jetInstance()
Deprecated.JobConfig
jobConfig()
Returns theJobConfig
.long
jobId()
Returns the job ID.int
localParallelism()
Returns the number of processors that eachProcessorSupplier
will be asked to create once deserialized on each member.ILogger
logger()
Returns a logger for the associatedProcessorMetaSupplier
.protected java.lang.String
loggerName()
long
maxProcessorAccumulatedRecords()
Returns the maximum number of records that can be accumulated by any singleProcessor
.int
memberCount()
Returns the number of members running this job.java.util.Map<Address,int[]>
partitionAssignment()
Returns the partition assignment used by this job.ProcessingGuarantee
processingGuarantee()
Returns the guarantee for current job.TestProcessorMetaSupplierContext
setClassLoader(java.lang.ClassLoader classLoader)
TestProcessorMetaSupplierContext
setExecutionId(long executionId)
Sets the execution ID.TestProcessorMetaSupplierContext
setHazelcastInstance(HazelcastInstance instance)
Sets the Hazelcast instance.TestProcessorMetaSupplierContext
setIsLightJob(boolean isLightJob)
Sets the isLightJob flag.TestProcessorMetaSupplierContext
setJobConfig(JobConfig jobConfig)
Sets the config for the job.TestProcessorMetaSupplierContext
setJobId(long jobId)
Sets the job ID.TestProcessorMetaSupplierContext
setLocalParallelism(int localParallelism)
Sets local parallelism.TestProcessorMetaSupplierContext
setLogger(ILogger logger)
Sets the logger.void
setMaxProcessorAccumulatedRecords(long maxProcessorAccumulatedRecords)
TestProcessorMetaSupplierContext
setPartitionAssignment(java.util.Map<Address,int[]> partitionAssignment)
Sets the partition assignment.TestProcessorMetaSupplierContext
setProcessingGuarantee(ProcessingGuarantee processingGuarantee)
Sets the processing guarantee.TestProcessorMetaSupplierContext
setTotalParallelism(int totalParallelism)
Sets the total parallelism.TestProcessorMetaSupplierContext
setVertexName(java.lang.String vertexName)
Sets the vertex name.int
totalParallelism()
Returns the total number ofProcessor
s that will be created across the cluster.java.lang.String
vertexName()
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 Detail
-
logger
protected ILogger logger
-
-
Method Detail
-
hazelcastInstance
@Nonnull public HazelcastInstance hazelcastInstance()
Description copied from interface:ProcessorMetaSupplier.Context
Returns the current Hazelcast instance.- Specified by:
hazelcastInstance
in interfaceProcessorMetaSupplier.Context
-
jetInstance
@Nonnull @Deprecated public JetInstance 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
public TestProcessorMetaSupplierContext setJobId(long jobId)
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
public TestProcessorMetaSupplierContext setExecutionId(long executionId)
Sets the execution ID.
-
jobConfig
@Nonnull public JobConfig jobConfig()
Description copied from interface:ProcessorMetaSupplier.Context
Returns theJobConfig
.- Specified by:
jobConfig
in interfaceProcessorMetaSupplier.Context
-
setJobConfig
public TestProcessorMetaSupplierContext setJobConfig(@Nonnull JobConfig jobConfig)
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
@Nonnull public TestProcessorMetaSupplierContext setTotalParallelism(int totalParallelism)
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
@Nonnull public TestProcessorMetaSupplierContext setLocalParallelism(int localParallelism)
Sets local parallelism.
-
logger
@Nonnull public ILogger logger()
Description copied from interface:ProcessorMetaSupplier.Context
Returns a logger for the associatedProcessorMetaSupplier
.- Specified by:
logger
in interfaceProcessorMetaSupplier.Context
-
setLogger
public TestProcessorMetaSupplierContext setLogger(@Nonnull ILogger logger)
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
@Nonnull public java.lang.String vertexName()
Description copied from interface:ProcessorMetaSupplier.Context
Returns the name of the associated vertex.- Specified by:
vertexName
in interfaceProcessorMetaSupplier.Context
-
setVertexName
@Nonnull public TestProcessorMetaSupplierContext setVertexName(@Nonnull java.lang.String vertexName)
Sets the vertex name.
-
loggerName
protected java.lang.String loggerName()
-
processingGuarantee
public ProcessingGuarantee 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
@Nonnull public TestProcessorMetaSupplierContext setIsLightJob(boolean isLightJob)
Sets the isLightJob flag.
-
partitionAssignment
public java.util.Map<Address,int[]> 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(java.util.Map<Address,int[]> partitionAssignment)
Sets the partition assignment.
-
classLoader
public java.lang.ClassLoader 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
public DataConnectionService 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
@Nonnull public TestProcessorMetaSupplierContext setClassLoader(java.lang.ClassLoader classLoader)
-
checkPermission
public void checkPermission(java.security.Permission permission) throws java.security.AccessControlException
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:
java.security.AccessControlException
- when the security is enabled and the checked permission is not implied for the currentSubject
-
-