Class PartitionedTableLocationKey
java.lang.Object
io.deephaven.engine.table.impl.locations.impl.PartitionedTableLocationKey
- All Implemented Interfaces:
LogOutputAppendable
,ImmutableTableLocationKey
,TableLocationKey
,NamedImplementation
,Comparable<TableLocationKey>
- Direct Known Subclasses:
FileTableLocationKey
,PythonTableDataService.TableLocationKeyImpl
,URITableLocationKey
public abstract class PartitionedTableLocationKey
extends Object
implements ImmutableTableLocationKey
Base
ImmutableTableLocationKey
implementation for table locations that may be enclosed by partitions.
Subclasses should consider invoking the partition-map comparator at higher priority than other comparisons when
implementing Comparable.compareTo(Object)
. Also, should include the partitions in their equals(Object)
and
hashCode()
implementations if not calling super.equals()
and super.hashCode()
.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Compares two maps of partitions by key-value pairs.protected static final class
Formats a map of partitions as key-value pairs. -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
PartitionedTableLocationKey
(@Nullable Map<String, Comparable<?>> partitions) Construct a new PartitionedTableLocationKey for the suppliedpartitions
. -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(@NotNull TableLocationKey other) By default, compare fully qualified class names of the implementing classes.boolean
Get the set of available partition keys.final <PARTITION_VALUE_TYPE extends Comparable<PARTITION_VALUE_TYPE>>
PARTITION_VALUE_TYPEgetPartitionValue
(@NotNull String partitionKey) Lookup the value of one of the table partitions enclosing the location keyed bythis
.int
hashCode()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.deephaven.engine.table.impl.locations.ImmutableTableLocationKey
makeImmutable
Methods inherited from interface io.deephaven.base.log.LogOutputAppendable
append
Methods inherited from interface io.deephaven.util.type.NamedImplementation
getImplementationName
Methods inherited from interface io.deephaven.engine.table.impl.locations.TableLocationKey
clear
-
Field Details
-
partitions
-
cachedHashCode
protected int cachedHashCode
-
-
Constructor Details
-
PartitionedTableLocationKey
Construct a new PartitionedTableLocationKey for the suppliedpartitions
.- Parameters:
partitions
- The table partitions enclosing the table location keyed bythis
. Note that if this parameter isnull
, the location will be a member of no partitions. An ordered copy of the map will be made, so the calling code is free to mutate the map after this call completes, but the partition keys and values themselves must be effectively immutable.
-
-
Method Details
-
getPartitionValue
public final <PARTITION_VALUE_TYPE extends Comparable<PARTITION_VALUE_TYPE>> PARTITION_VALUE_TYPE getPartitionValue(@NotNull @NotNull String partitionKey) Description copied from interface:TableLocationKey
Lookup the value of one of the table partitions enclosing the location keyed bythis
.- Specified by:
getPartitionValue
in interfaceTableLocationKey
- Type Parameters:
PARTITION_VALUE_TYPE
- The expected type of the partition value- Parameters:
partitionKey
- The name of the partition- Returns:
- The partition value
-
getPartitionKeys
Description copied from interface:TableLocationKey
Get the set of available partition keys.- Specified by:
getPartitionKeys
in interfaceTableLocationKey
- Returns:
- The set of available partition keys
-
compareTo
Description copied from interface:TableLocationKey
By default, compare fully qualified class names of the implementing classes. This method is a fallback where the implementing classes are not directly comparable, and should help establish a consistent ordering between distinct implementations.- Specified by:
compareTo
in interfaceComparable<TableLocationKey>
- Specified by:
compareTo
in interfaceTableLocationKey
-
hashCode
public int hashCode() -
equals
-