public static void filterPartitionsByUpdatePeriod(List<Partition> partitions, UpdatePeriod updatePeriod) { Iterator<Partition> iter = partitions.iterator(); while (iter.hasNext()) { Partition part = iter.next(); if (!UpdatePeriod.valueOf(part.getParameters().get(PARTITION_UPDATE_PERIOD)).equals(updatePeriod)) { iter.remove(); } } }
public static void filterPartitionsByUpdatePeriod(List<Partition> partitions, UpdatePeriod updatePeriod) { Iterator<Partition> iter = partitions.iterator(); while (iter.hasNext()) { Partition part = iter.next(); if (!UpdatePeriod.valueOf(part.getParameters().get(PARTITION_UPDATE_PERIOD)).equals(updatePeriod)) { iter.remove(); } } }
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 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()); }
/** * Truncates partitions in {@link #rangeToPartitions} such that only partitions belonging to * the passed undatePeriod are retained. * @param updatePeriod */ private void truncatePartitions(UpdatePeriod updatePeriod) { Iterator<Map.Entry<TimeRange, Set<FactPartition>>> rangeItr = rangeToPartitions.entrySet().iterator(); while (rangeItr.hasNext()) { Map.Entry<TimeRange, Set<FactPartition>> rangeEntry = rangeItr.next(); rangeEntry.getValue().removeIf(factPartition -> !factPartition.getPeriod().equals(updatePeriod)); rangeEntry.getValue().forEach(factPartition -> { factPartition.getStorageTables().remove(storageTable); factPartition.getStorageTables().add(resolvedName); }); if (rangeEntry.getValue().isEmpty()) { rangeItr.remove(); } } }
/** * Truncates partitions in {@link #rangeToPartitions} such that only partitions belonging to * the passed undatePeriod are retained. * @param updatePeriod */ private void truncatePartitions(UpdatePeriod updatePeriod) { Iterator<Map.Entry<TimeRange, Set<FactPartition>>> rangeItr = rangeToPartitions.entrySet().iterator(); while (rangeItr.hasNext()) { Map.Entry<TimeRange, Set<FactPartition>> rangeEntry = rangeItr.next(); rangeEntry.getValue().removeIf(factPartition -> !factPartition.getPeriod().equals(updatePeriod)); rangeEntry.getValue().forEach(factPartition -> { factPartition.getStorageTables().remove(storageTable); factPartition.getStorageTables().add(resolvedName); }); if (rangeEntry.getValue().isEmpty()) { rangeItr.remove(); } } }
public static Date timeAtDiff(Date date, UpdatePeriod period, int d) { Calendar cal = Calendar.getInstance(); cal.setTime(date); if (period.equals(UpdatePeriod.QUARTERLY)) { d *= 3; } cal.add(period.calendarField(), d); return cal.getTime(); }
for (Map.Entry<UpdatePeriod, CaseInsensitiveStringHashMap<PartitionTimeline>> entry : partitionTimelineCache .get(factName, storageName).entrySet()) { if (updatePeriod == null || entry.getKey().equals(updatePeriod)) { for (Map.Entry<String, PartitionTimeline> entry1 : entry.getValue().entrySet()) { if (partCol == null || partCol.equals(entry1.getKey())) {
for (Map.Entry<UpdatePeriod, CaseInsensitiveStringHashMap<PartitionTimeline>> entry : partitionTimelineCache .get(factName, storageName).entrySet()) { if (updatePeriod == null || entry.getKey().equals(updatePeriod)) { for (Map.Entry<String, PartitionTimeline> entry1 : entry.getValue().entrySet()) { if (partCol == null || partCol.equals(entry1.getKey())) {
"Part columns are different in partitions"); if (!first.getPeriod().equals(part.getPeriod())) { throw new LensException(LensCubeErrorCode.CANNOT_USE_TIMERANGE_WRITER.getLensErrorInfo(), "Partitions are in different update periods");
"Part columns are different in partitions"); if (!first.getPeriod().equals(part.getPeriod())) { throw new LensException(LensCubeErrorCode.CANNOT_USE_TIMERANGE_WRITER.getLensErrorInfo(), "Partitions are in different update periods");
} else if (partCol.equals(processTimePartCol)) { log.debug("part column is process time col"); } else if (updatePeriods.first().equals(maxInterval)) { log.debug("Update period is the least update period"); } else if ((iter.getNumIters() - iter.getCounter()) > lookAheadNumParts) {
} else if (partCol.equals(processTimePartCol)) { log.debug("part column is process time col"); } else if (updatePeriods.first().equals(maxInterval)) { log.debug("Update period is the least update period"); } else if ((iter.getNumIters() - iter.getCounter()) > lookAheadNumTimeParts) {