Lines Matching refs:rotate
90 final FileRotator rotate = new FileRotator(
97 rotate.combineActive(reader, writer("foo"), currentTime);
99 assertReadAll(rotate, "foo");
105 rotate.combineActive(reader, writer("bar"), currentTime);
107 assertReadAll(rotate, "bar");
111 final FileRotator rotate = new FileRotator(
118 rotate.combineActive(reader, writer("foo"), currentTime);
120 assertReadAll(rotate, "foo");
122 // push time a few minutes forward; shouldn't rotate file
125 rotate.combineActive(reader, writer("bar"), currentTime);
127 assertReadAll(rotate, "bar");
129 // push time forward enough to rotate file; should still have same data
131 rotate.maybeRotate(currentTime);
132 assertReadAll(rotate, "bar");
137 rotate.combineActive(reader, writer("baz"), currentTime);
139 assertReadAll(rotate, "bar", "baz");
143 final FileRotator rotate = new FileRotator(
150 rotate.combineActive(reader, writer("foo"), currentTime);
153 rotate.maybeRotate(currentTime);
157 rotate.combineActive(reader, writer("bar"), currentTime);
159 assertReadAll(rotate, "foo", "bar");
163 rotate.maybeRotate(currentTime);
164 assertReadAll(rotate, "bar");
168 rotate.maybeRotate(currentTime);
169 assertReadAll(rotate);
173 final FileRotator rotate = new FileRotator(
180 rotate.combineActive(reader, writer("foo"), currentTime);
182 assertReadAll(rotate, "foo");
187 rotate.combineActive(reader, new Writer() {
202 assertReadAll(rotate, "foo");
206 final FileRotator rotate = new FileRotator(
212 assertReadAll(rotate);
221 assertReadAll(rotate);
225 assertReadAll(rotate, "meow");
234 final FileRotator rotate = new FileRotator(
240 // rotate a bunch of historical data
241 rotate.maybeRotate(currentTime);
242 rotate.combineActive(reader, writer(RED), currentTime);
245 rotate.maybeRotate(currentTime);
246 rotate.combineActive(reader, writer(GREEN), currentTime);
249 rotate.maybeRotate(currentTime);
250 rotate.combineActive(reader, writer(BLUE), currentTime);
253 rotate.maybeRotate(currentTime);
254 rotate.combineActive(reader, writer(YELLOW), currentTime);
258 assertReadAll(rotate, FULL_SET);
259 assertReadMatching(rotate, Long.MIN_VALUE, Long.MAX_VALUE, FULL_SET);
260 assertReadMatching(rotate, Long.MIN_VALUE, currentTime, FULL_SET);
261 assertReadMatching(rotate, TEST_TIME + SECOND_IN_MILLIS, currentTime, FULL_SET);
264 assertReadMatching(rotate, TEST_TIME + SECOND_IN_MILLIS, currentTime - SECOND_IN_MILLIS,
268 assertReadMatching(rotate, TEST_TIME + DAY_IN_MILLIS, Long.MAX_VALUE, FULL_SET);
269 assertReadMatching(rotate, TEST_TIME + DAY_IN_MILLIS + SECOND_IN_MILLIS, Long.MAX_VALUE,
275 assertReadMatching(rotate, blueStart + SECOND_IN_MILLIS, blueEnd - SECOND_IN_MILLIS, BLUE);
278 assertReadMatching(rotate, Long.MIN_VALUE, TEST_TIME - DAY_IN_MILLIS);
282 final FileRotator rotate = new FileRotator(
290 rotate.combineActive(reader, writer("foo"), currentTime);
292 assertReadAll(rotate, "foo");
298 rotate.combineActive(reader, writer("bar"), currentTime);
300 assertReadAll(rotate, "bar", "foo");
306 rotate.combineActive(reader, writer("baz"), currentTime);
308 assertReadAll(rotate, "baz", "foo");
314 rotate.combineActive(reader, writer("meow"), currentTime);
316 assertReadAll(rotate, "meow", "foo");
318 // current time should trigger rotate of older active file
319 rotate.maybeRotate(currentTime);
324 rotate.combineActive(reader, writer("yay"), currentTime);
326 assertReadAll(rotate, "meow", "yay");
331 final FileRotator rotate = new FileRotator(
343 rotate.combineActive(reader, writer("meow"), currentTime);
346 rotate.maybeRotate(currentTime);
350 rotate.maybeRotate(currentTime);
362 final FileRotator rotate = new FileRotator(
367 assertReadAll(rotate, "bar");
392 private static void assertReadAll(FileRotator rotate, String... expected) throws IOException {
393 assertReadMatching(rotate, Long.MIN_VALUE, Long.MAX_VALUE, expected);
397 FileRotator rotate, long matchStartMillis, long matchEndMillis, String... expected)
400 rotate.readMatching(reader, matchStartMillis, matchEndMillis);