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

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

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

public class StoreAllPartitionTimeline
extends PartitionTimeline

Implementation of PartitionTimeline that stores all partitions as a tree set. Created for instrumentation purposes. Helps in test cases. In real life scenarios, this would be almost always end up causing out of memory error.


Constructor Summary
StoreAllPartitionTimeline(String storageTableName, UpdatePeriod updatePeriod, String partCol)
           
 
Method Summary
 boolean add(Collection<TimePartition> partitions)
          Add multiple partitions to timeline
 boolean add(TimePartition partition)
          Add partition to timeline
 boolean drop(TimePartition toDrop)
          drop partition.
 boolean exists(TimePartition partition)
          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
addForBatchAddition, commitBatchAdditions, getLatestDate, init, updateTableParams
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StoreAllPartitionTimeline

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

add

public boolean add(@NonNull
                   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

add

public boolean add(@NonNull
                   Collection<TimePartition> partitions)
            throws LensException
Description copied from class: PartitionTimeline
Add multiple partitions to timeline

Overrides:
add in class PartitionTimeline
Returns:
whether add was successful
Throws:
LensException

drop

public boolean drop(@NonNull
                    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 partition)
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.