public abstract class PartitionManager extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
PartitionManager.Interval
Keeps a value -> partition map for a specific time interval
|
| Modifier and Type | Field and Description |
|---|---|
protected NavigableMap<Long,PartitionManager.Interval> |
intervals |
protected PartitioningSpec |
partitioningSpec |
protected PartitionManager.Interval |
pcache |
protected TableDefinition |
tableDefinition |
| Constructor and Description |
|---|
PartitionManager(TableDefinition tableDefinition) |
| Modifier and Type | Method and Description |
|---|---|
Partition |
createAndGetPartition(long instant,
Object value)
Creates (if not already existing) and returns the partition in which the instant,value should be written.
|
protected abstract Partition |
createPartition(Object value)
Create a partition for value based partitioning
|
protected abstract Partition |
createPartitionByTime(TimePartitionSchema.PartitionInfo pinfo,
Object value)
Create a partition for time (and possible value) based partitioning
|
Partition |
getPartitionForTuple(Tuple t)
Gets partition where tuple has to be written.
|
List<Partition> |
getPartitions()
Retrieves the existing partitions
|
Iterator<List<Partition>> |
iterator(long start,
Set<Object> partitionValueFilter)
See
iterator(Set) |
Iterator<List<Partition>> |
iterator(Set<Object> partitionValueFilter)
Returns an iterator which at each step gives the list of partition corresponding to a time interval (so when we do a replay those partitions have to be played in parallel).
|
Iterator<List<Partition>> |
reverseIterator(long start,
Set<Object> partitionValueFilter) |
Iterator<List<Partition>> |
reverseIterator(Set<Object> partitionValueFilter)
same as above, only in reverse direction
|
protected final TableDefinition tableDefinition
protected final PartitioningSpec partitioningSpec
protected NavigableMap<Long,PartitionManager.Interval> intervals
protected PartitionManager.Interval pcache
public PartitionManager(TableDefinition tableDefinition)
public Iterator<List<Partition>> iterator(Set<Object> partitionValueFilter)
partitionValueFilter - - return only partitions whose value are in the filter. If null, return all partitions;public Iterator<List<Partition>> reverseIterator(Set<Object> partitionValueFilter)
partitionValueFilter - public Iterator<List<Partition>> iterator(long start, Set<Object> partitionValueFilter)
iterator(Set)start - partitionValueFilter - values - return only partitions whose value are in the filter. If null, return all partitions;public Iterator<List<Partition>> reverseIterator(long start, Set<Object> partitionValueFilter)
public Partition createAndGetPartition(long instant, Object value) throws IOException
instant - - time for which the partition has to be created - can be TimeEncoding.INVALID in case value only or no partitioningvalue - - value for which the partition has to be created - can be null in case of time only or no partitioning.
For the enum partitions, the value is the index (type Short) rather than the string.IOExceptionpublic Partition getPartitionForTuple(Tuple t) throws IOException
t - IOExceptionprotected abstract Partition createPartitionByTime(TimePartitionSchema.PartitionInfo pinfo, Object value) throws IOException
pinfo - value - IOExceptionprotected abstract Partition createPartition(Object value) throws IOException
value - IOExceptionCopyright © 2017 Space Applications Services. All rights reserved.