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

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

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

public class EndsAndHolesPartitionTimeline
extends PartitionTimeline

One implementation of PartitionTimeline that stores first partition, latest partition and a collection of holes in between them, excluding the edges(start and end values). This is the default Timeline for tables that don't specify which Timeline Class to use in it's params.


Constructor Summary
EndsAndHolesPartitionTimeline(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

EndsAndHolesPartitionTimeline

public EndsAndHolesPartitionTimeline(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

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 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.