public FactPartition(String partCol, TimePartition timePartition, FactPartition containingPart, Set<String> storageTables) { this(partCol, timePartition.getDate(), timePartition.getUpdatePeriod(), containingPart, null, storageTables); }
public FactPartition(String partCol, TimePartition timePartition, FactPartition containingPart, Set<String> storageTables) { this(partCol, timePartition.getDate(), timePartition.getUpdatePeriod(), containingPart, null, storageTables); }
public TimePartitionRange(TimePartition begin, TimePartition end) throws LensException { if (end.before(begin)) { throw new LensException("condition of creation of timepartition failed: end>=begin"); } if (end.getUpdatePeriod() != begin.getUpdatePeriod()) { throw new LensException("update periods are not same"); } this.begin = begin; this.end = end; }
public TimePartition partitionAtDiff(int increment) { Calendar cal = Calendar.getInstance(); cal.setTime(date); if (getUpdatePeriod().equals(UpdatePeriod.QUARTERLY)) { increment *= 3; } cal.add(updatePeriod.calendarField(), increment); return new TimePartition(updatePeriod, cal.getTime()); }
public TimePartitionRange(TimePartition begin, TimePartition end) throws LensException { if (end.before(begin)) { throw new LensException("condition of creation of timepartition failed: end>=begin"); } if (end.getUpdatePeriod() != begin.getUpdatePeriod()) { throw new LensException("update periods are not same"); } this.begin = begin; this.end = end; }
public TimePartition partitionAtDiff(int increment) { Calendar cal = Calendar.getInstance(); cal.setTime(date); if (getUpdatePeriod().equals(UpdatePeriod.QUARTERLY)) { increment *= 3; } cal.add(updatePeriod.calendarField(), increment); return new TimePartition(updatePeriod, cal.getTime()); }
private TimePartition getNextPartition(TimePartition begin, TimePartition end, int increment) throws LensException { for (Date date : TimeRange.iterable(begin.partitionAtDiff(increment).getDate(), end.partitionAtDiff(increment).getDate(), begin.getUpdatePeriod(), increment)) { TimePartition value = TimePartition.of(begin.getUpdatePeriod(), date); if (!holes.contains(value)) { return value; } else { holes.remove(value); } } return null; }
private TimePartition getNextPartition(TimePartition begin, TimePartition end, int increment) throws LensException { for (Date date : TimeRange.iterable(begin.partitionAtDiff(increment).getDate(), end.partitionAtDiff(increment).getDate(), begin.getUpdatePeriod(), increment)) { TimePartition value = TimePartition.of(begin.getUpdatePeriod(), date); if (!holes.contains(value)) { return value; } else { holes.remove(value); } } return null; }
@Override public boolean add(@NonNull TimePartition partition) throws LensException { if (isEmpty()) { // First partition being added first = partition; latest = partition; return true; } if (partition.before(first)) { addHolesBetween(partition, first, partition.getUpdatePeriod()); first = partition; return true; } else if (partition.after(latest)) { addHolesBetween(latest, partition, partition.getUpdatePeriod()); latest = partition; return true; } else { return holes.remove(partition); } }
@Override public boolean add(@NonNull TimePartition partition) throws LensException { if (isEmpty()) { // First partition being added first = partition; latest = partition; return true; } if (partition.before(first)) { addHolesBetween(partition, first, partition.getUpdatePeriod()); first = partition; return true; } else if (partition.after(latest)) { addHolesBetween(latest, partition, partition.getUpdatePeriod()); latest = partition; return true; } else { return holes.remove(partition); } }
public long size() { return DateUtil.getTimeDiff(begin.getDate(), end.getDate(), begin.getUpdatePeriod()); }
public long size() { return DateUtil.getTimeDiff(begin.getDate(), end.getDate(), begin.getUpdatePeriod()); }