@Test(groups = "fast") public void testInterval() { final GranularityPathMapper prefix = new GranularityPathMapper(PREFIX, Granularity.DAILY); final Collection<String> paths = prefix.getPathsForInterval(new MutableInterval(new DateTime("2010-10-01").getMillis(), new DateTime("2010-10-04").getMillis())); final Object[] pathsArray = paths.toArray(); Assert.assertEquals(pathsArray.length, 3); Assert.assertEquals((String) pathsArray[0], String.format("%s/2010/10/01", PREFIX)); Assert.assertEquals((String) pathsArray[1], String.format("%s/2010/10/02", PREFIX)); Assert.assertEquals((String) pathsArray[2], String.format("%s/2010/10/03", PREFIX)); }
public Collection<String> getPathsForInterval(final ReadableInterval interval) { final Collection<String> paths = new ArrayList<String>(); granularity.stepThroughInterval(interval, new Granularity.Callback<RuntimeException>() { public void step(final ReadableInterval stepInterval) throws RuntimeException { paths.add(getPathForDateTime(stepInterval.getStart())); } }); return paths; }
GranularityPathMapper implements Serializable { public Collection<String> getPathsForInterval(final ReadableInterval interval) { final Collection<String> paths = new ArrayList<String>(); granularity.stepThroughInterval(interval, new Granularity.Callback<RuntimeException>() { public void step(final ReadableInterval stepInterval) throws RuntimeException { paths.add(getPathForDateTime(stepInterval.getStart())); } }); return paths; } }
GranularityPathMapper implements Serializable { public Collection<String> getPathsForInterval(final ReadableInterval interval) { final Collection<String> paths = new ArrayList<String>(); granularity.stepThroughInterval(interval, new Granularity.Callback<RuntimeException>() { public void step(final ReadableInterval stepInterval) throws RuntimeException { paths.add(getPathForDateTime(stepInterval.getStart())); } }); return paths; } GranularityPathMapper(final String prefix, final Granularity granularity); }
GranularityPathMapper implements Serializable { public Collection<String> getPathsForInterval(final ReadableInterval interval) { final Collection<String> paths = new ArrayList<String>(); granularity.stepThroughInterval(interval, new Granularity.Callback<RuntimeException>() { public void step(final ReadableInterval stepInterval) throws RuntimeException { paths.add(getPathForDateTime(stepInterval.getStart())); } }); return paths; } GranularityPathMapper(final String prefix, final Granularity granularity); String getPrefix(); String getRootPath(); Granularity getGranularity(); Collection<String> getPathsForInterval(final ReadableInterval interval); String getPathForDateTime(final ReadableDateTime dateTime); }
GranularityPathMapper implements Serializable { public Collection<String> getPathsForInterval(final ReadableInterval interval) { final Collection<String> paths = new ArrayList<String>(); granularity.stepThroughInterval(interval, new Granularity.Callback<RuntimeException>() { public void step(final ReadableInterval stepInterval) throws RuntimeException { paths.add(getPathForDateTime(stepInterval.getStart())); } }); return paths; } GranularityPathMapper(final String prefix, final Granularity granularity); String getPrefix(); String getRootPath(); Granularity getGranularity(); Collection<String> getPathsForInterval(final ReadableInterval interval); String getPathForDateTime(final ReadableDateTime dateTime);  }