Method Summary |
|
public void | addConnectionManager(String vLogin, AbstractConnectionManager connectionManager) Adds a ConnectionManager to this backend. |
public void | addDefaultConnectionManager(VirtualDatabaseUser vdbUser) Adds a default connection manager on this backend for the specified user. |
public void | addPendingReadRequest(AbstractRequest request) Adds a pending request to this backend.
Method is synchronized on pendingRequests field. |
public void | addPendingTask(AbstractTask task) Adds a pending request to this backend.
Method is synchronized on pendingTasks field. |
public void | addPendingWriteRequest(AbstractRequest request) Adds a pending write request to this backend.
Method is synchronized on pendingRequests field. |
public void | addPersistentConnection(long persistentConnectionId, PooledConnection c) |
public void | addRewritingRule(AbstractRewritingRule rule) Add a AbstractRewritingRule at the end of the rule list. |
public void | addSavepoint(Long tid, Savepoint savepoint) |
public void | addStoredProcedureSemantic(String procedureName, int parameterCount, DatabaseProcedureSemantic semantic) |
public boolean | canAcceptTasks(AbstractRequest request) Returns true if the backend is in a state that allows it to accept tasks or
the execution of the specified request.
Parameters: request - the request that is going to execute in that task (null ifnot applicable). |
public boolean | canAcceptTasks(long persistentConnectionId) Returns true if the backend is in a state that allows it to accept tasks or
the execution for the specified persistent connection.
Parameters: persistentConnectionId - the persistent connection id of the requestthat is going to execute . |
public synchronized boolean | checkDatabaseSchema(Connection c) Checks that the current database schema is compatible with all schema
gathered from each connection manager. |
public void | checkDriverCompliance() Check if the driver used by this backend is compliant with Sequoia needs. |
public void | clearPersistentConnectionWarnings(long connId) |
public DatabaseBackend | copy(String newName, Map parameters) Returns a deeply copied clone of this backend. |
public synchronized boolean | disable() Sets the database backend state to disable. |
public synchronized void | disableRead() Disables the database backend for reads. |
public synchronized void | disableWrite() Disables the database backend for writes. |
public synchronized void | enableRead() Enables the database backend for reads. |
public synchronized void | enableWrite() Enables the database backend for writes. |
public boolean | equals(Object other) Two database backends are considered equal if they have the same name, URL
and driver class name. |
public synchronized void | finalizeConnections() Releases all the connections to the database held by the connection
managers. |
public void | flagAllConnectionsForRenewal() Force all connections to be renewed when they are used next. |
public ArrayList | getActiveTransactions() |
public String[] | getBackendData() Get data about this backend. |
public BackendStatistics | getBackendStats() Get the statistics of the backend. |
public BackendWorkerThread | getBackendWorkerThreadForNotification() Return the first available BackendWorkerThread. |
public Connection | getConnectionForTransactionAndLazyBeginIfNeeded(AbstractRequest request, AbstractConnectionManager cm) Retrieve a connection for a given transaction or create a new connection
and start a new transaction. |
public AbstractConnectionManager | getConnectionManager(String vLogin) Returns the ConnectionManager associated to this backend for
a given virtual login. |
public String | getConnectionTestStatement() Returns the SQL statement to use to check the connection validity. |
public String | getDatabaseProductName() Returns the databaseProductName value. |
public synchronized DatabaseSchema | getDatabaseSchema() Returns the schema of this database.
the schema of this database. |
public MetadataContainer | getDatabaseStaticMetadata() Get the Database static metadata from this backend using a connection from
the first available connection manager. |
public DatabaseProcedureSemantic | getDefaultStoredProcedureSemantic() Returns the default Stored Procedure Semantic value. |
public String | getDriverClassName() Returns the database native JDBC driver class name. |
public DriverCompliance | getDriverCompliance() |
public String | getDriverPath() Returns the driver path. |
public int | getDynamicPrecision() |
public String | getLastKnownCheckpoint() Returns the lastKnownCheckpoint value. |
public Trace | getLogger() |
public String | getName() Returns the backend logical name. |
public int | getNbOfWorkerThreads() Returns the nbOfWorkerThreads value. |
public Vector | getPendingRequests() Returns the list of pending requests for this backend. |
public ArrayList | getPendingRequestsDescription(int count, boolean fromFirst, boolean clone) Returns the list of pending requests for this backend. |
public SQLWarning | getPersistentConnectionWarnings(long connId) |
public Savepoint | getSavepoint(Long tid, String savepointName) Returns a Savepoint identified its name for a given transaction or
null if no such Savepoint exists. |
public String | getSchemaName() Returns the schemaName value. |
public String | getSchemaXml(boolean expandSchema) The getXml() method does not return the schema if it is not static anymore,
to avoid confusion between static and dynamic schema. |
public int | getSqlShortFormLength() Return the sql short form length to use when reporting an error. |
public String | getState() Retrieve the state of the backend. |
public int | getStateValue() Return the integer value corresponding to the state of the backend. |
public Collection | getTables() Get all the names of tables of this database NOTE: The returned
collection will contain two entries per actual table: one with the table
name alone, the other prefixed by the schema name + ".". |
public BackendTaskQueues | getTaskQueues() Returns the taskQueues value. |
public long | getTotalActiveConnections() |
public int | getTotalReadRequest() Returns the total number of read requests executed by this backend. |
public int | getTotalRequest() Returns the total number of requests executed by this backend. |
public int | getTotalTransactions() Returns the total number of transactions executed by this backend. |
public int | getTotalWriteRequest() Returns the total number of write requests executed by this backend. |
public String | getURL() Returns the JDBC URL used to access the database. |
public String | getVirtualDatabaseName() Returns the virtual database name this backend belongs to. |
public synchronized String | getXml() Get xml information about this backend. |
public boolean | hasPersistentConnections() Returns true if this DatabaseBackend has persistent
connections, false else. |
public boolean | hasStoredProcedure(String procedureName, int nbOfParameters) Returns true if this backend has the given stored procedure
in its schema. |
public boolean | hasTable(String table) Returns true if this backend has the given table in its
schema. |
public boolean | hasTables(Collection tables) Returns true if this backend has the given list of tables in
its schema. |
public int | hashCode() |
public synchronized void | initializeConnections() Initializes the connection managers' connections. |
public boolean | isBackuping() Returns the isBackuping value. |
public boolean | isDisabled() Is the backend completely disabled ? This usually means it has a known
state with a checkpoint associated to it. |
public boolean | isDisabling() Returns the isDisabling value. |
public boolean | isGatherSystemTables() Returns the gatherSystemTables value. |
public synchronized boolean | isInitialized() |
public synchronized boolean | isJDBCConnected() |
public boolean | isKilled() |
public synchronized boolean | isReadEnabled() Tests if this backend is read enabled (active and synchronized). |
public boolean | isReplaying() |
public boolean | isRestoring() |
public boolean | isSchemaDirty() Returns the schemaIsDirty value. |
public boolean | isSchemaStatic() |
public boolean | isStartedTransaction(Long tid) Returns true if the specified transaction has been started
on this backend (a connection has been allocated for this transaction). |
public boolean | isValidBackendUser(VirtualDatabaseUser vdbUser) Check if the given vdb user is a valid user for this backend.
Parameters: vdbUser - to be checked. |
public boolean | isValidConnection(Connection connection) Check if the given connection is valid or not. |
public boolean | isWriteCanBeEnabled() Returns the writeCanBeEnabled value. |
public synchronized boolean | isWriteEnabled() Tests if this backend is write enabled (active and synchronized). |
public void | notifyJmx(String type) |
public void | notifyJmxError(String type, Exception e) Sends JMX error notification
Parameters: e - Exception object. |
public void | removeConnectionManager(VirtualDatabaseUser vdbUser) Removes a ConnectionManager to this backend. |
public boolean | removePendingRequest(AbstractRequest request) Removes a pending request from this backend. |
public boolean | removePendingTask(AbstractTask task) Removes a pending task from this backend. |
public void | removePersistentConnection(long persistentConnectionId) |
public void | removeSavepoint(Long tid, Savepoint savepoint) |
public String | rewriteQuery(String sqlQuery) Rewrite the current query according to the rewriting rules. |
public synchronized void | setDatabaseSchema(DatabaseSchema databaseSchema, boolean isStatic) Sets the database schema. |
public void | setDefaultConnectionManager(AbstractConnectionManager defaultConnectionManager) Sets the default connection manager used for the transparent login feature. |
public void | setDefaultStoredProcedureSemantic(DatabaseProcedureSemantic defaultSemantic) Set the default Stored Procedure semantic definition. |
public void | setDisabling() This is used when the backend must be disabled but currently open
transactions must terminate. |
public void | setDynamicPrecision(int dynamicPrecision, boolean gatherSystemTables, String schemaName) Set the amount of information that must be gathered when fetching database
schema information. |
public void | setLastKnownCheckpoint(String checkpoint) |
public void | setNbOfWorkerThreads(int nbOfWorkerThreads) Sets the nbOfWorkerThreads value. |
public void | setNotificationBroadcaster(NotificationBroadcasterSupport notificationBroadcaster) Sets the NotificationBroadcasterSupport that this backend can use to send
JMX notification. |
public void | setSchemaIsDirty(boolean schemaIsDirty, AbstractRequest request) Sets the schemaIsDirty value if the backend schema needs to be refreshed. |
public void | setSchemaIsNeededByVdb(boolean schemaIsNeededByVdb) Sets the schemaIsNeededByVdb value. |
public void | setSqlShortFormLength(int sqlShortFormLength) Sets the sqlShortFormLength value. |
public synchronized void | setState(int state) |
public void | setStateListener(BackendStateListener stateListener) Sets the stateListener value. |
public void | setTaskQueues(BackendTaskQueues taskQueues) Sets the taskQueues value. |
public synchronized void | shutdownConnectionManagers() Tell all the connection managers to stop handing out new Connections. |
public void | startDeadlockDetectionThread(VirtualDatabase vdb) Start a new Deadlock Detection Thread (throws a RuntimeException if called
twice without stopping the thread before the second call). |
public void | startTransaction(Long tid) Signals that a transaction has been started on this backend. |
public void | startWorkerThreads(AbstractLoadBalancer loadBalancer) Start the BackendWorkerThreads for this backend. |
public void | stopTransaction(Long tid) Signals that a transaction has been stopped on this backend. |
public void | terminateDeadlockDetectionThread() Terminate the Deadlock Detection Thread. |
public void | terminateWorkerThreads() Terminate all worker threads. |
public void | terminateWorkerThreads(boolean wait) Terminate all worker threads. |
public static List | toBackendInfos(List backends) Convert a <DatabaseBackend>List to a
<BackendInfo>List .
The DatabaseBackend objects cannot be serialized because they are used as
MBean and notification emitters, so we want to extract the BackendInfo
(which are Serializable ) out of them.
This method does not keep the XML configuration of the BackendInfo
objects. |
public String | toString() |
public void | updateDatabaseBackendSchema(AbstractWriteRequest request) Update the DatabaseBackend schema definition according to the successful
execution of the provided request. |
public void | waitForAllTransactionsAndPersistentConnectionsToComplete() This method waits until all currently open transactions and persistent
connections on this backend complete. |