VirtualDatabase
represents a database from client point of view and hide the complexity of the cluster distribution to the client. The client always uses the virtual database name and the C-JDBC Controller will use the real connections when an SQL request comes in.
VirtualDatabase.java の 65 行で定義されています。
Public メソッド | |
VirtualDatabase (String controllerName, String name, int maxConnections, boolean pool, int minThreads, int maxThreads, long maxThreadIdleTime, int sqlShortFormLength, AbstractBlobFilter blobFilter) | |
boolean | isDistributed () |
boolean | checkUserAuthentication (String virtualLogin, String virtualPassword) |
boolean | checkAdminAuthentication (String adminLogin, String adminPassword) |
ControllerResultSet | execReadRequest (SelectRequest request) throws SQLException |
int | execWriteRequest (AbstractWriteRequest request) throws SQLException |
ControllerResultSet | execWriteRequestWithKeys (AbstractWriteRequest request) throws SQLException |
ControllerResultSet | execReadStoredProcedure (StoredProcedure proc) throws SQLException |
long | begin (String login) throws SQLException |
void | commit (long transactionId) throws SQLException |
void | rollback (long transactionId) throws SQLException |
void | backupBackendWithCheckpoint (String backendName, String checkpointName, ArrayList tables) throws VirtualDatabaseException |
void | addBackend (DatabaseBackend db) throws VirtualDatabaseException |
void | addBackend (DatabaseBackend db, boolean checkForCompliance) throws VirtualDatabaseException |
void | removeCheckpoint (String checkpointName) throws VirtualDatabaseException |
void | removeBackend (DatabaseBackend db) throws VirtualDatabaseException |
ArrayList | viewCheckpointNames () |
void | enableBackend (String backendName) throws VirtualDatabaseException |
void | enableBackendFromCheckpoint (String backendName, String checkpointName) throws VirtualDatabaseException |
DatabaseBackend | getAndCheckBackend (String backendName, int testEnable) throws VirtualDatabaseException |
void | disableBackend (String backendName) throws VirtualDatabaseException |
void | disableAllBackend () throws VirtualDatabaseException |
void | enableAllBackend () throws VirtualDatabaseException |
void | enableAllBackend (String checkpoint) throws VirtualDatabaseException |
void | disableBackendForCheckpoint (String backendName, String checkpointName) throws VirtualDatabaseException |
final void | acquireReadLockBackendLists () throws InterruptedException |
final void | releaseReadLockBackendLists () |
AuthenticationManager | getAuthenticationManager () |
void | setAuthenticationManager (AuthenticationManager authenticationManager) |
ArrayList | getBackends () |
ArrayList | getAllBackendNames () throws VirtualDatabaseException |
String | getDatabaseName () |
String | getDatabaseProductName () |
int | getSQLShortFormLength () |
VirtualDatabaseMetaData | getMetaData () |
DatabaseSchema | getDatabaseSchemaFromActiveBackendsAndRefreshDatabaseProductNames () throws SQLException |
void | setDatabaseSchema (DatabaseSchema schema, boolean isStatic) |
RequestManager | getRequestManager () |
void | setRequestManager (RequestManager requestManager) |
String | getVirtualDatabaseName () |
SQLMonitoring | getSQLMonitor () |
void | setSQLMonitor (SQLMonitoring sqlMonitor) |
boolean | equals (Object other) |
String | getXml () |
String | getBackendInformation (String backendName) throws VirtualDatabaseException |
String | getName () |
int | getCurrentNbOfThreads () |
void | addCurrentNbOfThread () |
void | removeCurrentNbOfThread () |
int | getMinNbOfThreads () |
boolean | isPoolConnectionThreads () |
void | setMinNbOfThreads (int minNbOfThreads) |
void | setPoolConnectionThreads (boolean poolConnectionThreads) |
long | getMaxThreadIdleTime () |
void | setMaxThreadIdleTime (long maxThreadIdleTime) |
int | getMaxNbOfConnections () |
int | getMaxNbOfThreads () |
ArrayList | getPendingConnections () |
void | setMaxNbOfConnections (int maxNbOfConnections) |
void | setMaxNbOfThreads (int maxNbOfThreads) |
ArrayList | getActiveThreads () |
String[] | viewBackendInformation (String backendName) throws VirtualDatabaseException |
void | addIdleThread () |
void | removeIdleThread () |
int | getIdleThreads () |
ArrayList | viewAllBackendNames () throws VirtualDatabaseException |
ArrayList | viewAllClientNames () |
void | disableAllBackendForCheckpoint (String checkpoint) throws VirtualDatabaseException |
synchronized void | shutdown (int level) |
void | shutdown () throws VirtualDatabaseException |
void | setBlobFilter (AbstractBlobFilter filter) |
AbstractBlobFilter | getBlobFilter () |
String | getBackendState (String backendName) throws VirtualDatabaseException |
String | viewOwningController () |
void | restoreBackendFromBackupCheckpoint (String databaseBackendName, String checkpointName) throws VirtualDatabaseException, BackupException, OctopusException |
void | storeBackendsCheckpoint () |
boolean | hasRecoveryLog () |
Public 変数 | |
Trace | logger = null |
Static Public 変数 | |
final int | CHECK_BACKEND_ENABLE = 1 |
final int | CHECK_BACKEND_DISABLE = 0 |
final int | NO_CHECK_BACKEND = -1 |
Protected メソッド | |
int | execWriteStoredProcedure (StoredProcedure proc) throws SQLException |
String | getDistributionXml () |
Protected 変数 | |
String | name |
AuthenticationManager | authenticationManager |
ArrayList | backends |
ReadPrioritaryFIFOWriteLock | rwLock |
RequestManager | requestManager |
Trace | requestLogger = null |
int | maxNbOfConnections |
boolean | poolConnectionThreads |
long | maxThreadIdleTime |
int | minNbOfThreads |
int | maxNbOfThreads |
int | currentNbOfThreads |
VirtualDatabaseMetaData | metadata |
変数 | |
String | controllerName |
Private 変数 | |
ArrayList | activeThreads = new ArrayList() |
int | idleThreads = 0 |
ArrayList | pendingConnections = new ArrayList() |
SQLMonitoring | sqlMonitor = null |
int | sqlShortFormLength |
AbstractBlobFilter | blobFilter |
String | databaseProductNames = "C-JDBC" |
|
Creates a new
VirtualDatabase.java の 174 行で定義されています。 参照先 org.objectweb.cjdbc.common.log.Trace.getLogger(), org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.requestLogger, と org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.rwLock.
00178 { 00179 this.controllerName = controllerName; 00180 this.name = name; 00181 this.maxNbOfConnections = maxConnections; 00182 this.poolConnectionThreads = pool; 00183 this.minNbOfThreads = minThreads; 00184 this.maxNbOfThreads = maxThreads; 00185 this.maxThreadIdleTime = maxThreadIdleTime; 00186 this.sqlShortFormLength = sqlShortFormLength; 00187 this.blobFilter = blobFilter; 00188 backends = new ArrayList(); 00189 rwLock = new ReadPrioritaryFIFOWriteLock(); 00190 logger = Trace.getLogger("org.objectweb.cjdbc.controller.virtualdatabase." 00191 + name); 00192 requestLogger = Trace 00193 .getLogger("org.objectweb.cjdbc.controller.virtualdatabase.request." 00194 + name); 00195 } |
|
|
Add a backend to this virtual database.
VirtualDatabase.java の 595 行で定義されています。
00597 { 00598 if (db == null) 00599 { 00600 String msg = "Illegal null database backend in addBackend(DatabaseBackend) method"; 00601 logger.error(msg); 00602 throw new VirtualDatabaseException(msg); 00603 } 00604 00605 if (db.isReadEnabled()) 00606 { 00607 String msg = "It is not allowed to add an enabled database."; 00608 logger.error(msg); 00609 throw new VirtualDatabaseException(msg); 00610 } 00611 00612 try 00613 { 00614 rwLock.acquireWrite(); 00615 } 00616 catch (InterruptedException e) 00617 { 00618 String msg = Translate.get( 00619 "loadbalancer.backendlist.acquire.writelock.failed", e); 00620 logger.error(msg); 00621 throw new VirtualDatabaseException(msg); 00622 } 00623 00624 if (backends.indexOf(db) == -1) 00625 { 00626 // Initialize the driver and check the compliance 00627 try 00628 { 00629 if (logger.isDebugEnabled()) 00630 logger.debug("Checking driver compliance"); 00631 if (checkForCompliance) 00632 db.checkDriverCompliance(); // Also loads the 00633 // driver 00634 } 00635 catch (Exception e) 00636 { 00637 rwLock.releaseWrite(); 00638 String msg = "Error while adding database backend " + db.getName() 00639 + " (" + e + ")"; 00640 logger.warn(msg); 00641 throw new VirtualDatabaseException(msg); 00642 } 00643 db.setSqlShortFormLength(getSQLShortFormLength()); 00644 backends.add(db); 00645 00646 // Add the backend to the list 00647 if (logger.isDebugEnabled()) 00648 logger.debug("Backend " + db.getName() + " added successfully"); 00649 00650 rwLock.releaseWrite(); // Relase the lock 00651 } 00652 else 00653 { 00654 rwLock.releaseWrite(); 00655 String msg = "Duplicate backend " + db.getURL(); 00656 logger.warn(msg); 00657 throw new VirtualDatabaseException(msg); 00658 } 00659 00660 } |
|
Add a backend to this virtual database.
VirtualDatabase.java の 583 行で定義されています。
00584 { 00585 this.addBackend(db, true); 00586 } |
|
Adds one to currentNbOfThreads. Warning! This method is not synchronized. VirtualDatabase.java の 1433 行で定義されています。 参照元 org.objectweb.cjdbc.controller.core.ControllerWorkerThread.run().
01434 { 01435 currentNbOfThreads++; 01436 } |
|
Method add an idle thread. Warning! This method must be called in a synchronized block on activeThreads. VirtualDatabase.java の 1581 行で定義されています。 参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.run().
01582 { 01583 idleThreads++; 01584 } |
|
org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBeanに実装されています. VirtualDatabase.java の 560 行で定義されています。
00562 { 00563 try 00564 { 00565 DatabaseBackend db = getAndCheckBackend(backendName, NO_CHECK_BACKEND); 00566 requestManager.backupBackendWithCheckpoint(db, checkpointName, tables, db 00567 .isReadEnabled()); 00568 } 00569 catch (SQLException sql) 00570 { 00571 throw new VirtualDatabaseException(sql.getMessage()); 00572 } 00573 } |
|
Begins a new transaction and returns the corresponding transaction identifier. This method is called from the driver when org.objectweb.cjdbc.driver.Connection#setAutoCommit(boolean)is called with
VirtualDatabase.java の 492 行で定義されています。 参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.run().
00493 { 00494 try 00495 { 00496 long tid = requestManager.begin(login); 00497 if (requestLogger.isInfoEnabled()) 00498 requestLogger.info("B " + tid); 00499 return tid; 00500 } 00501 catch (SQLException e) 00502 { 00503 String msg = "Begin failed (" + e.getMessage() + ")"; 00504 logger.warn(msg); 00505 throw e; 00506 } 00507 } |
|
Checks if a given admin login/password is ok.
org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBeanに実装されています. VirtualDatabase.java の 241 行で定義されています。 参照先 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.authenticationManager, org.objectweb.cjdbc.common.log.Trace.error(), と org.objectweb.cjdbc.controller.authentication.AuthenticationManager.isValidAdminUser().
00243 { 00244 if (authenticationManager == null) 00245 { 00246 logger.error("No authentification manager defined to check admin login '" 00247 + adminLogin + "'"); 00248 return false; 00249 } 00250 else 00251 return authenticationManager.isValidAdminUser(new VirtualDatabaseUser( 00252 adminLogin, adminPassword)); 00253 } |
|
Checks if a given virtual login/password is ok.
VirtualDatabase.java の 218 行で定義されています。 参照先 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.authenticationManager, org.objectweb.cjdbc.common.log.Trace.error(), と org.objectweb.cjdbc.controller.authentication.AuthenticationManager.isValidVirtualUser().
00220 { 00221 if (authenticationManager == null) 00222 { 00223 logger.error("No authentification manager defined to check login '" 00224 + virtualLogin + "'"); 00225 return false; 00226 } 00227 else 00228 return authenticationManager.isValidVirtualUser(new VirtualDatabaseUser( 00229 virtualLogin, virtualPassword)); 00230 } |
|
Commits a transaction given its id.
VirtualDatabase.java の 515 行で定義されています。 参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.run(), と org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.setRequestParameters().
00516 { 00517 try 00518 { 00519 if (requestLogger.isInfoEnabled()) 00520 requestLogger.info("C " + transactionId); 00521 requestManager.commit(transactionId); 00522 } 00523 catch (SQLException e) 00524 { 00525 String msg = "Commit of transaction '" + transactionId + "' failed (" 00526 + e.getMessage() + ")"; 00527 logger.warn(msg); 00528 throw e; 00529 } 00530 } |
|
Prepare this virtual database for shutdown. This turns off all the backends by cutting communication from this database. This does not prevents other virtual database to use shared backends. This doesn't create checkpoints either.
org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBeanに実装されています. VirtualDatabase.java の 944 行で定義されています。 参照先 org.objectweb.cjdbc.controller.backend.DatabaseBackend.getName(), と org.objectweb.cjdbc.controller.backend.DatabaseBackend.isReadEnabled. 参照元 org.objectweb.cjdbc.controller.requestmanager.distributed.DistributedRequestManager.completeFailedOnAllBackends(), と org.objectweb.cjdbc.controller.core.Controller.removeVirtualDatabase().
00945 { 00946 try 00947 { 00948 int size = this.backends.size(); 00949 DatabaseBackend dbe; 00950 for (int i = 0; i < size; i++) 00951 { 00952 dbe = (DatabaseBackend) backends.get(i); 00953 if (dbe.isReadEnabled()) 00954 requestManager.disableBackend(getAndCheckBackend(dbe.getName(), 00955 CHECK_BACKEND_DISABLE)); 00956 } 00957 } 00958 catch (Exception e) 00959 { 00960 throw new VirtualDatabaseException(e.getMessage()); 00961 } 00962 } |
|
org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBeanに実装されています. VirtualDatabase.java の 1633 行で定義されています。
01635 { 01636 if (checkpoint == null) 01637 { 01638 disableAllBackend(); 01639 return; 01640 } 01641 01642 try 01643 { 01644 this.acquireReadLockBackendLists(); 01645 requestManager.disableBackendsForCheckpoint(backends, checkpoint); 01646 this.releaseReadLockBackendLists(); 01647 } 01648 catch (Exception e) 01649 { 01650 throw new VirtualDatabaseException(e.getMessage()); 01651 } 01652 } |
|
org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBeanに実装されています. VirtualDatabase.java の 917 行で定義されています。
00919 { 00920 try 00921 { 00922 requestManager.disableBackend(getAndCheckBackend(backendName, 00923 CHECK_BACKEND_DISABLE)); 00924 requestManager.setDatabaseSchema( 00925 getDatabaseSchemaFromActiveBackendsAndRefreshDatabaseProductNames(), 00926 false); 00927 } 00928 catch (Exception e) 00929 { 00930 logger.error("An error occured while disabling backend " + backendName 00931 + " (" + e + ")"); 00932 throw new VirtualDatabaseException(e.getMessage()); 00933 } 00934 } |
|
org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBeanに実装されています. VirtualDatabase.java の 1024 行で定義されています。
01026 { 01027 try 01028 { 01029 requestManager.disableBackendForCheckpoint(getAndCheckBackend( 01030 backendName, CHECK_BACKEND_DISABLE), checkpointName); 01031 requestManager.setDatabaseSchema( 01032 getDatabaseSchemaFromActiveBackendsAndRefreshDatabaseProductNames(), 01033 false); 01034 } 01035 catch (Exception e) 01036 { 01037 logger.error("An error occured while disabling backend " + backendName 01038 + " (" + e + ")"); 01039 throw new VirtualDatabaseException(e.getMessage()); 01040 } 01041 } |
|
Prepare this virtual database for startup. This turns on all the backends
org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBeanに実装されています. VirtualDatabase.java の 995 行で定義されています。 参照先 org.objectweb.cjdbc.controller.backend.DatabaseBackend.isReadEnabled.
00997 { 00998 try 00999 { 01000 int size = this.backends.size(); 01001 DatabaseBackend dbe; 01002 for (int i = 0; i < size; i++) 01003 { 01004 dbe = (DatabaseBackend) backends.get(i); 01005 if (!dbe.isReadEnabled()) 01006 { 01007 if (checkpoint == null) 01008 enableBackend(((DatabaseBackend) backends.get(i)).getName()); 01009 else 01010 enableBackendFromCheckpoint(((DatabaseBackend) backends.get(i)) 01011 .getName(), checkpoint); 01012 } 01013 } 01014 } 01015 catch (Exception e) 01016 { 01017 throw new VirtualDatabaseException(e.getMessage()); 01018 } 01019 } |
|
Prepare this virtual database for startup. This turns on all the backends
org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBeanに実装されています. VirtualDatabase.java の 969 行で定義されています。 参照先 org.objectweb.cjdbc.controller.backend.DatabaseBackend.isReadEnabled.
00970 { 00971 try 00972 { 00973 int size = this.backends.size(); 00974 DatabaseBackend dbe; 00975 for (int i = 0; i < size; i++) 00976 { 00977 dbe = (DatabaseBackend) backends.get(i); 00978 if (!dbe.isReadEnabled()) 00979 enableBackend(((DatabaseBackend) backends.get(i)).getName()); 00980 } 00981 } 00982 catch (Exception e) 00983 { 00984 logger.error(e); 00985 throw new VirtualDatabaseException(e.getMessage()); 00986 } 00987 } |
|
org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBeanに実装されています. VirtualDatabase.java の 753 行で定義されています。 参照先 org.objectweb.cjdbc.controller.backend.DatabaseBackend.getDatabaseProductName(), と org.objectweb.cjdbc.controller.backend.DatabaseBackend.getLastKnownCheckpoint().
00754 { 00755 // Call the Request Manager 00756 try 00757 { 00758 DatabaseBackend backend = getAndCheckBackend(backendName, 00759 CHECK_BACKEND_ENABLE); 00760 String lastCheckpoint = backend.getLastKnownCheckpoint(); 00761 if (lastCheckpoint != null) 00762 { 00763 requestManager.enableBackendFromCheckpoint(backend, lastCheckpoint); 00764 } 00765 else 00766 requestManager.enableBackend(backend); 00767 00768 // Update the list of database product names 00769 if (databaseProductNames.indexOf(backend.getDatabaseProductName()) == -1) 00770 databaseProductNames += "," + backend.getDatabaseProductName(); 00771 } 00772 catch (Exception e) 00773 { 00774 throw new VirtualDatabaseException(e.getMessage()); 00775 } 00776 } |
|
org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBeanに実装されています. VirtualDatabase.java の 781 行で定義されています。 参照先 org.objectweb.cjdbc.controller.backend.DatabaseBackend.getDatabaseProductName().
00783 { 00784 // Call the Request Manager 00785 try 00786 { 00787 DatabaseBackend backend = getAndCheckBackend(backendName, 00788 CHECK_BACKEND_ENABLE); 00789 requestManager.enableBackendFromCheckpoint(backend, checkpointName); 00790 00791 // Update the list of database product names 00792 if (databaseProductNames.indexOf(backend.getDatabaseProductName()) == -1) 00793 databaseProductNames += "," + backend.getDatabaseProductName(); 00794 } 00795 catch (Exception e) 00796 { 00797 throw new VirtualDatabaseException( 00798 "Failed to enable backend from checkpoint: " + e); 00799 } 00800 } |
|
Two virtual databases are equal if they have the same name and group.
org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabaseで再定義されています。 VirtualDatabase.java の 1294 行で定義されています。 参照先 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.getDatabaseName().
01295 { 01296 if ((other == null) || (!(other instanceof VirtualDatabase))) 01297 return false; 01298 else 01299 { 01300 VirtualDatabase db = (VirtualDatabase) other; 01301 return name.equals(db.getDatabaseName()); 01302 } 01303 } |
|
Performs a read request and returns the reply.
VirtualDatabase.java の 262 行で定義されています。 参照先 org.objectweb.cjdbc.controller.requestmanager.RequestManager.execReadRequest(), org.objectweb.cjdbc.common.log.Trace.info(), org.objectweb.cjdbc.common.log.Trace.isInfoEnabled(), org.objectweb.cjdbc.controller.monitoring.SQLMonitoring.logError(), org.objectweb.cjdbc.controller.monitoring.SQLMonitoring.logRequestTime(), org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.requestLogger, org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.sqlMonitor, と org.objectweb.cjdbc.common.log.Trace.warn(). 参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.run().
00264 { 00265 if (request == null) 00266 { 00267 String msg = "Request failed (null read request received)"; 00268 logger.warn(msg); 00269 throw new SQLException(msg); 00270 } 00271 00272 try 00273 { 00274 if (requestLogger.isInfoEnabled()) 00275 requestLogger.info("S " + request.getTransactionId() + " " 00276 + request.getSQL()); 00277 00278 long start = 0; 00279 if (sqlMonitor != null) 00280 start = System.currentTimeMillis(); 00281 00282 ControllerResultSet rs = requestManager.execReadRequest(request); 00283 00284 if (sqlMonitor != null) 00285 sqlMonitor.logRequestTime(request, System.currentTimeMillis() - start); 00286 00287 return rs; 00288 } 00289 catch (SQLException e) 00290 { 00291 String msg = "Request '" + request.getId() + "' failed (" 00292 + e.getMessage() + ")"; 00293 logger.warn(msg); 00294 if (sqlMonitor != null) 00295 sqlMonitor.logError(request); 00296 throw e; 00297 } 00298 } |
|
Call a stored procedure that returns a ResultSet.
VirtualDatabase.java の 397 行で定義されています。 参照先 org.objectweb.cjdbc.controller.requestmanager.RequestManager.execReadStoredProcedure(), org.objectweb.cjdbc.common.log.Trace.info(), org.objectweb.cjdbc.common.log.Trace.isInfoEnabled(), org.objectweb.cjdbc.controller.monitoring.SQLMonitoring.logError(), org.objectweb.cjdbc.controller.monitoring.SQLMonitoring.logRequestTime(), org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.requestLogger, org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.sqlMonitor, と org.objectweb.cjdbc.common.log.Trace.warn(). 参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.run().
00399 { 00400 if (proc == null) 00401 { 00402 String msg = "Request failed (null stored procedure received)"; 00403 logger.warn(msg); 00404 throw new SQLException(msg); 00405 } 00406 00407 try 00408 { 00409 if (requestLogger.isInfoEnabled()) 00410 requestLogger 00411 .info("S " + proc.getTransactionId() + " " + proc.getSQL()); 00412 00413 long start = 0; 00414 if (sqlMonitor != null) 00415 start = System.currentTimeMillis(); 00416 00417 ControllerResultSet rs = requestManager.execReadStoredProcedure(proc); 00418 00419 if (sqlMonitor != null) 00420 sqlMonitor.logRequestTime(proc, System.currentTimeMillis() - start); 00421 00422 return rs; 00423 } 00424 catch (SQLException e) 00425 { 00426 String msg = Translate.get("loadbalancer.storedprocedure.failed", 00427 new String[]{String.valueOf(proc.getId()), e.getMessage()}); 00428 logger.warn(msg); 00429 if (sqlMonitor != null) 00430 sqlMonitor.logError(proc); 00431 throw e; 00432 } 00433 } |
|
Performs a write request and returns the number of rows affected.
VirtualDatabase.java の 307 行で定義されています。 参照先 org.objectweb.cjdbc.controller.requestmanager.RequestManager.execWriteRequest(), org.objectweb.cjdbc.common.log.Trace.info(), org.objectweb.cjdbc.common.log.Trace.isInfoEnabled(), org.objectweb.cjdbc.controller.monitoring.SQLMonitoring.logError(), org.objectweb.cjdbc.controller.monitoring.SQLMonitoring.logRequestTime(), org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.requestLogger, org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.sqlMonitor, と org.objectweb.cjdbc.common.log.Trace.warn(). 参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.run().
00308 { 00309 if (request == null) 00310 { 00311 String msg = "Request failed (null write request received)"; 00312 logger.warn(msg); 00313 throw new SQLException(msg); 00314 } 00315 00316 try 00317 { 00318 if (requestLogger.isInfoEnabled()) 00319 requestLogger.info("W " + request.getTransactionId() + " " 00320 + request.getSQL()); 00321 00322 long start = 0; 00323 if (sqlMonitor != null) 00324 start = System.currentTimeMillis(); 00325 00326 int result = requestManager.execWriteRequest(request); 00327 00328 if (sqlMonitor != null) 00329 sqlMonitor.logRequestTime(request, System.currentTimeMillis() - start); 00330 00331 return result; 00332 } 00333 catch (SQLException e) 00334 { 00335 String msg = "Request '" + request.getId() + "' failed (" 00336 + e.getMessage() + ")"; 00337 logger.warn(msg); 00338 if (sqlMonitor != null) 00339 sqlMonitor.logError(request); 00340 throw e; 00341 } 00342 } |
|
Performs a write request and returns the auto generated keys.
VirtualDatabase.java の 351 行で定義されています。 参照先 org.objectweb.cjdbc.controller.requestmanager.RequestManager.execWriteRequestWithKeys(), org.objectweb.cjdbc.common.log.Trace.info(), org.objectweb.cjdbc.common.log.Trace.isInfoEnabled(), org.objectweb.cjdbc.controller.monitoring.SQLMonitoring.logError(), org.objectweb.cjdbc.controller.monitoring.SQLMonitoring.logRequestTime(), org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.requestLogger, org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.sqlMonitor, と org.objectweb.cjdbc.common.log.Trace.warn(). 参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.run().
00353 { 00354 if (request == null) 00355 { 00356 String msg = "Request failed (null write request received)"; 00357 logger.warn(msg); 00358 throw new SQLException(msg); 00359 } 00360 00361 try 00362 { 00363 if (requestLogger.isInfoEnabled()) 00364 requestLogger.info("W " + request.getTransactionId() + " " 00365 + request.getSQL()); 00366 00367 long start = 0; 00368 if (sqlMonitor != null) 00369 start = System.currentTimeMillis(); 00370 00371 ControllerResultSet result = requestManager 00372 .execWriteRequestWithKeys(request); 00373 00374 if (sqlMonitor != null) 00375 sqlMonitor.logRequestTime(request, System.currentTimeMillis() - start); 00376 00377 return result; 00378 } 00379 catch (SQLException e) 00380 { 00381 String msg = "Request '" + request.getId() + "' failed (" 00382 + e.getMessage() + ")"; 00383 logger.warn(msg); 00384 if (sqlMonitor != null) 00385 sqlMonitor.logError(request); 00386 throw e; 00387 } 00388 } |
|
Call a stored procedure that performs an update.
VirtualDatabase.java の 442 行で定義されています。
00444 { 00445 if (proc == null) 00446 { 00447 String msg = "Request failed (null stored procedure received)"; 00448 logger.warn(msg); 00449 throw new SQLException(msg); 00450 } 00451 00452 try 00453 { 00454 if (requestLogger.isInfoEnabled()) 00455 requestLogger 00456 .info("W " + proc.getTransactionId() + " " + proc.getSQL()); 00457 00458 long start = 0; 00459 if (sqlMonitor != null) 00460 start = System.currentTimeMillis(); 00461 00462 int result = requestManager.execWriteStoredProcedure(proc); 00463 00464 if (sqlMonitor != null) 00465 sqlMonitor.logRequestTime(proc, System.currentTimeMillis() - start); 00466 00467 return result; 00468 } 00469 catch (SQLException e) 00470 { 00471 String msg = Translate.get("loadbalancer.storedprocedure.failed", 00472 new String[]{String.valueOf(proc.getId()), e.getMessage()}); 00473 logger.warn(msg); 00474 if (sqlMonitor != null) 00475 sqlMonitor.logError(proc); 00476 throw e; 00477 } 00478 } |
|
Returns the activeThreads.
VirtualDatabase.java の 1562 行で定義されています。 参照元 org.objectweb.cjdbc.common.monitor.client.AbstractClientDataCollector.checkClientIndex(), org.objectweb.cjdbc.controller.monitoring.datacollector.DataCollector.retrieveClientsData(), org.objectweb.cjdbc.controller.monitoring.datacollector.DataCollector.retrieveVirtualDatabasesData(), org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.run(), org.objectweb.cjdbc.controller.core.ControllerWorkerThread.run(), org.objectweb.cjdbc.common.monitor.client.AbstractClientDataCollector.setClientIndex(), と org.objectweb.cjdbc.controller.core.shutdown.VirtualDatabaseShutdownThread.terminateClients().
01563 { 01564 return activeThreads; 01565 } |
|
VirtualDatabase.java の 1102 行で定義されています。
01103 { 01104 try 01105 { 01106 acquireReadLockBackendLists(); 01107 } 01108 catch (InterruptedException e) 01109 { 01110 String msg = "Unable to acquire read lock on backend list in getAllBackendNames (" 01111 + e + ")"; 01112 logger.error(msg); 01113 throw new VirtualDatabaseException(msg); 01114 } 01115 01116 int size = backends.size(); 01117 ArrayList result = new ArrayList(); 01118 for (int i = 0; i < size; i++) 01119 { 01120 result.add(((DatabaseBackend) backends.get(i)).getName()); 01121 } 01122 01123 releaseReadLockBackendLists(); 01124 return result; 01125 } |
|
Find the DatabaseBackend corresponding to the given backend name and check if it is possible to disable this backend. In the case enable, this method also updates the virtual database schema by merging it with the one provided by this backend.
VirtualDatabase.java の 815 行で定義されています。 参照先 org.objectweb.cjdbc.controller.backend.DatabaseBackend.checkDatabaseSchema(), org.objectweb.cjdbc.controller.backend.DatabaseBackend.getDatabaseSchema(), org.objectweb.cjdbc.controller.backend.DatabaseBackend.getName(), org.objectweb.cjdbc.controller.backend.DatabaseBackend.initializeConnections(), と org.objectweb.cjdbc.controller.backend.DatabaseBackend.isReadEnabled. 参照元 org.objectweb.cjdbc.common.monitor.backend.AbstractBackendDataCollector.collectValue().
00817 { 00818 try 00819 { 00820 acquireReadLockBackendLists(); 00821 } 00822 catch (InterruptedException e) 00823 { 00824 String msg = "Unable to acquire read lock on backend list in getAndCheckBackend (" 00825 + e + ")"; 00826 logger.error(msg); 00827 throw new VirtualDatabaseException(msg); 00828 } 00829 00830 // Find the backend 00831 int size = backends.size(); 00832 DatabaseBackend b = null; 00833 for (int i = 0; i < size; i++) 00834 { 00835 b = (DatabaseBackend) backends.get(i); 00836 if (b.getName().equals(backendName)) 00837 break; 00838 else 00839 b = null; 00840 } 00841 00842 // Check not null 00843 if (b == null) 00844 { 00845 releaseReadLockBackendLists(); 00846 String msg = "Trying to access a non-existing backend " + backendName; 00847 logger.warn(msg); 00848 throw new VirtualDatabaseException(msg); 00849 } 00850 00851 // Check enable/disable 00852 switch (testEnable) 00853 { 00854 case NO_CHECK_BACKEND : 00855 break; 00856 case CHECK_BACKEND_DISABLE : 00857 if (!b.isReadEnabled()) 00858 { 00859 releaseReadLockBackendLists(); 00860 String msg = "Backend " + backendName + " is already disabled"; 00861 logger.warn(msg); 00862 throw new VirtualDatabaseException(msg); 00863 } 00864 break; 00865 case CHECK_BACKEND_ENABLE : 00866 if (b.isReadEnabled()) 00867 { 00868 releaseReadLockBackendLists(); 00869 String msg = "Backend " + backendName + " is already enabled"; 00870 logger.warn(msg); 00871 throw new VirtualDatabaseException(msg); 00872 } 00873 break; 00874 default : 00875 String msg = "Unexpected parameter in getAndCheckBackend(...)"; 00876 logger.error(msg); 00877 throw new VirtualDatabaseException(msg); 00878 } 00879 00880 releaseReadLockBackendLists(); 00881 00882 if (testEnable == CHECK_BACKEND_ENABLE) 00883 { 00884 // Initialize backend for enable 00885 try 00886 { 00887 if (logger.isDebugEnabled()) 00888 logger.debug("Initializing connections for backend " + b.getName()); 00889 b.initializeConnections(); 00890 00891 if (logger.isDebugEnabled()) 00892 logger.debug("Checking schema for backend " + b.getName()); 00893 b.checkDatabaseSchema(); 00894 00895 DatabaseSchema backendSchema = b.getDatabaseSchema(); 00896 00897 if (backendSchema != null) 00898 requestManager.mergeDatabaseSchema(backendSchema); 00899 else 00900 logger.warn("Backend " + b.getName() + " has no defined schema."); 00901 } 00902 catch (SQLException e) 00903 { 00904 String msg = "Error while initalizing database backend " + b.getName() 00905 + " (" + e + ")"; 00906 logger.warn(msg); 00907 throw new VirtualDatabaseException(msg); 00908 } 00909 } 00910 00911 return b; 00912 } |
|
Returns the authentication manager of this virtual database.
VirtualDatabase.java の 1072 行で定義されています。 参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMetaData.getTablePrivileges(), org.objectweb.cjdbc.controller.virtualdatabase.protocol.VirtualDatabaseConfiguration.isCompatible(), org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.run(), と org.objectweb.cjdbc.controller.virtualdatabase.protocol.VirtualDatabaseConfiguration.VirtualDatabaseConfiguration().
01073 { 01074 return authenticationManager; 01075 } |
|
org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBeanに実装されています. VirtualDatabase.java の 1367 行で定義されています。 参照先 org.objectweb.cjdbc.controller.backend.DatabaseBackend.getName(), と org.objectweb.cjdbc.controller.backend.DatabaseBackend.getXml().
01369 { 01370 try 01371 { 01372 acquireReadLockBackendLists(); 01373 } 01374 catch (InterruptedException e) 01375 { 01376 String msg = "Unable to acquire read lock on backend list in getBackendInformation (" 01377 + e + ")"; 01378 logger.error(msg); 01379 throw new VirtualDatabaseException(msg); 01380 } 01381 01382 // Find the backend 01383 int size = backends.size(); 01384 DatabaseBackend b = null; 01385 for (int i = 0; i < size; i++) 01386 { 01387 b = (DatabaseBackend) backends.get(i); 01388 if (b.getName().equals(backendName)) 01389 break; 01390 else 01391 b = null; 01392 } 01393 01394 if (b == null) 01395 { 01396 releaseReadLockBackendLists(); 01397 String msg = "Backend " + backendName + " does not exists."; 01398 logger.warn(msg); 01399 throw new VirtualDatabaseException(msg); 01400 } 01401 01402 releaseReadLockBackendLists(); 01403 return b.getXml(); 01404 } |
|
Return the list of all backends
VirtualDatabase.java の 1094 行で定義されています。 参照元 org.objectweb.cjdbc.controller.loadbalancer.AbstractLoadBalancer.AbstractLoadBalancer(), org.objectweb.cjdbc.controller.loadbalancer.paralleldb.ParallelDB_RR.chooseBackendForReadRequest(), org.objectweb.cjdbc.controller.loadbalancer.paralleldb.ParallelDB_LPRF.chooseBackendForReadRequest(), org.objectweb.cjdbc.controller.loadbalancer.raidb2.RAIDb2_RR.execReadRequest(), org.objectweb.cjdbc.controller.loadbalancer.raidb2.RAIDb2_LPRF.execReadRequest(), org.objectweb.cjdbc.controller.loadbalancer.raidb0.RAIDb0.execReadRequest(), org.objectweb.cjdbc.controller.loadbalancer.raidb1.RAIDb1_LPRF.executeLPRF(), org.objectweb.cjdbc.controller.loadbalancer.raidb1.RAIDb1_RR.executeRoundRobinRequest(), org.objectweb.cjdbc.controller.loadbalancer.raidb1.RAIDb1_WRR.executeWRR(), org.objectweb.cjdbc.controller.loadbalancer.raidb2.RAIDb2.execWriteRequest(), org.objectweb.cjdbc.controller.loadbalancer.raidb1.RAIDb1ec_RR.getInformation(), org.objectweb.cjdbc.controller.monitoring.datacollector.DataCollector.retrieveBackendsData(), org.objectweb.cjdbc.controller.requestmanager.RequestManager.setBackendsLastKnownCheckpointFromRecoveryLog(), と org.objectweb.cjdbc.controller.virtualdatabase.protocol.VirtualDatabaseConfiguration.VirtualDatabaseConfiguration().
01095 { 01096 return backends; 01097 } |
|
org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBeanに実装されています. VirtualDatabase.java の 1704 行で定義されています。 参照先 org.objectweb.cjdbc.controller.backend.DatabaseBackend.isReadEnabled.
01706 { 01707 DatabaseBackend backend = getAndCheckBackend(backendName, NO_CHECK_BACKEND); 01708 // Backend cannot be null, otherwise the above throws an 01709 // VirtualDatabaseException 01710 return "" + backend.isReadEnabled(); 01711 } |
|
Returns the blobFilter associated to this virtual database
VirtualDatabase.java の 1696 行で定義されています。 参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.run().
01697 { 01698 return blobFilter; 01699 } |
|
Returns the currentNbOfThreads.
VirtualDatabase.java の 1425 行で定義されています。 参照元 org.objectweb.cjdbc.controller.monitoring.datacollector.DataCollector.retrieveVirtualDatabasesData(), と org.objectweb.cjdbc.controller.core.ControllerWorkerThread.run().
01426 { 01427 return currentNbOfThreads; 01428 } |
|
Gets the virtual database name to be used by the client (C-JDBC driver) This method should be used for local references only (it is faster). For remote RMI calls, use getVirtualDatabaseName().
VirtualDatabase.java の 1135 行で定義されています。 参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.equals(), org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabase.equals(), org.objectweb.cjdbc.controller.requestmanager.RequestManager.initRequestManagerVariables(), と org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.run().
01136 { 01137 return name; 01138 } |
|
VirtualDatabase.java の 1143 行で定義されています。 参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.run().
01144 { 01145 return databaseProductNames; 01146 } |
|
Get the current database schema from merging the schemas of all active backends. This is needed when a backend is disabled.
VirtualDatabase.java の 1179 行で定義されています。 参照先 org.objectweb.cjdbc.controller.backend.DatabaseBackend.getDatabaseProductName(), org.objectweb.cjdbc.controller.backend.DatabaseBackend.getDatabaseSchema(), org.objectweb.cjdbc.controller.backend.DatabaseBackend.isReadEnabled, と org.objectweb.cjdbc.common.sql.schema.DatabaseSchema.mergeSchema(). 参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMetaData.getDatabaseSchema().
01181 { 01182 try 01183 { 01184 acquireReadLockBackendLists(); 01185 } 01186 catch (InterruptedException e) 01187 { 01188 String msg = "Unable to acquire read lock on backend list in getDatabaseSchemaFromActiveBackends (" 01189 + e + ")"; 01190 logger.error(msg); 01191 throw new SQLException(msg); 01192 } 01193 // Build the new schema from all active backend's schemas 01194 int size = backends.size(); 01195 DatabaseSchema schema = null; 01196 DatabaseBackend b = null; 01197 String dbProductNames = "C-JDBC"; 01198 for (int i = 0; i < size; i++) 01199 { 01200 b = (DatabaseBackend) backends.get(i); 01201 if (b.isReadEnabled()) 01202 { 01203 if (schema == null) 01204 schema = b.getDatabaseSchema(); 01205 else 01206 schema.mergeSchema(b.getDatabaseSchema()); 01207 } 01208 01209 // Update the list of database product names 01210 if (dbProductNames.indexOf(b.getDatabaseProductName()) == -1) 01211 dbProductNames += "," + b.getDatabaseProductName(); 01212 } 01213 01214 releaseReadLockBackendLists(); 01215 databaseProductNames = dbProductNames; 01216 logger.debug("getDatabaseSchemaFromActiveBackends - end"); 01217 return schema; 01218 } |
|
Get the XML dump of the Distribution element if any.
org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabaseで再定義されています。 VirtualDatabase.java の 1359 行で定義されています。
01360 { 01361 return ""; 01362 } |
|
Returns the number of idle zorker threads. Warning! This method must be called in a synchronized block on activeThreads.
VirtualDatabase.java の 1601 行で定義されています。 参照元 org.objectweb.cjdbc.controller.core.ControllerWorkerThread.run().
01602 { 01603 return idleThreads; 01604 } |
|
Returns the maxNbOfConnections.
VirtualDatabase.java の 1512 行で定義されています。 参照元 org.objectweb.cjdbc.controller.core.ControllerWorkerThread.run().
01513 { 01514 return maxNbOfConnections; 01515 } |
|
Returns the maxNbOfThreads.
VirtualDatabase.java の 1522 行で定義されています。 参照元 org.objectweb.cjdbc.controller.core.ControllerWorkerThread.run().
01523 { 01524 return maxNbOfThreads; 01525 } |
|
Returns the maxThreadIdleTime.
VirtualDatabase.java の 1492 行で定義されています。 参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.run().
01493 { 01494 return maxThreadIdleTime; 01495 } |
|
VirtualDatabase.java の 1163 行で定義されています。 参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.run().
|
|
Returns the minNbOfThreads.
VirtualDatabase.java の 1452 行で定義されています。 参照元 org.objectweb.cjdbc.controller.core.ControllerWorkerThread.run().
01453 { 01454 return minNbOfThreads; 01455 } |
|
Gets the virtual database name to be used by the client (C-JDBC driver)
org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBeanに実装されています. VirtualDatabase.java の 1415 行で定義されています。 参照元 org.objectweb.cjdbc.controller.virtualdatabase.protocol.VirtualDatabaseConfiguration.isCompatible(), org.objectweb.cjdbc.controller.jmx.CjdbcJmxAgent.registerMBean(), org.objectweb.cjdbc.controller.monitoring.datacollector.DataCollector.retrieveVirtualDatabasesData(), org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.run(), org.objectweb.cjdbc.controller.requestmanager.RequestManager.setBackendsLastKnownCheckpointFromRecoveryLog(), org.objectweb.cjdbc.controller.core.shutdown.VirtualDatabaseShutdownThread.terminateClients(), org.objectweb.cjdbc.controller.jmx.CjdbcJmxAgent.unregisterMBean(), org.objectweb.cjdbc.controller.virtualdatabase.protocol.VirtualDatabaseConfiguration.VirtualDatabaseConfiguration(), org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMetaData.VirtualDatabaseMetaData(), org.objectweb.cjdbc.controller.core.shutdown.VirtualDatabaseShutdownThread.VirtualDatabaseShutdownThread(), と org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.VirtualDatabaseWorkerThread().
01416 { 01417 return name; 01418 } |
|
Returns the pendingConnections.
VirtualDatabase.java の 1532 行で定義されています。 参照元 org.objectweb.cjdbc.controller.monitoring.datacollector.DataCollector.retrieveVirtualDatabasesData(), org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.run(), と org.objectweb.cjdbc.controller.core.ControllerWorkerThread.run().
01533 { 01534 return pendingConnections; 01535 } |
|
Gets the request manager associated to this database.
VirtualDatabase.java の 1242 行で定義されています。 参照元 org.objectweb.cjdbc.common.monitor.scheduler.AbstractSchedulerDataCollector.collectValue(), org.objectweb.cjdbc.common.monitor.cache.AbstractCacheStatsDataCollector.collectValue(), org.objectweb.cjdbc.controller.core.Controller.isCacheEnableForDatabase(), org.objectweb.cjdbc.controller.virtualdatabase.protocol.VirtualDatabaseConfiguration.isCompatible(), org.objectweb.cjdbc.controller.monitoring.datacollector.DataCollector.retrieveCacheData(), org.objectweb.cjdbc.controller.monitoring.datacollector.DataCollector.retrieveCacheStatsData(), org.objectweb.cjdbc.controller.monitoring.datacollector.DataCollector.retrieveSchedulerData(), org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.run(), org.objectweb.cjdbc.controller.virtualdatabase.protocol.VirtualDatabaseConfiguration.VirtualDatabaseConfiguration(), と org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMetaData.VirtualDatabaseMetaData().
01243 { 01244 return requestManager; 01245 } |
|
Returns the current SQL monitor
VirtualDatabase.java の 1273 行で定義されています。 参照元 org.objectweb.cjdbc.controller.monitoring.datacollector.DataCollector.retrieveSQLStats().
01274 { 01275 return sqlMonitor; 01276 } |
|
Return the sql short form length to use when reporting an error.
VirtualDatabase.java の 1154 行で定義されています。 参照元 org.objectweb.cjdbc.controller.loadbalancer.paralleldb.ParallelDB_RR.chooseBackendForReadRequest(), org.objectweb.cjdbc.controller.loadbalancer.paralleldb.ParallelDB_LPRF.chooseBackendForReadRequest(), org.objectweb.cjdbc.controller.requestmanager.distributed.DistributedRequestManager.completeFailedOnAllBackends(), org.objectweb.cjdbc.controller.requestmanager.distributed.SingleDBDistributedRequestManager.execDistributedWriteRequest(), org.objectweb.cjdbc.controller.requestmanager.distributed.RAIDb2DistributedRequestManager.execDistributedWriteRequest(), org.objectweb.cjdbc.controller.requestmanager.distributed.RAIDb1DistributedRequestManager.execDistributedWriteRequest(), org.objectweb.cjdbc.controller.loadbalancer.singledb.SingleDB.execReadRequest(), org.objectweb.cjdbc.controller.loadbalancer.raidb2.RAIDb2_RR.execReadRequest(), org.objectweb.cjdbc.controller.loadbalancer.raidb2.RAIDb2_LPRF.execReadRequest(), org.objectweb.cjdbc.controller.loadbalancer.raidb0.RAIDb0.execReadRequest(), org.objectweb.cjdbc.controller.loadbalancer.paralleldb.ParallelDB.execReadRequest(), org.objectweb.cjdbc.controller.loadbalancer.raidb1.RAIDb1_LPRF.executeLPRF(), org.objectweb.cjdbc.controller.loadbalancer.raidb1.RAIDb1_RR.executeRoundRobinRequest(), org.objectweb.cjdbc.controller.loadbalancer.raidb1.RAIDb1_WRR.executeWRR(), と org.objectweb.cjdbc.controller.loadbalancer.raidb2.RAIDb2.execWriteRequest().
01155 { 01156 return sqlShortFormLength; 01157 } |
|
Gets the virtual database name to be used by the client (C-JDBC driver)
VirtualDatabase.java の 1262 行で定義されています。
01263 { 01264 return name; 01265 } |
|
Retrieves this
VirtualDatabase.java の 1310 行で定義されています。 参照元 org.objectweb.cjdbc.controller.core.Controller.viewDatabaseXml().
01311 { 01312 StringBuffer info = new StringBuffer(); 01313 info.append("<" + DatabasesXmlTags.ELT_VirtualDatabase + " " 01314 + DatabasesXmlTags.ATT_name + "=\"" + this.getName() + "\" " 01315 + DatabasesXmlTags.ATT_maxNbOfConnections + "=\"" 01316 + this.getMaxNbOfConnections() + "\" " 01317 + DatabasesXmlTags.ATT_poolThreads + "=\"" 01318 + this.isPoolConnectionThreads() + "\" " 01319 + DatabasesXmlTags.ATT_minNbOfThreads + "=\"" 01320 + this.getMinNbOfThreads() + "\" " 01321 + DatabasesXmlTags.ATT_maxNbOfThreads + "=\"" 01322 + this.getMaxNbOfThreads() + "\" " 01323 + DatabasesXmlTags.ATT_maxThreadIdleTime + "=\"" 01324 + this.getMaxThreadIdleTime() / 1000 01325 + DatabasesXmlTags.ATT_sqlDumpLength + "=\"" + this.sqlShortFormLength 01326 + "\" " + DatabasesXmlTags.ATT_blobEncodingMethod + "=\"" 01327 + this.blobFilter.getXml() + "\">"); 01328 01329 info.append(getDistributionXml()); 01330 01331 if (this.getSQLMonitor() != null) 01332 info.append(sqlMonitor.getXml()); 01333 if (this.getAuthenticationManager() != null) 01334 info.append(authenticationManager.getXml()); 01335 01336 try 01337 { 01338 acquireReadLockBackendLists(); 01339 int size = backends.size(); 01340 for (int i = 0; i < size; i++) 01341 info.append(((DatabaseBackend) backends.get(i)).getXml()); 01342 releaseReadLockBackendLists(); 01343 } 01344 catch (InterruptedException e) 01345 { 01346 logger.error(Translate.get("virtualdatabase.fail.read.lock", e)); 01347 } 01348 if (requestManager != null) 01349 info.append(requestManager.getXml()); 01350 info.append("</" + DatabasesXmlTags.ELT_VirtualDatabase + ">"); 01351 return info.toString(); 01352 } |
|
org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBeanに実装されています. VirtualDatabase.java の 1747 行で定義されています。
01748 { 01749 AbstractRecoveryLog log = requestManager.getRecoveryLog(); 01750 if (log == null) 01751 return false; 01752 else 01753 return true; 01754 } |
|
Is this virtual database distributed ?
org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBeanに実装されています. org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabaseで再定義されています。 VirtualDatabase.java の 202 行で定義されています。 参照元 org.objectweb.cjdbc.controller.core.Controller.isDistributedVirtualDatabase().
00203 { 00204 return false; 00205 } |
|
Returns the poolConnectionThreads.
VirtualDatabase.java の 1462 行で定義されています。
01463 { 01464 return poolConnectionThreads; 01465 } |
|
Releases the read lock on the backend lists (both enabled and disabled backends). This should be called after traversing the backend VirtualDatabase.java の 1060 行で定義されています。 参照元 org.objectweb.cjdbc.controller.loadbalancer.AbstractLoadBalancer.AbstractLoadBalancer(), org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabase.isCompatibleBackend(), と org.objectweb.cjdbc.controller.monitoring.datacollector.DataCollector.retrieveBackendsData().
01061 { 01062 rwLock.releaseRead(); 01063 } |
|
Remove a backend from this virtual database.
VirtualDatabase.java の 687 行で定義されています。
00688 { 00689 if (db == null) 00690 { 00691 String msg = "Illegal null database backend in removeBackend(DatabaseBackend) method"; 00692 logger.error(msg); 00693 throw new VirtualDatabaseException(msg); 00694 } 00695 00696 try 00697 { 00698 rwLock.acquireWrite(); 00699 } 00700 catch (InterruptedException e) 00701 { 00702 String msg = Translate.get( 00703 "loadbalancer.backendlist.acquire.writelock.failed", e); 00704 logger.error(msg); 00705 throw new VirtualDatabaseException(msg); 00706 } 00707 00708 // Sanity checks 00709 int idx = backends.indexOf(db); 00710 if (idx == -1) 00711 { 00712 rwLock.releaseWrite(); // Release the lock 00713 String msg = "Trying to remove a non-existing backend " + db.getName(); 00714 logger.warn(msg); 00715 throw new VirtualDatabaseException(msg); 00716 } 00717 00718 if (((DatabaseBackend) backends.get(idx)).isReadEnabled()) 00719 { 00720 rwLock.releaseWrite(); // Release the lock 00721 String msg = "Trying to remove an enabled backend " + db.getName(); 00722 logger.error(msg); 00723 throw new VirtualDatabaseException(msg); 00724 } 00725 00726 // Remove it 00727 backends.remove(idx); 00728 rwLock.releaseWrite(); // Relase the lock 00729 00730 if (logger.isDebugEnabled()) 00731 logger.debug("Backend " + db.getName() + " removed successfully"); 00732 } |
|
Remove a checkpoint from the recovery log of this virtual database
org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBeanに実装されています. VirtualDatabase.java の 668 行で定義されています。
00670 { 00671 try 00672 { 00673 requestManager.removeCheckpoint(checkpointName); 00674 } 00675 catch (Exception e) 00676 { 00677 throw new VirtualDatabaseException(e.getMessage()); 00678 } 00679 } |
|
Substract one to currentNbOfThreads. Warning! This method is not synchronized. VirtualDatabase.java の 1442 行で定義されています。 参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.run().
01443 { 01444 currentNbOfThreads--; 01445 } |
|
Remove an idle thread. Warning! This method must be called in a synchronized block on activeThreads. VirtualDatabase.java の 1590 行で定義されています。 参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.run().
01591 { 01592 idleThreads--; 01593 } |
|
org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBeanに実装されています. VirtualDatabase.java の 1725 行で定義されています。
01728 { 01729 DatabaseBackend backend = getAndCheckBackend(databaseBackendName, 01730 NO_CHECK_BACKEND); 01731 // Backend cannot be null, otherwise the above throws an 01732 // VirtualDatabaseException 01733 requestManager.restoreBackendFromBackupCheckpoint(backend, checkpointName); 01734 } |
|
Rollbacks a transaction given its id.
VirtualDatabase.java の 538 行で定義されています。 参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.run().
00539 { 00540 try 00541 { 00542 if (requestLogger.isInfoEnabled()) 00543 requestLogger.info("R " + transactionId); 00544 requestManager.rollback(transactionId); 00545 } 00546 catch (SQLException e) 00547 { 00548 String msg = "Rollback of transaction '" + transactionId + "' failed (" 00549 + e.getMessage() + ")"; 00550 logger.warn(msg); 00551 throw e; 00552 } 00553 } |
|
Sets the authentication manager for this virtual database.
VirtualDatabase.java の 1083 行で定義されています。
01085 {
01086 this.authenticationManager = authenticationManager;
01087 }
|
|
Sets the blob encoder
VirtualDatabase.java の 1686 行で定義されています。
01687 {
01688 this.blobFilter = filter;
01689 }
|
|
Sets a new database schema for this database if no one exist or merge the given schema to the existing one. A static schema can only be replaced by another static schema.
VirtualDatabase.java の 1228 行で定義されています。
01229 { 01230 if (requestManager != null) 01231 requestManager.setDatabaseSchema(schema, isStatic); 01232 else 01233 logger 01234 .warn("Unable to set database schema, no request manager has been defined."); 01235 } |
|
Sets the maxNbOfConnections.
VirtualDatabase.java の 1542 行で定義されています。
01543 {
01544 this.maxNbOfConnections = maxNbOfConnections;
01545 }
|
|
Sets the maxNbOfThreads.
VirtualDatabase.java の 1552 行で定義されています。
01553 {
01554 this.maxNbOfThreads = maxNbOfThreads;
01555 }
|
|
Sets the maxThreadIdleTime.
VirtualDatabase.java の 1502 行で定義されています。
01503 {
01504 this.maxThreadIdleTime = maxThreadIdleTime;
01505 }
|
|
Sets the minNbOfThreads.
VirtualDatabase.java の 1472 行で定義されています。
01473 {
01474 this.minNbOfThreads = minNbOfThreads;
01475 }
|
|
Sets the poolConnectionThreads.
VirtualDatabase.java の 1482 行で定義されています。
01483 {
01484 this.poolConnectionThreads = poolConnectionThreads;
01485 }
|
|
Sets a new request manager for this database.
org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabaseで再定義されています。 VirtualDatabase.java の 1252 行で定義されています。
01253 {
01254 this.requestManager = requestManager;
01255 }
|
|
Sets a new SQL Monitor
VirtualDatabase.java の 1283 行で定義されています。
01284 {
01285 this.sqlMonitor = sqlMonitor;
01286 }
|
|
Shutdown this virtual database in fast mode, disconnect clients
org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBeanに実装されています. VirtualDatabase.java の 1674 行で定義されています。 参照先 org.objectweb.cjdbc.controller.core.shutdown.ShutdownThread.run().
01675 { 01676 VirtualDatabaseShutdownThread shutdown = new VirtualDatabaseShutdownThread( 01677 this, ControllerConstants.CONTROLLER_SHUTDOWN_FAST); 01678 shutdown.run(); 01679 } |
|
Shutdown this virtual database. Finish all threads and stop connection to backends
VirtualDatabase.java の 1662 行で定義されています。 参照先 org.objectweb.cjdbc.controller.core.shutdown.ShutdownThread.run(). 参照元 org.objectweb.cjdbc.controller.core.Controller.shutdownDatabase().
01663 { 01664 VirtualDatabaseShutdownThread vdst = new VirtualDatabaseShutdownThread( 01665 this, level); 01666 vdst.run(); 01667 } |
|
Write the checkpoints for all backends on the recovery log VirtualDatabase.java の 1739 行で定義されています。
01740 { 01741 requestManager.storeBackendsCheckpoint(this.name, getBackends()); 01742 } |
|
org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBeanに実装されています. VirtualDatabase.java の 1609 行で定義されています。 参照元 org.objectweb.cjdbc.controller.core.Controller.listBackends().
01610 { 01611 return this.getAllBackendNames(); 01612 } |
|
Get all users connected to that database
VirtualDatabase.java の 1620 行で定義されています。 参照元 org.objectweb.cjdbc.controller.core.Controller.listDatabaseClients().
01621 { 01622 ArrayList list = this.getActiveThreads(); 01623 int size = list.size(); 01624 ArrayList clients = new ArrayList(size); 01625 for (int i = 0; i < list.size(); i++) 01626 clients.add(((VirtualDatabaseWorkerThread) list.get(i)).getUser()); 01627 return clients; 01628 } |
|
org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBeanに実装されています. VirtualDatabase.java の 1570 行で定義されています。 参照先 org.objectweb.cjdbc.controller.backend.DatabaseBackend.getBackendData().
01572 { 01573 DatabaseBackend backend = getAndCheckBackend(backendName, NO_CHECK_BACKEND); 01574 return backend.getBackendData(); 01575 } |
|
org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBeanに実装されています. VirtualDatabase.java の 737 行で定義されています。 参照先 org.objectweb.cjdbc.controller.recoverylog.AbstractRecoveryLog.getCheckpointNames().
00738 { 00739 try 00740 { 00741 AbstractRecoveryLog recoveryLog = requestManager.getRecoveryLog(); 00742 return recoveryLog.getCheckpointNames(); 00743 } 00744 catch (SQLException e) 00745 { 00746 return new ArrayList(); 00747 } 00748 } |
|
org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBeanに実装されています. VirtualDatabase.java の 1716 行で定義されています。
01717 { 01718 return controllerName; 01719 } |
|
VirtualDatabase.java の 107 行で定義されています。 |
|
Authentification manager matching virtual database login/password to backends login/password VirtualDatabase.java の 91 行で定義されています。 参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.checkAdminAuthentication(), と org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.checkUserAuthentication(). |
|
VirtualDatabase.java の 94 行で定義されています。 |
|
The filter used to store blobs in the database VirtualDatabase.java の 150 行で定義されています。 |
|
Use for method getAndCheck VirtualDatabase.java の 142 行で定義されています。 |
|
Use for method getAndCheck VirtualDatabase.java の 140 行で定義されています。 |
|
The controller we belong to VirtualDatabase.java の 153 行で定義されています。 |
|
Current number of worker threads VirtualDatabase.java の 132 行で定義されています。 参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.run(). |
|
Comma separated list of database product names (one instance per name) VirtualDatabase.java の 155 行で定義されています。 |
|
VirtualDatabase.java の 109 行で定義されています。 |
|
Virtual database logger VirtualDatabase.java の 103 行で定義されています。 参照元 org.objectweb.cjdbc.controller.requestmanager.distributed.DistributedRequestManager.enableBackend(), org.objectweb.cjdbc.controller.virtualdatabase.protocol.VirtualDatabaseConfiguration.isCompatible(), と org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.VirtualDatabaseWorkerThread(). |
|
Maximum number of concurrent accepted for this virtual database VirtualDatabase.java の 114 行で定義されています。 |
|
Maximum number of worker threads to fork VirtualDatabase.java の 129 行で定義されています。 |
|
Maximum time a worker thread can remain idle before dying VirtualDatabase.java の 120 行で定義されています。 |
|
Virtual Database MetaData VirtualDatabase.java の 135 行で定義されています。 |
|
Minimum number of worker threads to keep in the pool if poolConnectionThreads is true VirtualDatabase.java の 126 行で定義されています。 参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.run(). |
|
Virtual database name VirtualDatabase.java の 85 行で定義されています。 |
|
Use for method getAndCheck VirtualDatabase.java の 144 行で定義されています。 |
|
VirtualDatabase.java の 111 行で定義されています。 |
|
If false one worker thread is forked per connection else VirtualDatabase.java の 117 行で定義されています。 参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.run(). |
|
VirtualDatabase.java の 104 行で定義されています。 参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.execReadRequest(), org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.execReadStoredProcedure(), org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.execWriteRequest(), org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.execWriteRequestWithKeys(), と org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.VirtualDatabase(). |
|
The request manager to use for this database VirtualDatabase.java の 100 行で定義されています。 |
|
Read/Write lock for backend list VirtualDatabase.java の 97 行で定義されています。 参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.VirtualDatabase(). |
|
VirtualDatabase.java の 137 行で定義されています。 参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.execReadRequest(), org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.execReadStoredProcedure(), org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.execWriteRequest(), と org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.execWriteRequestWithKeys(). |
|
Short form of SQL statements to include in traces and exceptions VirtualDatabase.java の 147 行で定義されています。 |