StreamMessageType
- type of messages in this stream.SubClass
- type of the concrete sub-classpublic abstract class InputDescriptor<StreamMessageType,SubClass extends InputDescriptor<StreamMessageType,SubClass>> extends StreamDescriptor<StreamMessageType,SubClass>
InputDescriptor
can be used for specifying Samza and system-specific properties of input streams.
Stream properties provided in configuration override corresponding properties specified using a descriptor.
This is the base descriptor for an input stream. Use a system-specific input descriptor (e.g. KafkaInputDescriptor)
obtained from its system descriptor (e.g. KafkaSystemDescriptor) if one is available. Otherwise use the
GenericInputDescriptor
obtained from a GenericSystemDescriptor
.
Constructor and Description |
---|
InputDescriptor(java.lang.String streamId,
Serde serde,
SystemDescriptor systemDescriptor,
InputTransformer transformer)
Constructs an
InputDescriptor instance. |
Modifier and Type | Method and Description |
---|---|
java.util.Optional<InputTransformer> |
getTransformer() |
SubClass |
isBounded()
If set, this stream will be considered a bounded stream.
|
SubClass |
shouldBootstrap()
If set, this stream will be processed as a bootstrap stream.
|
SubClass |
shouldDeleteCommittedMessages()
If set, and supported by the system implementation, messages older than the latest checkpointed offset
for this stream may be deleted after the commit.
|
SubClass |
shouldResetOffset()
If set, when a Samza container starts up, it ignores any checkpointed offset for this particular
input stream.
|
java.util.Map<java.lang.String,java.lang.String> |
toConfig() |
SubClass |
withOffsetDefault(SystemStreamMetadata.OffsetType offsetDefault)
If a container starts up without a checkpoint, this property determines where in the input stream we should start
consuming.
|
SubClass |
withPriority(int priority)
If one or more streams have a priority set (any positive integer), they will be processed with higher priority
than the other streams.
|
getPhysicalName, getSerde, getStreamId, getSystemDescriptor, getSystemName, withPhysicalName, withStreamConfigs
public InputDescriptor(java.lang.String streamId, Serde serde, SystemDescriptor systemDescriptor, InputTransformer transformer)
InputDescriptor
instance.streamId
- id of the streamserde
- serde for messages in the streamsystemDescriptor
- system descriptor this stream descriptor was obtained fromtransformer
- stream level input stream transform function if available, else nullpublic SubClass shouldResetOffset()
withOffsetDefault(org.apache.samza.system.SystemStreamMetadata.OffsetType)
setting.
Note that the reset takes effect every time a container is started, which may be every time you restart your job,
or more frequently if a container fails and is restarted by the framework.public SubClass withOffsetDefault(SystemStreamMetadata.OffsetType offsetDefault)
SystemDescriptor.withDefaultStreamOffsetDefault(org.apache.samza.system.SystemStreamMetadata.OffsetType)
. If both are defined, the stream-level definition
takes precedence.offsetDefault
- offset type to start processing frompublic SubClass withPriority(int priority)
You can set several streams to the same priority, or define multiple priority levels by assigning a higher number to the higher-priority streams.
If a higher-priority stream has any messages available, they will always be processed first; messages from lower-priority streams are only processed when there are no new messages on higher-priority inputs.
priority
- priority for this input streampublic SubClass shouldBootstrap()
public SubClass isBounded()
public SubClass shouldDeleteCommittedMessages()
public java.util.Optional<InputTransformer> getTransformer()
public java.util.Map<java.lang.String,java.lang.String> toConfig()
toConfig
in class StreamDescriptor<StreamMessageType,SubClass extends InputDescriptor<StreamMessageType,SubClass>>