public abstract class BufferStrategy extends Object
BufferedReader
closes an open sliding buffer.Modifier and Type | Field and Description |
---|---|
static long |
CLOSE_BUFFER_MARGIN_MILLIS |
Constructor and Description |
---|
BufferStrategy() |
Modifier and Type | Method and Description |
---|---|
static BufferStrategy |
and(BufferStrategy... strategies)
Closes buffers if all of the supplied strategies request it.
|
static BufferStrategy |
hourlyScheduleInMinutes(int... minutesPastHour)
Closes buffers at fixed minutes past each hour (for example: 0, 15, 30, and 45 minutes past each hour).
|
static BufferStrategy |
hourlyScheduleInMinutes(String fieldName,
int... minutesPastHour)
Closes buffers at fixed minutes past each hour for the specified datetime field (for example: 0, 15, 30, and 45 minutes past each hour).
|
boolean |
isPollingRequired()
Indicates if the
shouldClose(RecordBuffer, BufferedReader, Record) method should be called every second for
open buffers -- even if no new data is present -- to release any data that may have been collected (passing in a null record). |
static BufferStrategy |
limitedRecords(long count)
Closes the buffer after the specified amount of records have been collected.
|
static BufferStrategy |
limitedTime(String fieldName,
long milliseconds)
Closes buffers after the specified datetime field has increased by a set amount of time since it was first seen.
|
static BufferStrategy |
limitedTimeFromLastUpdate(long milliseconds)
Closes buffers after the specified time has elapsed since the last record was added.
|
static BufferStrategy |
limitedTimeFromLastUpdateOrLimitedRecords(long milliseconds,
long recordCount)
Closes buffers after the specified time has elapsed since the last record was added or the specified amount of records have been collected.
|
static BufferStrategy |
limitedTimeFromOpen(long milliseconds)
Closes buffers after they've been open for the specified time.
|
static BufferStrategy |
limitedTimeFromOpenOrLimitedRecords(long milliseconds,
long recordCount)
Closes buffers after they've been open for the specified time or the specified amount of records have been collected.
|
static BufferStrategy |
or(BufferStrategy... strategies)
Closes buffers if any of the supplied strategies request it.
|
static BufferStrategy |
scheduled(Scheduler scheduler)
Closes buffers on a set clock schedule.
|
static BufferStrategy |
scheduled(String fieldName,
Scheduler scheduler)
Closes buffers on a set clock schedule for the specified datetime field.
|
abstract boolean |
shouldClose(RecordBuffer buffer,
BufferedReader bufferedReader,
Record record)
Indicates if the open buffer should be closed after adding the record.
|
public static final long CLOSE_BUFFER_MARGIN_MILLIS
public abstract boolean shouldClose(RecordBuffer buffer, BufferedReader bufferedReader, Record record)
public boolean isPollingRequired()
shouldClose(RecordBuffer, BufferedReader, Record)
method should be called every second for
open buffers -- even if no new data is present -- to release any data that may have been collected (passing in a null
record).public static BufferStrategy limitedTimeFromOpen(long milliseconds)
public static BufferStrategy limitedTimeFromLastUpdate(long milliseconds)
public static BufferStrategy limitedTime(String fieldName, long milliseconds)
fieldName
- the datetime field to testmilliseconds
- the amount of time the field should increase before closing the bufferpublic static BufferStrategy limitedRecords(long count)
public static BufferStrategy scheduled(Scheduler scheduler)
PeriodicScheduler
,
HourlyScheduler
public static BufferStrategy scheduled(String fieldName, Scheduler scheduler)
fieldName
- the datetime field to testscheduler
- the scheduler to usePeriodicScheduler
,
HourlyScheduler
public static BufferStrategy hourlyScheduleInMinutes(int... minutesPastHour)
public static BufferStrategy hourlyScheduleInMinutes(String fieldName, int... minutesPastHour)
fieldName
- the datetime field to testminutesPastHour
- public static BufferStrategy or(BufferStrategy... strategies)
public static BufferStrategy and(BufferStrategy... strategies)
public static BufferStrategy limitedTimeFromOpenOrLimitedRecords(long milliseconds, long recordCount)
public static BufferStrategy limitedTimeFromLastUpdateOrLimitedRecords(long milliseconds, long recordCount)
Copyright (c) 2006-2024 North Concepts Inc. All Rights Reserved.