Package com.hazelcast.jet.core
Interface ProcessorSupplier.Context
-
- All Superinterfaces:
ProcessorMetaSupplier.Context
- All Known Subinterfaces:
Processor.Context
- All Known Implementing Classes:
TestProcessorContext
,TestProcessorSupplierContext
- Enclosing interface:
- ProcessorSupplier
public static interface ProcessorSupplier.Context extends ProcessorMetaSupplier.Context
Context passed to the supplier in theinit()
call.- Since:
- Jet 3.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description 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.ILogger
logger()
Returns a logger for the associatedProcessorSupplier
.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.default int[]
memberPartitions()
Returns the partitions fromProcessorMetaSupplier.Context.partitionAssignment()
pertaining to this member.java.io.File
recreateAttachedDirectory(java.lang.String id)
Behaves likeattachedDirectory(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 likeattachedFile(java.lang.String)
, but if the file already exists, it deletes and recreates it.-
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
-
-
-
-
Method Detail
-
logger
@Nonnull ILogger logger()
Returns a logger for the associatedProcessorSupplier
.- Specified by:
logger
in interfaceProcessorMetaSupplier.Context
-
memberIndex
int memberIndex()
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]
.
-
attachedDirectory
@Nonnull java.io.File attachedDirectory(@Nonnull java.lang.String id)
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.- Parameters:
id
- the ID you used in a previousJobConfig.attachDirectory(java.net.URL)
call- Since:
- Jet 4.0
-
recreateAttachedDirectory
@Nonnull java.io.File recreateAttachedDirectory(@Nonnull java.lang.String id)
Behaves likeattachedDirectory(java.lang.String)
, but if the directory already exists, it deletes and recreates all its contents.- Since:
- Jet 4.3
-
attachedFile
@Nonnull java.io.File attachedFile(@Nonnull java.lang.String id)
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.- Parameters:
id
- the ID you used in a previousJobConfig.attachFile(java.net.URL)
call- Since:
- Jet 4.0
-
recreateAttachedFile
@Nonnull java.io.File recreateAttachedFile(@Nonnull java.lang.String id)
Behaves likeattachedFile(java.lang.String)
, but if the file already exists, it deletes and recreates it.- Since:
- Jet 4.3
-
managedContext
@Nonnull ManagedContext managedContext()
ReturnsManagedContext
associated with this job.
-
memberPartitions
@Nonnull default int[] memberPartitions()
Returns the partitions fromProcessorMetaSupplier.Context.partitionAssignment()
pertaining to this member. The returned list can be empty.
-
-