@Test public void shouldBaseSegmentIntervalOnRetentionAndNumSegments() throws Exception { final Segments segments = new Segments("test", 8 * 60 * 1000, 5); assertEquals(0, segments.segmentId(0)); assertEquals(0, segments.segmentId(60000)); assertEquals(1, segments.segmentId(120000)); }
long segmentId(long timestamp) { return timestamp / segmentInterval; }
Segments { long segmentId(long timestamp) { return timestamp / segmentInterval; } }
Segments { long segmentId(long timestamp) { return timestamp / segmentInterval; } Segments(final String name, final long retentionPeriod, final int numSegments); }
Segments { long segmentId(long timestamp) { return timestamp / segmentInterval; } Segments(final String name, final long retentionPeriod, final int numSegments); void close(); }
Segments { long segmentId(long timestamp) { return timestamp / segmentInterval; } Segments(final String name, final long retentionPeriod, final int numSegments); void close();  }