@Test public void testIntTimeExtract() { TimeBasedPartitioner<String> partitioner = configurePartitioner( new TimeBasedPartitioner<>(), "int", null); String path = getPartitionedPath(partitioner); long timeGranularityMs = (long) partitioner.config.get(PartitionerConfig.PARTITION_DURATION_MS_CONFIG); long partitionMs = TimeBasedPartitioner.getPartition(timeGranularityMs, 12L, DATE_TIME_ZONE); DateTime dt = new DateTime(partitionMs, DATE_TIME_ZONE); validatePathFromDateTime(path, dt, TOPIC); }
public static long getPartition(long timeGranularityMs, long timestamp, DateTimeZone timeZone) { long adjustedTimestamp = timeZone.convertUTCToLocal(timestamp); long partitionedTime = (adjustedTimestamp / timeGranularityMs) * timeGranularityMs; return timeZone.convertLocalToUTC(partitionedTime, false); }
TimeBasedPartitioner extends DefaultPartitioner<T> { public static long getPartition(long timeGranularityMs, long timestamp, DateTimeZone timeZone) { long adjustedTimestamp = timeZone.convertUTCToLocal(timestamp); long partitionedTime = (adjustedTimestamp / timeGranularityMs) * timeGranularityMs; return timeZone.convertLocalToUTC(partitionedTime, false); } }
TimeBasedPartitioner extends DefaultPartitioner<T> { public static long getPartition(long timeGranularityMs, long timestamp, DateTimeZone timeZone) { long adjustedTimestamp = timeZone.convertUTCToLocal(timestamp); long partitionedTime = (adjustedTimestamp / timeGranularityMs) * timeGranularityMs; return timeZone.convertLocalToUTC(partitionedTime, false); }  }
TimeBasedPartitioner extends DefaultPartitioner<T> { public static long getPartition(long timeGranularityMs, long timestamp, DateTimeZone timeZone) { long adjustedTimestamp = timeZone.convertUTCToLocal(timestamp); long partitionedTime = (adjustedTimestamp / timeGranularityMs) * timeGranularityMs; return timeZone.convertLocalToUTC(partitionedTime, false); }  static long getPartition(long timeGranularityMs, long timestamp, DateTimeZone timeZone); long getPartitionDurationMs(); String getPathFormat(); TimestampExtractor getTimestampExtractor(); @Override void configure(Map<String, Object> config); @Override String encodePartition(SinkRecord sinkRecord, long nowInMillis); @Override String encodePartition(SinkRecord sinkRecord); @Override List<T> partitionFields(); TimestampExtractor newTimestampExtractor(String extractorClassName); }
TimeBasedPartitioner extends DefaultPartitioner<T> { public static long getPartition(long timeGranularityMs, long timestamp, DateTimeZone timeZone) { long adjustedTimestamp = timeZone.convertUTCToLocal(timestamp); long partitionedTime = (adjustedTimestamp / timeGranularityMs) * timeGranularityMs; return timeZone.convertLocalToUTC(partitionedTime, false); }  static long getPartition(long timeGranularityMs, long timestamp, DateTimeZone timeZone); long getPartitionDurationMs(); String getPathFormat(); TimestampExtractor getTimestampExtractor(); @Override void configure(Map<String, Object> config); @Override String encodePartition(SinkRecord sinkRecord, long nowInMillis); @Override String encodePartition(SinkRecord sinkRecord); @Override List<T> partitionFields(); TimestampExtractor newTimestampExtractor(String extractorClassName);  }