public class RemoteTierConsumerAgent extends Object implements TierConsumerAgent, AvailabilityNotifier
| Constructor and Description |
|---|
RemoteTierConsumerAgent(List<TieredStorageConsumerSpec> tieredStorageConsumerSpecs,
RemoteStorageScanner remoteStorageScanner,
PartitionFileReader partitionFileReader,
int bufferSizeBytes) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the consumer agent.
|
Optional<Buffer> |
getNextBuffer(TieredStoragePartitionId partitionId,
TieredStorageSubpartitionId subpartitionId,
int segmentId)
Get buffer from the consumer agent.
|
void |
notifyAvailable(TieredStoragePartitionId partitionId,
TieredStorageInputChannelId inputChannelId)
Notify that the data for the specific partition and input channel is available in tiered
storage.
|
void |
notifyAvailable(TieredStoragePartitionId partitionId,
TieredStorageSubpartitionId subpartitionId)
Notify that the data from the specific partition and subpartition is available in tiered
storage.
|
int |
peekNextBufferSubpartitionId(TieredStoragePartitionId partitionId,
ResultSubpartitionIndexSet indexSet)
Returns the index of the subpartition where the next buffer locates, or -1 if there is no
buffer available or the subpartition index does not belong to the specified indexSet.
|
void |
registerAvailabilityNotifier(AvailabilityNotifier notifier)
Register the notifier to notify the availability of a subpartition.
|
void |
start()
Start the consumer agent.
|
public RemoteTierConsumerAgent(List<TieredStorageConsumerSpec> tieredStorageConsumerSpecs, RemoteStorageScanner remoteStorageScanner, PartitionFileReader partitionFileReader, int bufferSizeBytes)
public void start()
TierConsumerAgentstart in interface TierConsumerAgentpublic int peekNextBufferSubpartitionId(TieredStoragePartitionId partitionId, ResultSubpartitionIndexSet indexSet) throws IOException
TierConsumerAgentpeekNextBufferSubpartitionId in interface TierConsumerAgentpartitionId - The index of the partition which the returned subpartition should belong
to.indexSet - The indexes of the subpartitions expected.IOExceptionpublic Optional<Buffer> getNextBuffer(TieredStoragePartitionId partitionId, TieredStorageSubpartitionId subpartitionId, int segmentId)
TierConsumerAgentgetNextBuffer in interface TierConsumerAgentpartitionId - the id of partition.subpartitionId - the id of subpartition.segmentId - the id of segment.public void registerAvailabilityNotifier(AvailabilityNotifier notifier)
TierConsumerAgentregisterAvailabilityNotifier in interface TierConsumerAgentnotifier - to notify availability.public void close()
throws IOException
TierConsumerAgentclose in interface TierConsumerAgentIOExceptionpublic void notifyAvailable(TieredStoragePartitionId partitionId, TieredStorageSubpartitionId subpartitionId)
AvailabilityNotifiernotifyAvailable in interface AvailabilityNotifierpartitionId - the partition id.subpartitionId - the subpartition id.public void notifyAvailable(TieredStoragePartitionId partitionId, TieredStorageInputChannelId inputChannelId)
AvailabilityNotifiernotifyAvailable in interface AvailabilityNotifierpartitionId - the partition id.inputChannelId - the input channel id.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.