org.apache.lens.cube.metadata
Class TimePartitionRange
java.lang.Object
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.
TimePartitionRange
public TimePartitionRange(TimePartition begin,
TimePartition end)
throws LensException
- Throws:
LensException
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.