public abstract class PersistenceBackend extends Object
| Modifier and Type | Field and Description |
|---|---|
protected AggregationScheduler |
aggregationScheduler |
protected FallbackPersistenceBackend |
fallbackPersistence |
protected int |
fallbackUseCounter |
protected long |
fallbackUseStartTime |
protected boolean |
forceFallbackUse |
static int |
MAX_FALLBACK_RETRY
Max Times of Retry before forcing the usage of FallbackPersistenceBackend
|
static long |
MAX_TIME_TO_FALLBACK
Max Time Period Used during while the usage of FallbackPersistenceBackend is forced
|
protected FallbackMonitor |
persistenceBackendMonitor |
| Modifier | Constructor and Description |
|---|---|
protected |
PersistenceBackend() |
protected |
PersistenceBackend(FallbackPersistenceBackend fallback) |
| Modifier and Type | Method and Description |
|---|---|
void |
account(Record record)
Persist the Record.
|
protected void |
accountValidateAggregate(Record record,
boolean validate,
boolean aggregate) |
protected void |
accountWithFallback(Record... records) |
protected abstract void |
clean()
This method is used to allow PersistenceBackend implementations
to clean a global status if any (or to renew it) when to much
exceptions occurs trying to persist Records.
|
void |
close()
This method is used to close
|
protected abstract void |
closeConnection()
This method is used to close db connection
|
void |
flush() |
void |
flush(long timeout,
TimeUnit timeUnit)
Deprecated.
|
AggregationScheduler |
getAggregationScheduler() |
FallbackPersistenceBackend |
getFallbackPersistence() |
abstract boolean |
isConnectionActive()
Check the Connection state
|
protected abstract void |
openConnection()
This method is used to open db connection
|
protected abstract void |
prepareConnection(PersistenceBackendConfiguration configuration)
Prepare the connection to persistence.
|
protected abstract void |
reallyAccount(Record record)
This method contains the code to save the
Record |
protected void |
setAggregationScheduler(AggregationScheduler aggregationScheduler) |
protected void |
setFallback(FallbackPersistenceBackend fallback) |
public static final long MAX_TIME_TO_FALLBACK
public static final int MAX_FALLBACK_RETRY
protected boolean forceFallbackUse
protected int fallbackUseCounter
protected long fallbackUseStartTime
protected FallbackPersistenceBackend fallbackPersistence
protected AggregationScheduler aggregationScheduler
protected FallbackMonitor persistenceBackendMonitor
protected PersistenceBackend()
protected PersistenceBackend(FallbackPersistenceBackend fallback)
public FallbackPersistenceBackend getFallbackPersistence()
protected void setFallback(FallbackPersistenceBackend fallback)
fallback - the fallback to setpublic AggregationScheduler getAggregationScheduler()
protected void setAggregationScheduler(AggregationScheduler aggregationScheduler)
aggregationScheduler - the aggregationScheduler to setprotected abstract void prepareConnection(PersistenceBackendConfiguration configuration) throws Exception
configuration - The configuration to create the connectionException - if failsprotected abstract void openConnection()
throws Exception
Exceptionprotected abstract void closeConnection()
throws Exception
Exceptionprotected abstract void clean()
throws Exception
Exceptionpublic abstract boolean isConnectionActive()
throws Exception
Exceptionprotected abstract void reallyAccount(Record record) throws Exception
RecordExceptionprotected void accountWithFallback(Record... records) throws Exception
records - Exceptionprotected void accountValidateAggregate(Record record, boolean validate, boolean aggregate)
record - validate - aggregate - public void account(Record record) throws InvalidValueException
record - the Record to persistInvalidValueException - if the Record Validation Fails@Deprecated public void flush(long timeout, TimeUnit timeUnit) throws Exception
flush() insteadtimeout - timeUnit - ExceptionCopyright © 2020. All Rights Reserved.