Package io.pravega.client.segment.impl
Interface SegmentOutputStreamFactory
-
- All Known Implementing Classes:
SegmentOutputStreamFactoryImpl
public interface SegmentOutputStreamFactory
CreatesSegmentOutputStream
for segments and transactions.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description SegmentOutputStream
createOutputStreamForSegment(Segment segment, EventWriterConfig config, DelegationTokenProvider tokenProvider)
Creates a SegmentOutputStream for an existing segment.SegmentOutputStream
createOutputStreamForSegment(Segment segment, java.util.function.Consumer<Segment> segmentSealedCallback, EventWriterConfig config, DelegationTokenProvider tokenProvider)
Creates a stream for an existing segment.SegmentOutputStream
createOutputStreamForTransaction(Segment segment, java.util.UUID txId, EventWriterConfig config, DelegationTokenProvider tokenProvider)
Creates a stream for an open transaction.
-
-
-
Method Detail
-
createOutputStreamForTransaction
SegmentOutputStream createOutputStreamForTransaction(Segment segment, java.util.UUID txId, EventWriterConfig config, DelegationTokenProvider tokenProvider)
Creates a stream for an open transaction. This will fail if the segment does not exist or is sealed. This may be called multiple times for the same transaction.- Parameters:
segment
- The segment the transaction belongs to.txId
- The transaction id.config
- The configuration for the writertokenProvider
- TheDelegationTokenProvider
instance to be used for obtaining a delegation token.- Returns:
- New instance of SegmentOutputStream with an open transaction.
-
createOutputStreamForSegment
SegmentOutputStream createOutputStreamForSegment(Segment segment, java.util.function.Consumer<Segment> segmentSealedCallback, EventWriterConfig config, DelegationTokenProvider tokenProvider)
Creates a stream for an existing segment. This operation will fail if the segment does not exist or is sealed. This operation may be called multiple times on the same segment from the same or different clients (i.e., there can be concurrent Stream Writers in the same process space).- Parameters:
segment
- The segment.segmentSealedCallback
- Method to be executed on receiving SegmentSealed from SSS.config
- The configuration for the writertokenProvider
- TheDelegationTokenProvider
instance to be used for obtaining a delegation token.- Returns:
- New instance of SegmentOutputStream for writing.
-
createOutputStreamForSegment
SegmentOutputStream createOutputStreamForSegment(Segment segment, EventWriterConfig config, DelegationTokenProvider tokenProvider)
Creates a SegmentOutputStream for an existing segment. This operation will fail if the segment does not exist or is sealed. This operation may be called multiple times on the same segment from the same or different clients (i.e., there can be concurrent Stream Writers in the same process space).- Parameters:
segment
- The segment.config
- The configuration for the writertokenProvider
- TheDelegationTokenProvider
instance to be used for obtaining a delegation token.- Returns:
- New instance of SegmentOutputStream for writing.
-
-