This project has retired. For details please refer to its Attic page.
RangesPartitionTimeline (Lens 2.1.0-beta-incubating API)

org.apache.lens.cube.metadata.timeline
Class RangesPartitionTimeline

java.lang.Object
  extended by org.apache.lens.cube.metadata.timeline.PartitionTimeline
      extended by org.apache.lens.cube.metadata.timeline.RangesPartitionTimeline
All Implemented Interfaces:
Iterable<TimePartition>

public class RangesPartitionTimeline
extends PartitionTimeline

One implementation of PartitionTimeline that stores ranges of partition presence, Basically a list of tuples each tuple represents a range of presence. range is of the form [from, end) i.e. including the first element and excluding the second element of the tuple


Constructor Summary
RangesPartitionTimeline(String storageTableName, UpdatePeriod updatePeriod, String partCol)
           
 
Method Summary
 boolean add(TimePartition partition)
          Add partition to timeline
 boolean drop(TimePartition toDrop)
          drop partition.
 boolean exists(TimePartition toCheck)
          Checks partition existance
 boolean initFromProperties(Map<String,String> properties)
          deserialize member variables from given map
 boolean isConsistent()
          whether timeline is in consistent state
 boolean isEmpty()
          Whether No partitions have been registered
 Iterator<TimePartition> iterator()
           
 TimePartition latest()
          latest partition.
 Map<String,String> toProperties()
          serialize member objects as map
 
Methods inherited from class org.apache.lens.cube.metadata.timeline.PartitionTimeline
add, addForBatchAddition, commitBatchAdditions, getLatestDate, init, updateTableParams
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RangesPartitionTimeline

public RangesPartitionTimeline(String storageTableName,
                               UpdatePeriod updatePeriod,
                               String partCol)
Method Detail

add

public boolean add(TimePartition partition)
            throws LensException
Description copied from class: PartitionTimeline
Add partition to timeline

Specified by:
add in class PartitionTimeline
Returns:
whether add was successful
Throws:
LensException

drop

public boolean drop(TimePartition toDrop)
             throws LensException
Description copied from class: PartitionTimeline
drop partition.

Specified by:
drop in class PartitionTimeline
Returns:
whether drop was successful
Throws:
LensException

latest

public TimePartition latest()
Description copied from class: PartitionTimeline
latest partition. will be null if no partitions exist.

Specified by:
latest in class PartitionTimeline
Returns:

toProperties

public Map<String,String> toProperties()
Description copied from class: PartitionTimeline
serialize member objects as map

Specified by:
toProperties in class PartitionTimeline
Returns:

initFromProperties

public boolean initFromProperties(Map<String,String> properties)
                           throws LensException
Description copied from class: PartitionTimeline
deserialize member variables from given map

Specified by:
initFromProperties in class PartitionTimeline
Returns:
true if after deserializing, the timeline is in consistent state
Throws:
LensException
See Also:
PartitionTimeline.isConsistent()

isEmpty

public boolean isEmpty()
Description copied from class: PartitionTimeline
Whether No partitions have been registered

Specified by:
isEmpty in class PartitionTimeline
Returns:

isConsistent

public boolean isConsistent()
Description copied from class: PartitionTimeline
whether timeline is in consistent state

Specified by:
isConsistent in class PartitionTimeline
Returns:

exists

public boolean exists(TimePartition toCheck)
Description copied from class: PartitionTimeline
Checks partition existance

Specified by:
exists in class PartitionTimeline
Returns:

iterator

public Iterator<TimePartition> iterator()


Copyright © 2014–2015 Apache Software Foundation. All rights reserved.