Package com.hazelcast.jet.core.test
Class TestProcessorSupplierContext
java.lang.Object
com.hazelcast.jet.core.test.TestProcessorMetaSupplierContext
com.hazelcast.jet.core.test.TestProcessorSupplierContext
- All Implemented Interfaces:
ProcessorMetaSupplier.Context
,ProcessorSupplier.Context
,com.hazelcast.jet.impl.execution.init.Contexts.InternalProcSupplierCtx
- Direct Known Subclasses:
TestProcessorContext
public class TestProcessorSupplierContext
extends TestProcessorMetaSupplierContext
implements ProcessorSupplier.Context, com.hazelcast.jet.impl.execution.init.Contexts.InternalProcSupplierCtx
Implementation of
ProcessorSupplier.Context
suitable to be used
in tests.- Since:
- Jet 3.0
-
Field Summary
Fields inherited from class com.hazelcast.jet.core.test.TestProcessorMetaSupplierContext
logger
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionAdd an attached file or folder.Uses the supplied ID to look up a directory you attached to the current Jet job.attachedFile
(String id) Uses the supplied ID to look up a file you attached to the current Jet job.protected String
ReturnsManagedContext
associated with this job.int
Returns the index of the member among all the members that run this job: it's a unique cluster-wide index.Behaves likeProcessorSupplier.Context.attachedDirectory(java.lang.String)
, but if the directory already exists, it deletes and recreates all its contents.Behaves likeProcessorSupplier.Context.attachedFile(java.lang.String)
, but if the file already exists, it deletes and recreates it.com.hazelcast.internal.serialization.InternalSerializationService
setHazelcastInstance
(HazelcastInstance instance) Sets the Hazelcast instance.setIsLightJob
(boolean isLightJob) Sets the isLightJob flag.setJobConfig
(JobConfig jobConfig) Sets the config for the job.setLocalParallelism
(int localParallelism) Sets local parallelism.Sets the logger.setManagedContext
(ManagedContext managedContext) Sets theManagedContext
setMemberIndex
(int memberIndex) Sets the member indexsetPartitionAssignment
(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.Methods inherited from class com.hazelcast.jet.core.test.TestProcessorMetaSupplierContext
checkPermission, classLoader, dataConnectionService, executionId, getNodeEngine, hazelcastInstance, isLightJob, jetInstance, jobConfig, jobId, localParallelism, logger, maxProcessorAccumulatedRecords, memberCount, partitionAssignment, processingGuarantee, setClassLoader, setExecutionId, setJobId, setMaxProcessorAccumulatedRecords, totalParallelism, vertexName
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
checkPermission, classLoader, dataConnectionService, executionId, hazelcastInstance, isLightJob, jetInstance, jobConfig, jobId, localParallelism, maxProcessorAccumulatedRecords, memberCount, partitionAssignment, processingGuarantee, snapshottingEnabled, totalParallelism, vertexName
Methods inherited from interface com.hazelcast.jet.core.ProcessorSupplier.Context
logger, memberPartitions
-
Constructor Details
-
TestProcessorSupplierContext
public TestProcessorSupplierContext()
-
-
Method Details
-
setLogger
Description copied from class:TestProcessorMetaSupplierContext
Sets the logger.- Overrides:
setLogger
in classTestProcessorMetaSupplierContext
-
setHazelcastInstance
@Nonnull public TestProcessorSupplierContext setHazelcastInstance(@Nonnull HazelcastInstance instance) Description copied from class:TestProcessorMetaSupplierContext
Sets the Hazelcast instance.- Overrides:
setHazelcastInstance
in classTestProcessorMetaSupplierContext
-
setJobConfig
Description copied from class:TestProcessorMetaSupplierContext
Sets the config for the job.- Overrides:
setJobConfig
in classTestProcessorMetaSupplierContext
-
setVertexName
Description copied from class:TestProcessorMetaSupplierContext
Sets the vertex name.- Overrides:
setVertexName
in classTestProcessorMetaSupplierContext
-
setTotalParallelism
Description copied from class:TestProcessorMetaSupplierContext
Sets the total parallelism.- Overrides:
setTotalParallelism
in classTestProcessorMetaSupplierContext
-
setLocalParallelism
Description copied from class:TestProcessorMetaSupplierContext
Sets local parallelism.- Overrides:
setLocalParallelism
in classTestProcessorMetaSupplierContext
-
setProcessingGuarantee
@Nonnull public TestProcessorSupplierContext setProcessingGuarantee(@Nonnull ProcessingGuarantee processingGuarantee) Description copied from class:TestProcessorMetaSupplierContext
Sets the processing guarantee.- Overrides:
setProcessingGuarantee
in classTestProcessorMetaSupplierContext
-
setIsLightJob
Description copied from class:TestProcessorMetaSupplierContext
Sets the isLightJob flag.- Overrides:
setIsLightJob
in classTestProcessorMetaSupplierContext
-
setPartitionAssignment
@Nonnull public TestProcessorSupplierContext setPartitionAssignment(Map<Address, int[]> partitionAssignment) Description copied from class:TestProcessorMetaSupplierContext
Sets the partition assignment.- Overrides:
setPartitionAssignment
in classTestProcessorMetaSupplierContext
-
memberIndex
public int memberIndex()Description copied from interface:ProcessorSupplier.Context
Returns the index of the member among all the members that run this job: it's a unique cluster-wide index.The value is in the range
[0...memberCount-1]
.- Specified by:
memberIndex
in interfaceProcessorSupplier.Context
-
attachedDirectory
Description copied from interface:ProcessorSupplier.Context
Uses the supplied ID to look up a directory you attached to the current Jet job. Creates a temporary directory with the same contents on the local cluster member and returns the location of the created directory. If the directory was already created, just returns its location.- Specified by:
attachedDirectory
in interfaceProcessorSupplier.Context
- Parameters:
id
- the ID you used in a previousJobConfig.attachDirectory(java.net.URL)
call
-
recreateAttachedDirectory
Description copied from interface:ProcessorSupplier.Context
Behaves likeProcessorSupplier.Context.attachedDirectory(java.lang.String)
, but if the directory already exists, it deletes and recreates all its contents.- Specified by:
recreateAttachedDirectory
in interfaceProcessorSupplier.Context
-
attachedFile
Description copied from interface:ProcessorSupplier.Context
Uses the supplied ID to look up a file you attached to the current Jet job. Creates a temporary file with the same contents on the local cluster member and returns the location of the created file. If the file was already created, just returns its location.- Specified by:
attachedFile
in interfaceProcessorSupplier.Context
- Parameters:
id
- the ID you used in a previousJobConfig.attachFile(java.net.URL)
call
-
recreateAttachedFile
Description copied from interface:ProcessorSupplier.Context
Behaves likeProcessorSupplier.Context.attachedFile(java.lang.String)
, but if the file already exists, it deletes and recreates it.- Specified by:
recreateAttachedFile
in interfaceProcessorSupplier.Context
-
managedContext
Description copied from interface:ProcessorSupplier.Context
ReturnsManagedContext
associated with this job.- Specified by:
managedContext
in interfaceProcessorSupplier.Context
-
addFile
Add an attached file or folder. The test context doesn't distinguish between files and folders; -
setMemberIndex
Sets the member index -
setManagedContext
@Nonnull public TestProcessorSupplierContext setManagedContext(@Nonnull ManagedContext managedContext) Sets theManagedContext
-
loggerName
- Overrides:
loggerName
in classTestProcessorMetaSupplierContext
-
serializationService
@Nonnull public com.hazelcast.internal.serialization.InternalSerializationService serializationService()- Specified by:
serializationService
in interfacecom.hazelcast.jet.impl.execution.init.Contexts.InternalProcSupplierCtx
- Since:
- 5.4
-