Class ConcurrentMapPartitionUpsertMetadataManager
- java.lang.Object
-
- org.apache.pinot.segment.local.upsert.ConcurrentMapPartitionUpsertMetadataManager
-
- All Implemented Interfaces:
Closeable,AutoCloseable,PartitionUpsertMetadataManager
@ThreadSafe public class ConcurrentMapPartitionUpsertMetadataManager extends Object implements PartitionUpsertMetadataManager
Implementation ofPartitionUpsertMetadataManagerthat is backed by aConcurrentHashMap.
-
-
Constructor Summary
Constructors Constructor Description ConcurrentMapPartitionUpsertMetadataManager(String tableNameWithType, int partitionId, List<String> primaryKeyColumns, String comparisonColumn, HashFunction hashFunction, PartialUpsertHandler partialUpsertHandler, ServerMetrics serverMetrics)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddRecord(MutableSegment segment, RecordInfo recordInfo)Updates the upsert metadata for a new consumed record in the given consuming segment.voidaddSegment(ImmutableSegment segment)Initializes the upsert metadata for the given immutable segment.voidclose()List<String>getPrimaryKeyColumns()Returns the primary key columns.voidremoveSegment(IndexSegment segment)Removes the upsert metadata for the given segment.voidreplaceSegment(ImmutableSegment segment, IndexSegment oldSegment)Replaces the upsert metadata for the old segment with the new immutable segment.GenericRowupdateRecord(GenericRow record, RecordInfo recordInfo)Returns the merged record when partial-upsert is enabled.
-
-
-
Constructor Detail
-
ConcurrentMapPartitionUpsertMetadataManager
public ConcurrentMapPartitionUpsertMetadataManager(String tableNameWithType, int partitionId, List<String> primaryKeyColumns, String comparisonColumn, HashFunction hashFunction, @Nullable PartialUpsertHandler partialUpsertHandler, ServerMetrics serverMetrics)
-
-
Method Detail
-
getPrimaryKeyColumns
public List<String> getPrimaryKeyColumns()
Description copied from interface:PartitionUpsertMetadataManagerReturns the primary key columns.- Specified by:
getPrimaryKeyColumnsin interfacePartitionUpsertMetadataManager
-
addSegment
public void addSegment(ImmutableSegment segment)
Description copied from interface:PartitionUpsertMetadataManagerInitializes the upsert metadata for the given immutable segment.- Specified by:
addSegmentin interfacePartitionUpsertMetadataManager
-
addRecord
public void addRecord(MutableSegment segment, RecordInfo recordInfo)
Description copied from interface:PartitionUpsertMetadataManagerUpdates the upsert metadata for a new consumed record in the given consuming segment.- Specified by:
addRecordin interfacePartitionUpsertMetadataManager
-
replaceSegment
public void replaceSegment(ImmutableSegment segment, IndexSegment oldSegment)
Description copied from interface:PartitionUpsertMetadataManagerReplaces the upsert metadata for the old segment with the new immutable segment.- Specified by:
replaceSegmentin interfacePartitionUpsertMetadataManager
-
removeSegment
public void removeSegment(IndexSegment segment)
Description copied from interface:PartitionUpsertMetadataManagerRemoves the upsert metadata for the given segment.- Specified by:
removeSegmentin interfacePartitionUpsertMetadataManager
-
updateRecord
public GenericRow updateRecord(GenericRow record, RecordInfo recordInfo)
Description copied from interface:PartitionUpsertMetadataManagerReturns the merged record when partial-upsert is enabled.- Specified by:
updateRecordin interfacePartitionUpsertMetadataManager
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
-