public abstract class AggregationScheduler extends Object implements Runnable
| Modifier and Type | Class and Description |
|---|---|
class |
AggregationScheduler.ReloaderThread |
| Modifier and Type | Field and Description |
|---|---|
static String |
AGGREGATION_SCHEDULER_TIME |
static String |
BUFFER_RECORD_NUMBER |
static String |
BUFFER_RECORD_TIME |
protected Map<String,List<Record>> |
bufferedRecords |
boolean |
changeConfiguration |
protected ScheduledFuture<?> |
futureFlush |
protected ScheduledFuture<?> |
futureReload |
static org.slf4j.Logger |
logger |
protected PersistenceExecutor |
persistenceExecutor |
static Integer |
RANDOM_INIT_START |
static long |
TIME_RELOAD_CONFIGURATION
The Max amount of time for reload a configuration Get from
configuration
|
static TimeUnit |
TIME_UNIT |
protected int |
totalBufferedRecords |
| Modifier | Constructor and Description |
|---|---|
protected |
AggregationScheduler(PersistenceExecutor persistenceExecutor,
AggregationConfig config,
String name) |
protected |
AggregationScheduler(PersistenceExecutor persistenceExecutor,
String name) |
| 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 static AggregationConfig |
CheckConfiguration(PersistenceBackendConfiguration configuration) |
protected void |
clear() |
void |
flush(PersistenceExecutor persistenceExecutor) |
static AggregatedRecord |
getAggregatedRecord(Record record) |
AggregationConfig |
getConfig() |
protected PersistenceBackendConfiguration |
getConfiguration()
Get Configuration (used from reload configuration)
|
protected static AggregatedRecord |
instantiateAggregatedRecord(Record record) |
protected abstract boolean |
isTimeToPersist(int maxRecordNumber,
long oldRecordMaxTime) |
protected void |
madeAggregation(Record record) |
static AggregationScheduler |
newInstance(PersistenceExecutor persistenceExecutor,
PersistenceBackendConfiguration configuration,
String name) |
static AggregationScheduler |
newInstance(PersistenceExecutor persistenceExecutor,
String name) |
protected void |
reallyFlush(PersistenceExecutor persistenceExecutor) |
protected void |
reloadConfiguration()
reloadConfiguration
|
void |
run() |
protected abstract void |
schedulerSpecificClear() |
void |
setConfig(AggregationConfig newConfig) |
void |
shutdown() |
public static org.slf4j.Logger logger
protected int totalBufferedRecords
protected final PersistenceExecutor persistenceExecutor
public static final TimeUnit TIME_UNIT
public static final String AGGREGATION_SCHEDULER_TIME
public static final String BUFFER_RECORD_TIME
public static final String BUFFER_RECORD_NUMBER
public static final Integer RANDOM_INIT_START
public static long TIME_RELOAD_CONFIGURATION
public boolean changeConfiguration
protected ScheduledFuture<?> futureFlush
protected ScheduledFuture<?> futureReload
protected AggregationScheduler(PersistenceExecutor persistenceExecutor, String name)
protected AggregationScheduler(PersistenceExecutor persistenceExecutor, AggregationConfig config, String name)
public static AggregationScheduler newInstance(PersistenceExecutor persistenceExecutor, String name)
public static AggregationScheduler newInstance(PersistenceExecutor persistenceExecutor, PersistenceBackendConfiguration configuration, String name) throws NumberFormatException, Exception
NumberFormatExceptionExceptionprotected 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(int maxRecordNumber,
long oldRecordMaxTime)
protected void reloadConfiguration()
Exceptionprotected PersistenceBackendConfiguration getConfiguration()
protected static AggregationConfig CheckConfiguration(PersistenceBackendConfiguration configuration) throws IOException
IOExceptionpublic AggregationConfig getConfig()
public void setConfig(AggregationConfig newConfig)
public void shutdown()
Copyright © 2016. All Rights Reserved.