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 ofProcessorSupplier.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 Constructor Description TestProcessorSupplierContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TestProcessorSupplierContext
addFile(java.lang.String id, java.io.File file)
Add an attached file or folder.java.io.File
attachedDirectory(java.lang.String id)
Uses the supplied ID to look up a directory you attached to the current Jet job.java.io.File
attachedFile(java.lang.String id)
Uses the supplied ID to look up a file you attached to the current Jet job.protected java.lang.String
loggerName()
ManagedContext
managedContext()
ReturnsManagedContext
associated with this job.int
memberIndex()
Returns the index of the member among all the members that run this job: it's a unique cluster-wide index.java.io.File
recreateAttachedDirectory(java.lang.String id)
Behaves likeProcessorSupplier.Context.attachedDirectory(java.lang.String)
, but if the directory already exists, it deletes and recreates all its contents.java.io.File
recreateAttachedFile(java.lang.String id)
Behaves likeProcessorSupplier.Context.attachedFile(java.lang.String)
, but if the file already exists, it deletes and recreates it.com.hazelcast.internal.serialization.InternalSerializationService
serializationService()
TestProcessorSupplierContext
setHazelcastInstance(HazelcastInstance instance)
Sets the Hazelcast instance.TestProcessorSupplierContext
setIsLightJob(boolean isLightJob)
Sets the isLightJob flag.TestProcessorSupplierContext
setJobConfig(JobConfig jobConfig)
Sets the config for the job.TestProcessorSupplierContext
setLocalParallelism(int localParallelism)
Sets local parallelism.TestProcessorSupplierContext
setLogger(ILogger logger)
Sets the logger.TestProcessorSupplierContext
setManagedContext(ManagedContext managedContext)
Sets theManagedContext
TestProcessorSupplierContext
setMemberIndex(int memberIndex)
Sets the member indexTestProcessorSupplierContext
setPartitionAssignment(java.util.Map<Address,int[]> partitionAssignment)
Sets the partition assignment.TestProcessorSupplierContext
setProcessingGuarantee(ProcessingGuarantee processingGuarantee)
Sets the processing guarantee.TestProcessorSupplierContext
setTotalParallelism(int totalParallelism)
Sets the total parallelism.TestProcessorSupplierContext
setVertexName(java.lang.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
-
-
-
-
Method Detail
-
setLogger
@Nonnull public TestProcessorSupplierContext setLogger(@Nonnull ILogger logger)
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
@Nonnull public TestProcessorSupplierContext setJobConfig(@Nonnull JobConfig jobConfig)
Description copied from class:TestProcessorMetaSupplierContext
Sets the config for the job.- Overrides:
setJobConfig
in classTestProcessorMetaSupplierContext
-
setVertexName
@Nonnull public TestProcessorSupplierContext setVertexName(@Nonnull java.lang.String vertexName)
Description copied from class:TestProcessorMetaSupplierContext
Sets the vertex name.- Overrides:
setVertexName
in classTestProcessorMetaSupplierContext
-
setTotalParallelism
@Nonnull public TestProcessorSupplierContext setTotalParallelism(int totalParallelism)
Description copied from class:TestProcessorMetaSupplierContext
Sets the total parallelism.- Overrides:
setTotalParallelism
in classTestProcessorMetaSupplierContext
-
setLocalParallelism
@Nonnull public TestProcessorSupplierContext setLocalParallelism(int localParallelism)
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
@Nonnull public TestProcessorSupplierContext setIsLightJob(boolean isLightJob)
Description copied from class:TestProcessorMetaSupplierContext
Sets the isLightJob flag.- Overrides:
setIsLightJob
in classTestProcessorMetaSupplierContext
-
setPartitionAssignment
@Nonnull public TestProcessorSupplierContext setPartitionAssignment(java.util.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
@Nonnull public java.io.File attachedDirectory(@Nonnull java.lang.String id)
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
@Nonnull public java.io.File recreateAttachedDirectory(@Nonnull java.lang.String id)
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
@Nonnull public java.io.File attachedFile(@Nonnull java.lang.String id)
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
@Nonnull public java.io.File recreateAttachedFile(@Nonnull java.lang.String id)
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
@Nonnull public ManagedContext managedContext()
Description copied from interface:ProcessorSupplier.Context
ReturnsManagedContext
associated with this job.- Specified by:
managedContext
in interfaceProcessorSupplier.Context
-
addFile
@Nonnull public TestProcessorSupplierContext addFile(@Nonnull java.lang.String id, @Nonnull java.io.File file)
Add an attached file or folder. The test context doesn't distinguish between files and folders;
-
setMemberIndex
@Nonnull public TestProcessorSupplierContext setMemberIndex(int memberIndex)
Sets the member index
-
setManagedContext
@Nonnull public TestProcessorSupplierContext setManagedContext(@Nonnull ManagedContext managedContext)
Sets theManagedContext
-
loggerName
protected java.lang.String 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
-
-