@Test(expected = ProcessingException.class) public void testGetOlderRunIdsException() { int i = HdfsConstants.ageMult.length + 10; HdfsStatsService.getOlderRunId(i, System.currentTimeMillis() / 1000); }
public static long getOlderRunId(int i, long runId) { int randomizedHourInSeconds = (int) (Math.random() * 23) * 3600; if (i >= HdfsConstants.ageMult.length) { throw new ProcessingException("Can't look back in time that far " + i + ", only upto " + HdfsConstants.ageMult.length); } long newTs = runId - (HdfsConstants.ageMult[i] * HdfsConstants.NUM_SECONDS_IN_A_DAY + randomizedHourInSeconds); LOG.info(" Getting older runId for " + runId + ", returning " + newTs + " since ageMult[" + i + "]=" + HdfsConstants.ageMult[i] + " randomizedHourInSeconds=" + randomizedHourInSeconds); return newTs; }
HdfsStatsService { public static long getOlderRunId(int i, long runId) { int randomizedHourInSeconds = (int) (Math.random() * 23) * 3600; if (i >= HdfsConstants.ageMult.length) { throw new ProcessingException("Can't look back in time that far " + i + ", only upto " + HdfsConstants.ageMult.length); } long newTs = runId - (HdfsConstants.ageMult[i] * HdfsConstants.NUM_SECONDS_IN_A_DAY + randomizedHourInSeconds); LOG.info(" Getting older runId for " + runId + ", returning " + newTs + " since ageMult[" + i + "]=" + HdfsConstants.ageMult[i] + " randomizedHourInSeconds=" + randomizedHourInSeconds); return newTs; } }
HdfsStatsService { public static long getOlderRunId(int i, long runId) { int randomizedHourInSeconds = (int) (Math.random() * 23) * 3600; if (i >= HdfsConstants.ageMult.length) { throw new ProcessingException("Can't look back in time that far " + i + ", only upto " + HdfsConstants.ageMult.length); } long newTs = runId - (HdfsConstants.ageMult[i] * HdfsConstants.NUM_SECONDS_IN_A_DAY + randomizedHourInSeconds); LOG.info(" Getting older runId for " + runId + ", returning " + newTs + " since ageMult[" + i + "]=" + HdfsConstants.ageMult[i] + " randomizedHourInSeconds=" + randomizedHourInSeconds); return newTs; } HdfsStatsService(Configuration hbaseConf, Connection hbaseConnection); }
HdfsStatsService { public static long getOlderRunId(int i, long runId) { int randomizedHourInSeconds = (int) (Math.random() * 23) * 3600; if (i >= HdfsConstants.ageMult.length) { throw new ProcessingException("Can't look back in time that far " + i + ", only upto " + HdfsConstants.ageMult.length); } long newTs = runId - (HdfsConstants.ageMult[i] * HdfsConstants.NUM_SECONDS_IN_A_DAY + randomizedHourInSeconds); LOG.info(" Getting older runId for " + runId + ", returning " + newTs + " since ageMult[" + i + "]=" + HdfsConstants.ageMult[i] + " randomizedHourInSeconds=" + randomizedHourInSeconds); return newTs; } HdfsStatsService(Configuration hbaseConf, Connection hbaseConnection); static long getEncodedRunId(long now); List<HdfsStats> getAllDirs(String cluster, String pathPrefix,
      int limit, long runId); static long getOlderRunId(int i, long runId); List<HdfsStats> getHdfsTimeSeriesStats(String cluster, String path,
      int limit, long starttime, long endtime); }
HdfsStatsService { public static long getOlderRunId(int i, long runId) { int randomizedHourInSeconds = (int) (Math.random() * 23) * 3600; if (i >= HdfsConstants.ageMult.length) { throw new ProcessingException("Can't look back in time that far " + i + ", only upto " + HdfsConstants.ageMult.length); } long newTs = runId - (HdfsConstants.ageMult[i] * HdfsConstants.NUM_SECONDS_IN_A_DAY + randomizedHourInSeconds); LOG.info(" Getting older runId for " + runId + ", returning " + newTs + " since ageMult[" + i + "]=" + HdfsConstants.ageMult[i] + " randomizedHourInSeconds=" + randomizedHourInSeconds); return newTs; } HdfsStatsService(Configuration hbaseConf, Connection hbaseConnection); static long getEncodedRunId(long now); List<HdfsStats> getAllDirs(String cluster, String pathPrefix,
      int limit, long runId); static long getOlderRunId(int i, long runId); List<HdfsStats> getHdfsTimeSeriesStats(String cluster, String path,
      int limit, long starttime, long endtime);  }