Interface TierConsumerAgent
- All Known Implementing Classes:
DiskTierConsumerAgent,MemoryTierConsumerAgent,RemoteTierConsumerAgent
public interface TierConsumerAgent
The
TierConsumerAgent is the consumer agent of each tier in tiered store, which could
read data from responding tier.-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close the consumer agent.getNextBuffer(TieredStoragePartitionId partitionId, TieredStorageSubpartitionId subpartitionId, int segmentId) Get buffer from the consumer agent.intpeekNextBufferSubpartitionId(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.voidRegister the notifier to notify the availability of a subpartition.voidsetup(TieredStorageMemoryManager memoryManager) The consumer agent may request buffers from the memory manager.voidstart()Start the consumer agent.voidupdateTierShuffleDescriptor(TieredStoragePartitionId partitionId, TieredStorageInputChannelId inputChannelId, TieredStorageSubpartitionId subpartitionId, TierShuffleDescriptor tierShuffleDescriptor) Update theTierShuffleDescriptorfor the consumer agent.
-
Method Details
-
setup
The consumer agent may request buffers from the memory manager. Therefore, theTieredStorageMemoryManagershould be integrated into the tier consumer agent. Since the buffer pool is initialized after the creation of the client, the memory manager need to be assigned after the buffer pool becomes available. -
start
void start()Start the consumer agent. -
peekNextBufferSubpartitionId
int peekNextBufferSubpartitionId(TieredStoragePartitionId partitionId, ResultSubpartitionIndexSet indexSet) throws IOException 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.- Parameters:
partitionId- The index of the partition which the returned subpartition should belong to.indexSet- The indexes of the subpartitions expected.- Throws:
IOException
-
getNextBuffer
Optional<Buffer> getNextBuffer(TieredStoragePartitionId partitionId, TieredStorageSubpartitionId subpartitionId, int segmentId) throws IOException Get buffer from the consumer agent.- Parameters:
partitionId- the id of partition.subpartitionId- the id of subpartition.segmentId- the id of segment.- Returns:
- buffer.
- Throws:
IOException
-
registerAvailabilityNotifier
Register the notifier to notify the availability of a subpartition.- Parameters:
notifier- to notify availability.
-
updateTierShuffleDescriptor
void updateTierShuffleDescriptor(TieredStoragePartitionId partitionId, TieredStorageInputChannelId inputChannelId, TieredStorageSubpartitionId subpartitionId, TierShuffleDescriptor tierShuffleDescriptor) Update theTierShuffleDescriptorfor the consumer agent. -
close
Close the consumer agent.- Throws:
IOException
-