public abstract class DbPersister extends Object
| Modifier and Type | Class and Description |
|---|---|
protected static class |
DbPersister.RetentionPolicy |
| Modifier and Type | Field and Description |
|---|---|
protected IdentityInformationProvider |
_identityInfoProvider |
protected String |
_influxDbName |
protected Boolean |
_influxEnabled |
protected long |
_influxMpstatsInjectFreq |
protected String |
_influxPassword |
protected String |
_influxUrl |
protected String |
_influxUsername |
protected Connection |
_rdbmsConnection |
protected boolean |
_rdbmsCreateIndexes |
protected boolean |
_rdbmsCreateTables |
protected String |
_rdbmsDriver |
protected Boolean |
_rdbmsEnabled |
protected int |
_rdbmsNumReaderThreads |
protected String |
_rdbmsPassword |
protected long |
_rdbmsReconnectAttemptDuration |
protected long |
_rdbmsReconnectFrequency |
protected String |
_rdbmsUrl |
protected String |
_rdbmsUsername |
protected Set<String> |
_tableNames |
static Date |
MAX_DATE |
static Date |
MIN_DATE |
static String |
TECHSTATS_RP |
static String |
TECHSTATS_RP_DURATION |
| Modifier | Constructor and Description |
|---|---|
protected |
DbPersister(IDbTracer dbTracer,
String module) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close a database persister.
|
void |
commit()
Commit the current RDBMS transaction
|
void |
delete(com.eaio.uuid.UUID id)
Delete an object in the RBDMS
|
protected abstract void |
doClose()
Method invoked to close the concrete persister
This method is called just before the database connection is closed.
|
protected abstract void |
doDelete(com.eaio.uuid.UUID id)
Delete an object from the database
|
protected DbPersister.RetentionPolicy[] |
doGetAdditionalRetentionPolicies()
Method invoked to fetch additional reention policies
This method is called after the database connection is opened.
|
protected abstract void |
doOpen()
Method invoked to open the concrete persister
This method is called after the database connection is opened.
|
protected abstract void |
doUpdate(Object object)
Add or update an object in the database
|
String |
getAgentName()
Get the agent name
|
String |
getAppName()
Get the name of the app associated with a DB persister.
|
int |
getAppPartition()
Get the partition number of the app associated with a DB persister.
|
long |
getInlfuxMpstatsInjectFrequency()
Get the influx db mpstats inject frequency
|
Connection |
getRDBMSConnection()
Get the persister RDBMS connection
|
String |
getServerName()
Get the server name
|
Set<String> |
getTableNames()
Get the names of all the tables in the RDBMS
|
boolean |
indexExists(String tableName,
String indexName)
Check if an index exists in the RDBMS
|
static boolean |
isValidDate(Date date)
Validate persistence constraints for a date
|
void |
open()
Open a DB persister
|
abstract void |
read(com.eaio.uuid.UUID parentId,
IDbReaderCallback cb)
Read all objects from the database
|
boolean |
sequenceExists(String sequenceName)
Check if a sequence exists in the RDBMS
|
boolean |
tableExists(String tableName)
Check if a table exists in the RDBMS
|
protected String |
tracePrefix()
Get the trace prefix for this DB persister
|
protected Tracer |
tracer()
Get the tracer for this DB persister
|
void |
update(Object object)
Update an object in the RDBMS
|
@Inject protected Boolean _rdbmsEnabled
@Inject protected String _rdbmsDriver
@Inject protected String _rdbmsUrl
@Inject protected String _rdbmsUsername
@Inject protected String _rdbmsPassword
@Inject protected boolean _rdbmsCreateTables
@Inject protected boolean _rdbmsCreateIndexes
@Inject protected int _rdbmsNumReaderThreads
@Inject protected long _rdbmsReconnectFrequency
@Inject protected long _rdbmsReconnectAttemptDuration
@Inject protected Boolean _influxEnabled
@Inject protected String _influxUrl
@Inject protected String _influxUsername
@Inject protected String _influxPassword
@Inject protected String _influxDbName
@Inject protected IdentityInformationProvider _identityInfoProvider
@Inject protected long _influxMpstatsInjectFreq
protected Connection _rdbmsConnection
public static final String TECHSTATS_RP
public static final String TECHSTATS_RP_DURATION
public static final Date MIN_DATE
public static final Date MAX_DATE
protected DbPersister.RetentionPolicy[] doGetAdditionalRetentionPolicies()
This method is called after the database connection is opened.
protected abstract void doOpen()
throws Exception
This method is called after the database connection is opened.
Exceptionprotected abstract void doClose()
This method is called just before the database connection is closed.
protected abstract void doUpdate(Object object) throws Exception
Exceptionprotected abstract void doDelete(com.eaio.uuid.UUID id)
throws Exception
Exceptionprotected final String tracePrefix()
protected final Tracer tracer()
public abstract void read(com.eaio.uuid.UUID parentId,
IDbReaderCallback cb)
throws Exception
parentId - The id of the parent of the root object in the databaseExceptionpublic static final boolean isValidDate(Date date)
public final String getAppName()
public final int getAppPartition()
public final String getAgentName()
public final String getServerName()
public final long getInlfuxMpstatsInjectFrequency()
public final Connection getRDBMSConnection()
public final boolean tableExists(String tableName) throws Exception
Exceptionpublic final boolean indexExists(String tableName, String indexName) throws Exception
Exceptionpublic final boolean sequenceExists(String sequenceName) throws Exception
Exceptionpublic final void update(Object object) throws Exception
Exceptionpublic final void delete(com.eaio.uuid.UUID id)
throws Exception
Exceptionpublic final void commit()
throws Exception
Exceptionpublic final void close()
Copyright © 2016 Neeve Research, LLC. All Rights Reserved.