public abstract class AggregationScheduler extends Object implements Runnable
| Modifier and Type | Class and Description |
|---|---|
class |
AggregationScheduler.ReloaderThread |
| Modifier and Type | Field and Description |
|---|---|
static File |
AGGREGATION_PROPERTIES_FILE |
static String |
AGGREGATION_SCHEDULER_TIME |
static String |
BUFFER_RECORD_NUMBER |
static String |
BUFFER_RECORD_TIME |
protected Map<String,List<Record>> |
bufferedRecords |
boolean |
changeConfiguration |
static String |
CONFIG_DIRECTORY_NAME |
static String |
FILE_NAME |
protected ScheduledFuture<?> |
futureFlush |
protected ScheduledFuture<?> |
futureReload |
static org.slf4j.Logger |
logger |
protected PersistenceExecutor |
persistenceExecutor |
static int |
RANDOM_INIT_START |
static long |
TIME_RELOAD_CONFIGURATION
The Max amount of time for reload a configuration Get from configuration
|
protected int |
totalBufferedRecords |
| Modifier | Constructor and Description |
|---|---|
protected |
AggregationScheduler(PersistenceExecutor persistenceExecutor) |
protected |
AggregationScheduler(PersistenceExecutor persistenceExecutor,
AggregationConfiguration config) |
| Modifier and Type | Method and Description |
|---|---|
void |
aggregate(Record record,
PersistenceExecutor persistenceExecutor)
Get a record and try to aggregate with other buffered Records.
|
protected void |
aggregate(Record record,
PersistenceExecutor persistenceExecutor,
boolean forceFlush) |
protected static AggregationConfiguration |
CheckConfiguration(PersistenceBackendConfiguration configuration) |
protected void |
clear() |
void |
flush(PersistenceExecutor persistenceExecutor) |
static AggregatedRecord |
getAggregatedRecord(Record record) |
AggregationConfiguration |
getConfig() |
protected PersistenceBackendConfiguration |
getConfiguration()
Get Configuration (used from reload configuration)
|
static Properties |
getPropertiesFromFile() |
protected static AggregatedRecord |
instantiateAggregatedRecord(Record record) |
protected abstract boolean |
isTimeToPersist(int maxRecordNumber,
long oldRecordMaxTime) |
protected void |
madeAggregation(Record record) |
static AggregationScheduler |
newInstance(PersistenceExecutor persistenceExecutor) |
static AggregationScheduler |
newInstance(PersistenceExecutor persistenceExecutor,
PersistenceBackendConfiguration configuration) |
protected void |
reallyFlush(PersistenceExecutor persistenceExecutor) |
protected void |
reloadConfiguration()
reloadConfiguration
|
void |
run() |
protected abstract void |
schedulerSpecificClear() |
void |
setConfig(AggregationConfiguration newConfig) |
void |
shutdown() |
public static final org.slf4j.Logger logger
public static final String AGGREGATION_SCHEDULER_TIME
public static final String BUFFER_RECORD_TIME
public static final String BUFFER_RECORD_NUMBER
public static final int RANDOM_INIT_START
public static final long TIME_RELOAD_CONFIGURATION
public static final String CONFIG_DIRECTORY_NAME
public static final String FILE_NAME
public static final File AGGREGATION_PROPERTIES_FILE
protected int totalBufferedRecords
protected final PersistenceExecutor persistenceExecutor
public boolean changeConfiguration
protected ScheduledFuture<?> futureFlush
protected ScheduledFuture<?> futureReload
protected AggregationScheduler(PersistenceExecutor persistenceExecutor)
protected AggregationScheduler(PersistenceExecutor persistenceExecutor, AggregationConfiguration config)
public static AggregationScheduler newInstance(PersistenceExecutor persistenceExecutor)
public static AggregationScheduler newInstance(PersistenceExecutor persistenceExecutor, PersistenceBackendConfiguration configuration) 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
record - The RecordpersistenceExecutor - Exceptionprotected abstract boolean isTimeToPersist(int maxRecordNumber,
long oldRecordMaxTime)
protected void reloadConfiguration()
Exceptionprotected PersistenceBackendConfiguration getConfiguration()
public static Properties getPropertiesFromFile() throws IOException
IOExceptionprotected static AggregationConfiguration CheckConfiguration(PersistenceBackendConfiguration configuration) throws IOException
IOExceptionpublic AggregationConfiguration getConfig()
public void setConfig(AggregationConfiguration newConfig)
public void shutdown()
Copyright © 2019. All Rights Reserved.