PcapJob implements Statusable<Path> { public static long findWidth(long start, long end, int numReducers) { return Long.divideUnsigned(end - start, numReducers) + 1; } PcapJob(); void setStatusInterval(long interval); void setCompleteCheckInterval(long interval); @Override Statusable<Path> submit(Finalizer<Path> finalizer, Map<String, Object> config); Statusable<Path> query(Optional<String> jobName,
      Path basePath,
      Path baseInterimResultPath,
      long beginNS,
      long endNS,
      int numReducers,
      T fields,
      Configuration conf,
      FileSystem fs,
      PcapFilterConfigurator<T> filterImpl); void setTimer(Timer timer); Job createJob(Optional<String> jobName
                      ,Path basePath
                      , Path jobOutputPath
                      , long beginNS
                      , long endNS
                      , int numReducers
                      , T fields
                      , Configuration conf
                      , FileSystem fs
                      , PcapFilterConfigurator<T> filterImpl
                      ); static long findWidth(long start, long end, int numReducers); @Override JobType getJobType(); @Override synchronized JobStatus getStatus(); @Override Pageable<Path> get(); @Override boolean isDone(); @Override void kill(); @Override boolean validate(Map<String, Object> configuration); @Override Map<String, Object> getConfiguration(); static final String START_TS_CONF; static final String END_TS_CONF; static final String WIDTH_CONF; }
@Test public void partition_gives_value_in_range() { long start = 1473897600000000000L; long end = TimestampConverters.MILLISECONDS.toNanoseconds(1473995927455L); Configuration conf = new Configuration(); conf.set(PcapJob.START_TS_CONF, toUnsignedString(start)); conf.set(PcapJob.END_TS_CONF, toUnsignedString(end)); conf.set(PcapJob.WIDTH_CONF, "" + PcapJob.findWidth(start, end, 10)); PcapJob.PcapPartitioner partitioner = new PcapJob.PcapPartitioner(); partitioner.setConf(conf); assertThat("Partition not in range", partitioner.getPartition(new LongWritable(1473978789181189000L), new BytesWritable(), 10), equalTo(8)); }