@Test public void testDefaultConfiguration() throws Exception { DailyPartitioner underTest = new DailyPartitioner(); underTest.setConf(configurationFor(null, null)); long time = new DateTime(2014, 2, 1, 1, 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/daily/2014/02/01", path); }
@Override public void setConf(Configuration conf) { if (conf != null) { String destPathTopicSubDir = conf.get(ETL_DESTINATION_PATH_TOPIC_SUBDIRECTORY, DEFAULT_TOPIC_SUB_DIR); DateTimeZone outputTimeZone = DateTimeZone.forID(conf.get(ETL_DEFAULT_TIMEZONE, DEFAULT_TIME_ZONE)); long outfilePartitionMs = TimeUnit.HOURS.toMillis(24); String destSubTopicPathFormat = "'" + destPathTopicSubDir + "'/YYYY/MM/dd"; init(outfilePartitionMs, destSubTopicPathFormat, Locale.US, outputTimeZone); } super.setConf(conf); }
DailyPartitioner extends BaseTimeBasedPartitioner { @Override public void setConf(Configuration conf) { if (conf != null) { String destPathTopicSubDir = conf.get(ETL_DESTINATION_PATH_TOPIC_SUBDIRECTORY, DEFAULT_TOPIC_SUB_DIR); DateTimeZone outputTimeZone = DateTimeZone.forID(conf.get(ETL_DEFAULT_TIMEZONE, DEFAULT_TIME_ZONE)); long outfilePartitionMs = TimeUnit.HOURS.toMillis(24); String destSubTopicPathFormat = "'" + destPathTopicSubDir + "'/YYYY/MM/dd"; init(outfilePartitionMs, destSubTopicPathFormat, Locale.US, outputTimeZone); } super.setConf(conf); } }
DailyPartitioner extends BaseTimeBasedPartitioner { @Override public void setConf(Configuration conf) { if (conf != null) { String destPathTopicSubDir = conf.get(ETL_DESTINATION_PATH_TOPIC_SUBDIRECTORY, DEFAULT_TOPIC_SUB_DIR); DateTimeZone outputTimeZone = DateTimeZone.forID(conf.get(ETL_DEFAULT_TIMEZONE, DEFAULT_TIME_ZONE)); long outfilePartitionMs = TimeUnit.HOURS.toMillis(24); String destSubTopicPathFormat = "'" + destPathTopicSubDir + "'/YYYY/MM/dd"; init(outfilePartitionMs, destSubTopicPathFormat, Locale.US, outputTimeZone); } super.setConf(conf); }  }
DailyPartitioner extends BaseTimeBasedPartitioner { @Override public void setConf(Configuration conf) { if (conf != null) { String destPathTopicSubDir = conf.get(ETL_DESTINATION_PATH_TOPIC_SUBDIRECTORY, DEFAULT_TOPIC_SUB_DIR); DateTimeZone outputTimeZone = DateTimeZone.forID(conf.get(ETL_DEFAULT_TIMEZONE, DEFAULT_TIME_ZONE)); long outfilePartitionMs = TimeUnit.HOURS.toMillis(24); String destSubTopicPathFormat = "'" + destPathTopicSubDir + "'/YYYY/MM/dd"; init(outfilePartitionMs, destSubTopicPathFormat, Locale.US, outputTimeZone); } super.setConf(conf); }  @Override void setConf(Configuration conf); }
DailyPartitioner extends BaseTimeBasedPartitioner { @Override public void setConf(Configuration conf) { if (conf != null) { String destPathTopicSubDir = conf.get(ETL_DESTINATION_PATH_TOPIC_SUBDIRECTORY, DEFAULT_TOPIC_SUB_DIR); DateTimeZone outputTimeZone = DateTimeZone.forID(conf.get(ETL_DEFAULT_TIMEZONE, DEFAULT_TIME_ZONE)); long outfilePartitionMs = TimeUnit.HOURS.toMillis(24); String destSubTopicPathFormat = "'" + destPathTopicSubDir + "'/YYYY/MM/dd"; init(outfilePartitionMs, destSubTopicPathFormat, Locale.US, outputTimeZone); } super.setConf(conf); }  @Override void setConf(Configuration conf);  }