public abstract class AggregationScheduler extends Object implements Runnable
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,List<Record>> |
bufferedRecords |
static int |
DELAY |
static int |
INITIAL_DELAY |
static org.slf4j.Logger |
logger |
protected PersistenceExecutor |
persistenceExecutor |
protected ScheduledExecutorService |
scheduler |
static TimeUnit |
TIME_UNIT |
protected int |
totalBufferedRecords |
| Modifier | Constructor and Description |
|---|---|
protected |
AggregationScheduler(PersistenceExecutor persistenceExecutor) |
| Modifier and Type | Method and Description |
|---|---|
void |
aggregate(Record record,
PersistenceExecutor persistenceExecutor)
Get an usage records and try to aggregate with other buffered
Usage Record.
|
protected void |
aggregate(Record record,
PersistenceExecutor persistenceExecutor,
boolean forceFlush) |
protected void |
clear() |
void |
flush(PersistenceExecutor persistenceExecutor) |
static AggregatedRecord |
getAggregatedRecord(Record record) |
protected static AggregatedRecord |
instantiateAggregatedRecord(Record record) |
protected abstract boolean |
isTimeToPersist() |
protected void |
madeAggregation(Record record) |
static AggregationScheduler |
newInstance(PersistenceExecutor persistenceExecutor) |
protected void |
reallyFlush(PersistenceExecutor persistenceExecutor) |
void |
run() |
protected abstract void |
schedulerSpecificClear() |
public static org.slf4j.Logger logger
protected int totalBufferedRecords
protected final PersistenceExecutor persistenceExecutor
protected final ScheduledExecutorService scheduler
public static final int INITIAL_DELAY
public static final int DELAY
public static final TimeUnit TIME_UNIT
protected AggregationScheduler(PersistenceExecutor persistenceExecutor)
public static AggregationScheduler newInstance(PersistenceExecutor persistenceExecutor)
protected static AggregatedRecord instantiateAggregatedRecord(Record record) throws Exception
Exceptionpublic static AggregatedRecord getAggregatedRecord(Record record) throws Exception
Exceptionprotected void madeAggregation(Record record)
public void flush(PersistenceExecutor persistenceExecutor) throws Exception
Exceptionprotected abstract void schedulerSpecificClear()
protected void clear()
protected void aggregate(Record record, PersistenceExecutor persistenceExecutor, boolean forceFlush) throws Exception
Exceptionprotected void reallyFlush(PersistenceExecutor persistenceExecutor) throws Exception
Exceptionpublic void aggregate(Record record, PersistenceExecutor persistenceExecutor) throws Exception
singleRecord - the Usage Record To BufferException - if failsprotected abstract boolean isTimeToPersist()
Copyright © 2016. All Rights Reserved.