@Test public void testPicksUpConfiguration() throws Exception { HourlyPartitioner underTest = new HourlyPartitioner(); underTest.setConf(configurationFor("incoming", "Europe/Amsterdam")); long time = new DateTime(2014, 2, 1, 3, 0, 0, 0, DateTimeZone.forID("Europe/Amsterdam")).getMillis(); String partition = underTest.encodePartition(null, etlKeyWithTime(time)); String path = underTest.generatePartitionedPath(null, "tpc", partition); assertEquals("tpc/incoming/2014/02/01/03", 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(1); String destSubTopicPathFormat = "'" + destPathTopicSubDir + "'/YYYY/MM/dd/HH"; init(outfilePartitionMs, destSubTopicPathFormat, Locale.US, outputTimeZone); } super.setConf(conf); }
HourlyPartitioner 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(1); String destSubTopicPathFormat = "'" + destPathTopicSubDir + "'/YYYY/MM/dd/HH"; init(outfilePartitionMs, destSubTopicPathFormat, Locale.US, outputTimeZone); } super.setConf(conf); } }
HourlyPartitioner 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(1); String destSubTopicPathFormat = "'" + destPathTopicSubDir + "'/YYYY/MM/dd/HH"; init(outfilePartitionMs, destSubTopicPathFormat, Locale.US, outputTimeZone); } super.setConf(conf); }  }
HourlyPartitioner 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(1); String destSubTopicPathFormat = "'" + destPathTopicSubDir + "'/YYYY/MM/dd/HH"; init(outfilePartitionMs, destSubTopicPathFormat, Locale.US, outputTimeZone); } super.setConf(conf); }  @Override void setConf(Configuration conf); }
HourlyPartitioner 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(1); String destSubTopicPathFormat = "'" + destPathTopicSubDir + "'/YYYY/MM/dd/HH"; init(outfilePartitionMs, destSubTopicPathFormat, Locale.US, outputTimeZone); } super.setConf(conf); }  @Override void setConf(Configuration conf);  }