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
Constructors -
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 StringReturnsManagedContextassociated with this job.intReturns 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.InternalSerializationServicesetHazelcastInstance(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 theManagedContextsetMemberIndex(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, vertexNameMethods 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
checkPermission, classLoader, dataConnectionService, executionId, hazelcastInstance, isLightJob, jetInstance, jobConfig, jobId, localParallelism, maxProcessorAccumulatedRecords, memberCount, partitionAssignment, processingGuarantee, snapshottingEnabled, totalParallelism, vertexNameMethods inherited from interface com.hazelcast.jet.core.ProcessorSupplier.Context
logger, memberPartitions
-
Constructor Details
-
TestProcessorSupplierContext
public TestProcessorSupplierContext()
-
-
Method Details
-
setLogger
Description copied from class:TestProcessorMetaSupplierContextSets the logger.- Overrides:
setLoggerin classTestProcessorMetaSupplierContext
-
setHazelcastInstance
@Nonnull public TestProcessorSupplierContext setHazelcastInstance(@Nonnull HazelcastInstance instance) Description copied from class:TestProcessorMetaSupplierContextSets the Hazelcast instance.- Overrides:
setHazelcastInstancein classTestProcessorMetaSupplierContext
-
setJobConfig
Description copied from class:TestProcessorMetaSupplierContextSets the config for the job.- Overrides:
setJobConfigin classTestProcessorMetaSupplierContext
-
setVertexName
Description copied from class:TestProcessorMetaSupplierContextSets the vertex name.- Overrides:
setVertexNamein classTestProcessorMetaSupplierContext
-
setTotalParallelism
Description copied from class:TestProcessorMetaSupplierContextSets the total parallelism.- Overrides:
setTotalParallelismin classTestProcessorMetaSupplierContext
-
setLocalParallelism
Description copied from class:TestProcessorMetaSupplierContextSets local parallelism.- Overrides:
setLocalParallelismin classTestProcessorMetaSupplierContext
-
setProcessingGuarantee
@Nonnull public TestProcessorSupplierContext setProcessingGuarantee(@Nonnull ProcessingGuarantee processingGuarantee) Description copied from class:TestProcessorMetaSupplierContextSets the processing guarantee.- Overrides:
setProcessingGuaranteein classTestProcessorMetaSupplierContext
-
setIsLightJob
Description copied from class:TestProcessorMetaSupplierContextSets the isLightJob flag.- Overrides:
setIsLightJobin classTestProcessorMetaSupplierContext
-
setPartitionAssignment
@Nonnull public TestProcessorSupplierContext setPartitionAssignment(Map<Address, int[]> partitionAssignment) Description copied from class:TestProcessorMetaSupplierContextSets the partition assignment.- Overrides:
setPartitionAssignmentin classTestProcessorMetaSupplierContext
-
memberIndex
public int memberIndex()Description copied from interface:ProcessorSupplier.ContextReturns 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:
memberIndexin interfaceProcessorSupplier.Context
-
attachedDirectory
Description copied from interface:ProcessorSupplier.ContextUses 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:
attachedDirectoryin interfaceProcessorSupplier.Context- Parameters:
id- the ID you used in a previousJobConfig.attachDirectory(java.net.URL)call
-
recreateAttachedDirectory
Description copied from interface:ProcessorSupplier.ContextBehaves likeProcessorSupplier.Context.attachedDirectory(java.lang.String), but if the directory already exists, it deletes and recreates all its contents.- Specified by:
recreateAttachedDirectoryin interfaceProcessorSupplier.Context
-
attachedFile
Description copied from interface:ProcessorSupplier.ContextUses 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:
attachedFilein interfaceProcessorSupplier.Context- Parameters:
id- the ID you used in a previousJobConfig.attachFile(java.net.URL)call
-
recreateAttachedFile
Description copied from interface:ProcessorSupplier.ContextBehaves likeProcessorSupplier.Context.attachedFile(java.lang.String), but if the file already exists, it deletes and recreates it.- Specified by:
recreateAttachedFilein interfaceProcessorSupplier.Context
-
managedContext
Description copied from interface:ProcessorSupplier.ContextReturnsManagedContextassociated with this job.- Specified by:
managedContextin 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:
loggerNamein classTestProcessorMetaSupplierContext
-
serializationService
@Nonnull public com.hazelcast.internal.serialization.InternalSerializationService serializationService()- Specified by:
serializationServicein interfacecom.hazelcast.jet.impl.execution.init.Contexts.InternalProcSupplierCtx- Since:
- 5.4
-