Class SegmentPartitionMetadata
- java.lang.Object
-
- org.apache.pinot.common.metadata.segment.SegmentPartitionMetadata
-
public class SegmentPartitionMetadata extends Object
Class for partition metadata for a segment.
-
-
Field Summary
Fields Modifier and Type Field Description static intINVALID_NUM_PARTITIONS
-
Constructor Summary
Constructors Constructor Description SegmentPartitionMetadata(Map<String,ColumnPartitionMetadata> columnPartitionMap)Constructor for the class.
-
Method Summary
Modifier and Type Method Description booleanequals(Object o)static SegmentPartitionMetadatafromJsonString(String jsonString)Given a JSON string, de-serialize and return an instance ofSegmentPartitionMetadataMap<String,ColumnPartitionMetadata>getColumnPartitionMap()Returns the map from column name to column's partition metadata.StringgetFunctionName(String column)Returns the partition function for the given column, null if there isn't one.intgetNumPartitions(String column)Returns the number of partitions for the specified column.Set<Integer>getPartitions(String column)Returns the set of partitions for the specified column, ornullif the column is not partitioned.inthashCode()StringtoJsonString()Returns the JSON equivalent of the object.
-
-
-
Field Detail
-
INVALID_NUM_PARTITIONS
public static final int INVALID_NUM_PARTITIONS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SegmentPartitionMetadata
public SegmentPartitionMetadata(@Nonnull Map<String,ColumnPartitionMetadata> columnPartitionMap)Constructor for the class.- Parameters:
columnPartitionMap- Column name to ColumnPartitionMetadata map.
-
-
Method Detail
-
getColumnPartitionMap
public Map<String,ColumnPartitionMetadata> getColumnPartitionMap()
Returns the map from column name to column's partition metadata.- Returns:
- Map from column name to its partition metadata.
-
getFunctionName
@Nullable public String getFunctionName(@Nonnull String column)
Returns the partition function for the given column, null if there isn't one.- Parameters:
column- Column for which to return the partition function.- Returns:
- Partition function for the column.
-
fromJsonString
public static SegmentPartitionMetadata fromJsonString(String jsonString) throws IOException
Given a JSON string, de-serialize and return an instance ofSegmentPartitionMetadata- Parameters:
jsonString- Input JSON string- Returns:
- Instance of
SegmentPartitionMetadatabuilt from the input string. - Throws:
IOException
-
toJsonString
public String toJsonString() throws IOException
Returns the JSON equivalent of the object.- Returns:
- JSON string equivalent of the object.
- Throws:
IOException
-
getNumPartitions
public int getNumPartitions(String column)
Returns the number of partitions for the specified column. ReturnsINVALID_NUM_PARTITIONSif it does not exist for the column.- Parameters:
column- Column for which to get number of partitions.- Returns:
- Number of partitions of the column.
-
getPartitions
public Set<Integer> getPartitions(String column)
Returns the set of partitions for the specified column, ornullif the column is not partitioned.- Parameters:
column- Column for which to return the set of partitions- Returns:
- Set of partitions for the specified column
-
-