@Test public void testDefaultConfiguration() throws Exception { TimeBasedPartitioner underTest = new TimeBasedPartitioner(); underTest.setConf(configurationFor(null, null, null, null)); long time = new DateTime(2014, 2, 1, 3, 0, 0, 0, DateTimeZone.forID("America/Los_Angeles")).getMillis(); String partition = underTest.encodePartition(null, etlKeyWithTime(time)); String path = underTest.generatePartitionedPath(null, "tpc", partition); assertEquals("tpc/hourly/2014/02/01/03", path); }
@Override public void setConf(Configuration conf) { if (conf != null) { String destPathTopicSubDirFormat = conf.get(ETL_DESTINATION_PATH_TOPIC_SUBDIRFORMAT, DEFAULT_TOPIC_SUB_DIR_FORMAT); long partitionDurationMinutes = Long.parseLong(conf.get(ETL_OUTPUT_FILE_TIME_PARTITION_MINS, DEFAULT_PARTITION_DURATION_MINUTES)); Locale locale = LocaleUtils.toLocale(conf.get(ETL_DESTINATION_PATH_TOPIC_SUBDIRFORMAT_LOCALE, DEFAULT_LOCALE)); DateTimeZone outputTimeZone = DateTimeZone.forID(conf.get(ETL_DEFAULT_TIMEZONE, DEFAULT_TIME_ZONE)); long outfilePartitionMs = TimeUnit.MINUTES.toMillis(partitionDurationMinutes); init(outfilePartitionMs, destPathTopicSubDirFormat, locale, outputTimeZone); } super.setConf(conf); }
TimeBasedPartitioner extends BaseTimeBasedPartitioner { @Override public void setConf(Configuration conf) { if (conf != null) { String destPathTopicSubDirFormat = conf.get(ETL_DESTINATION_PATH_TOPIC_SUBDIRFORMAT, DEFAULT_TOPIC_SUB_DIR_FORMAT); long partitionDurationMinutes = Long.parseLong(conf.get(ETL_OUTPUT_FILE_TIME_PARTITION_MINS, DEFAULT_PARTITION_DURATION_MINUTES)); Locale locale = LocaleUtils.toLocale(conf.get(ETL_DESTINATION_PATH_TOPIC_SUBDIRFORMAT_LOCALE, DEFAULT_LOCALE)); DateTimeZone outputTimeZone = DateTimeZone.forID(conf.get(ETL_DEFAULT_TIMEZONE, DEFAULT_TIME_ZONE)); long outfilePartitionMs = TimeUnit.MINUTES.toMillis(partitionDurationMinutes); init(outfilePartitionMs, destPathTopicSubDirFormat, locale, outputTimeZone); } super.setConf(conf); } }
TimeBasedPartitioner extends BaseTimeBasedPartitioner { @Override public void setConf(Configuration conf) { if (conf != null) { String destPathTopicSubDirFormat = conf.get(ETL_DESTINATION_PATH_TOPIC_SUBDIRFORMAT, DEFAULT_TOPIC_SUB_DIR_FORMAT); long partitionDurationMinutes = Long.parseLong(conf.get(ETL_OUTPUT_FILE_TIME_PARTITION_MINS, DEFAULT_PARTITION_DURATION_MINUTES)); Locale locale = LocaleUtils.toLocale(conf.get(ETL_DESTINATION_PATH_TOPIC_SUBDIRFORMAT_LOCALE, DEFAULT_LOCALE)); DateTimeZone outputTimeZone = DateTimeZone.forID(conf.get(ETL_DEFAULT_TIMEZONE, DEFAULT_TIME_ZONE)); long outfilePartitionMs = TimeUnit.MINUTES.toMillis(partitionDurationMinutes); init(outfilePartitionMs, destPathTopicSubDirFormat, locale, outputTimeZone); } super.setConf(conf); }  }
TimeBasedPartitioner extends BaseTimeBasedPartitioner { @Override public void setConf(Configuration conf) { if (conf != null) { String destPathTopicSubDirFormat = conf.get(ETL_DESTINATION_PATH_TOPIC_SUBDIRFORMAT, DEFAULT_TOPIC_SUB_DIR_FORMAT); long partitionDurationMinutes = Long.parseLong(conf.get(ETL_OUTPUT_FILE_TIME_PARTITION_MINS, DEFAULT_PARTITION_DURATION_MINUTES)); Locale locale = LocaleUtils.toLocale(conf.get(ETL_DESTINATION_PATH_TOPIC_SUBDIRFORMAT_LOCALE, DEFAULT_LOCALE)); DateTimeZone outputTimeZone = DateTimeZone.forID(conf.get(ETL_DEFAULT_TIMEZONE, DEFAULT_TIME_ZONE)); long outfilePartitionMs = TimeUnit.MINUTES.toMillis(partitionDurationMinutes); init(outfilePartitionMs, destPathTopicSubDirFormat, locale, outputTimeZone); } super.setConf(conf); }  @Override void setConf(Configuration conf); }
TimeBasedPartitioner extends BaseTimeBasedPartitioner { @Override public void setConf(Configuration conf) { if (conf != null) { String destPathTopicSubDirFormat = conf.get(ETL_DESTINATION_PATH_TOPIC_SUBDIRFORMAT, DEFAULT_TOPIC_SUB_DIR_FORMAT); long partitionDurationMinutes = Long.parseLong(conf.get(ETL_OUTPUT_FILE_TIME_PARTITION_MINS, DEFAULT_PARTITION_DURATION_MINUTES)); Locale locale = LocaleUtils.toLocale(conf.get(ETL_DESTINATION_PATH_TOPIC_SUBDIRFORMAT_LOCALE, DEFAULT_LOCALE)); DateTimeZone outputTimeZone = DateTimeZone.forID(conf.get(ETL_DEFAULT_TIMEZONE, DEFAULT_TIME_ZONE)); long outfilePartitionMs = TimeUnit.MINUTES.toMillis(partitionDurationMinutes); init(outfilePartitionMs, destPathTopicSubDirFormat, locale, outputTimeZone); } super.setConf(conf); }  @Override void setConf(Configuration conf);  }