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

org.apache.lens.cube.metadata
Class TimePartitionRange

java.lang.Object
  extended by org.apache.lens.cube.metadata.TimePartitionRange
All Implemented Interfaces:
Iterable<TimePartition>, Named

public class TimePartitionRange
extends Object
implements Iterable<TimePartition>, Named

Range of time partition. [begin,end). i.e. inclusive begin and exclusive end.


Constructor Summary
TimePartitionRange(TimePartition begin, TimePartition end)
           
 
Method Summary
 boolean contains(TimePartition partition)
           
 String getName()
           
 boolean isEmpty()
           
 Iterator<TimePartition> iterator()
          returns TimePartition objects starting from begin and upto(excluding) end.
static TimePartitionRange parseFrom(UpdatePeriod updatePeriod, String from, String to)
           
 long size()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TimePartitionRange

public TimePartitionRange(TimePartition begin,
                          TimePartition end)
                   throws LensException
Throws:
LensException
Method Detail

toString

public String toString()
Overrides:
toString in class Object

iterator

public Iterator<TimePartition> iterator()
returns TimePartition objects starting from begin and upto(excluding) end. interval of iteration is the update period of the partitions. Assumes both partitions have same update period.

Specified by:
iterator in interface Iterable<TimePartition>

contains

public boolean contains(TimePartition partition)
Parameters:
partition -
Returns:
begin <= partition < end

isEmpty

public boolean isEmpty()
Returns:
if range is empty range.

getName

public String getName()
Specified by:
getName in interface Named

parseFrom

public static TimePartitionRange parseFrom(UpdatePeriod updatePeriod,
                                           String from,
                                           String to)
                                    throws LensException
Throws:
LensException

size

public long size()


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