DistributedVirtualDatabase
is a virtual database hosted by several controllers. Communication between the controllers is achieved with reliable multicast provided by Javagroups.
DistributedVirtualDatabase.java の 70 行で定義されています。
Public メソッド | |
DistributedVirtualDatabase (String controllerName, String name, String groupName, int maxConnections, boolean pool, int minThreads, int maxThreads, long maxThreadIdleTime, AbstractBlobFilter blobFilter) throws CJDBCException | |
String | getControllerName () |
String | getGroupName () |
void | setGroupName (String groupName) |
void | addBackendRecoveryPolicy (BackendRecoveryPolicy policy) |
void | setRequestManager (RequestManager requestManager) |
void | joinGroup () throws Exception |
JChannel | getChannel () |
MessageDispatcher | getDispatcher () |
boolean | isCompatibleBackend (DatabaseBackend backend) throws VirtualDatabaseException |
Object | handle (Message msg) |
void | getBackendStatus () |
void | receive (Message msg) |
byte[] | getState () |
void | setState (byte[] state) |
void | block () |
void | suspect (Address suspectedMember) |
void | viewAccepted (View newView) |
HashMap | getBackendRecoveryPolicy () |
boolean | isDistributed () |
boolean | equals (Object other) |
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 () |
String | getVirtualDatabaseName () |
SQLMonitoring | getSQLMonitor () |
void | setSQLMonitor (SQLMonitoring sqlMonitor) |
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 メソッド | |
void | finalize () throws Throwable |
String | getDistributionXml () |
int | execWriteStoredProcedure (StoredProcedure proc) throws SQLException |
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 メソッド | |
boolean | checkConfigurationCompatibility (Vector dest) |
void | broadcastBackendInformation (Vector dest) |
boolean | isLocalMessage (Message msg) |
Private 変数 | |
String | groupName = null |
HashMap | backendRecoveryPolicy |
HashMap | backendsPerController |
JChannel | channel = null |
MessageDispatcher | dispatcher |
View | currentView |
|
Creates a new
DistributedVirtualDatabase.java の 122 行で定義されています。 参照先 org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabase.backendRecoveryPolicy, と org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabase.backendsPerController.
00125 { 00126 super(controllerName,name, maxConnections, pool, minThreads, maxThreads, 00127 maxThreadIdleTime, 0,blobFilter); 00128 this.groupName = groupName; 00129 backendRecoveryPolicy = new HashMap(); 00130 backendsPerController = new HashMap(); 00131 } |
|
|
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 } |
|
Add a BackendRecoveryPolicy
DistributedVirtualDatabase.java の 184 行で定義されています。 参照先 org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabase.backendRecoveryPolicy, と org.objectweb.cjdbc.controller.backend.BackendRecoveryPolicy.getBackendName().
00185 { 00186 backendRecoveryPolicy.put(policy.getBackendName(), policy); 00187 } |
|
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 } |
|
DistributedVirtualDatabase.java の 603 行で定義されています。 参照先 org.objectweb.cjdbc.common.log.Trace.debug(), と org.objectweb.cjdbc.common.log.Trace.isDebugEnabled().
|
|
Broadcast backend information among controllers.
DistributedVirtualDatabase.java の 349 行で定義されています。 参照先 org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabase.backendsPerController, org.objectweb.cjdbc.common.log.Trace.debug(), org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabase.dispatcher, org.objectweb.cjdbc.common.log.Trace.isDebugEnabled(), と org.objectweb.cjdbc.common.log.Trace.warn(). 参照元 org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabase.joinGroup().
00350 { 00351 logger 00352 .debug(Translate 00353 .get("virtualdatabase.distributed.configuration.querying.remote.status")); 00354 00355 // Send our backend status 00356 RspList rspList = dispatcher.castMessage(dest, CJDBCGroupMessage 00357 .getMessage(new BackendStatus(backends)), GroupRequest.GET_ALL, 0); 00358 00359 int size = dest.size(); 00360 for (int i = 0; i < size; i++) 00361 { 00362 // Add the backend configuration of every remote controller 00363 Address addr = (Address) dest.get(i); 00364 if (rspList.isReceived(addr)) 00365 { 00366 if (logger.isDebugEnabled()) 00367 logger 00368 .debug(Translate 00369 .get( 00370 "virtualdatabase.distributed.configuration.updating.backend.list", 00371 addr.toString())); 00372 backendsPerController.put(addr, rspList.get(addr)); 00373 } 00374 else 00375 logger.warn(Translate.get( 00376 "virtualdatabase.distributed.unable.get.remote.status", addr 00377 .toString())); 00378 } 00379 } |
|
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 } |
|
Send the configuration of this controller to remote controller. All remote controllers must agree on the compatibility of the local controller configuration with their own configuration. Compatibility checking include Authentication Manager, Scheduler and Load Balancer settings.
DistributedVirtualDatabase.java の 317 行で定義されています。 参照先 org.objectweb.cjdbc.common.log.Trace.debug(), org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabase.dispatcher, org.objectweb.cjdbc.common.log.Trace.isDebugEnabled(), と org.objectweb.cjdbc.common.log.Trace.warn(). 参照元 org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabase.joinGroup().
00318 { 00319 if (logger.isDebugEnabled()) 00320 logger.debug(Translate 00321 .get("virtualdatabase.distributed.configuration.checking")); 00322 00323 // Send our configuration 00324 RspList rspList = dispatcher.castMessage(dest, CJDBCGroupMessage 00325 .getMessage(new VirtualDatabaseConfiguration(this)), 00326 GroupRequest.GET_ALL, 0); 00327 00328 // Check that everybody agreed 00329 Vector results = rspList.getResults(); 00330 int size = results.size(); 00331 if (size == 0) 00332 logger.warn(Translate 00333 .get("virtualdatabase.distributed.configuration.checking.noanswer")); 00334 for (int i = 0; i < size; i++) 00335 { 00336 if (((Boolean) results.get(i)).booleanValue() == false) 00337 return false; 00338 } 00339 00340 // Ok, everybody replied true (config is compatible) 00341 return true; 00342 } |
|
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, login and password.
org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseを再定義しています。 DistributedVirtualDatabase.java の 674 行で定義されています。 参照先 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.getDatabaseName(), と org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabase.getGroupName().
00675 { 00676 if ((other == null) 00677 || (!(other instanceof org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabase))) 00678 return false; 00679 else 00680 { 00681 DistributedVirtualDatabase db = (org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabase) other; 00682 return name.equals(db.getDatabaseName()) 00683 && groupName.equals(db.getGroupName()); 00684 } 00685 } |
|
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 } |
|
Disconnect the channel and close it.
DistributedVirtualDatabase.java の 138 行で定義されています。 参照先 org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabase.channel.
|
|
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 } |
|
Get the backend distribution policies
DistributedVirtualDatabase.java の 652 行で定義されています。 参照先 org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabase.backendRecoveryPolicy.
00653 { 00654 return backendRecoveryPolicy; 00655 } |
|
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 } |
|
Get the status of all remote controllers DistributedVirtualDatabase.java の 547 行で定義されています。 参照先 org.objectweb.cjdbc.common.log.Trace.debug(), org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabase.dispatcher, と org.objectweb.cjdbc.common.log.Trace.isDebugEnabled().
00548 { 00549 if (logger.isDebugEnabled()) 00550 logger.debug("Requesting remote controllers status"); 00551 RspList rspList = dispatcher.castMessage(null, CJDBCGroupMessage 00552 .getMessage(new BackendStatus(backends)), GroupRequest.GET_ALL, 5000); 00553 Vector results = rspList.getResults(); 00554 int size = results.size(); 00555 for (int i = 0; i < size; i++) 00556 { 00557 ArrayList b = (ArrayList) results.get(i); 00558 int bSize = b.size(); 00559 if (size == 0) 00560 logger.debug("No Database Backends"); 00561 else 00562 for (int j = 0; j < size; j++) 00563 logger.debug(((DatabaseBackend) b.get(j)).getXml()); 00564 } 00565 } |
|
Returns the blobFilter associated to this virtual database
VirtualDatabase.java の 1696 行で定義されています。 参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.run().
01697 {
01698 return blobFilter;
01699 }
|
|
Get the JGroups' channel used for group communications
DistributedVirtualDatabase.java の 292 行で定義されています。 参照先 org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabase.channel. 参照元 org.objectweb.cjdbc.controller.requestmanager.distributed.DistributedRequestManager.enableBackend(), org.objectweb.cjdbc.controller.requestmanager.distributed.SingleDBDistributedRequestManager.execDistributedWriteRequest(), org.objectweb.cjdbc.controller.requestmanager.distributed.RAIDb2DistributedRequestManager.execDistributedWriteRequest(), と org.objectweb.cjdbc.controller.requestmanager.distributed.RAIDb1DistributedRequestManager.execDistributedWriteRequest().
00293 { 00294 return channel; 00295 } |
|
Returns the controllerName value.
DistributedVirtualDatabase.java の 153 行で定義されています。 参照元 org.objectweb.cjdbc.controller.virtualdatabase.protocol.VirtualDatabaseConfiguration.isCompatible(), と org.objectweb.cjdbc.controller.virtualdatabase.protocol.VirtualDatabaseConfiguration.VirtualDatabaseConfiguration().
00154 { 00155 return controllerName; 00156 } |
|
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 JGroups' MessageDispatcher used for group communications
DistributedVirtualDatabase.java の 302 行で定義されています。 参照先 org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabase.dispatcher. 参照元 org.objectweb.cjdbc.controller.requestmanager.distributed.DistributedRequestManager.enableBackend(), org.objectweb.cjdbc.controller.requestmanager.distributed.SingleDBDistributedRequestManager.execDistributedWriteRequest(), org.objectweb.cjdbc.controller.requestmanager.distributed.RAIDb2DistributedRequestManager.execDistributedWriteRequest(), と org.objectweb.cjdbc.controller.requestmanager.distributed.RAIDb1DistributedRequestManager.execDistributedWriteRequest().
00303 { 00304 return dispatcher; 00305 } |
|
Get the XML dump of the Distribution element if any.
org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseを再定義しています。 DistributedVirtualDatabase.java の 692 行で定義されています。 参照先 org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabase.backendRecoveryPolicy, と org.objectweb.cjdbc.controller.backend.BackendRecoveryPolicy.getXml().
00693 { 00694 StringBuffer info = new StringBuffer(); 00695 info.append("<" + DatabasesXmlTags.ELT_Distribution + " " 00696 + DatabasesXmlTags.ATT_groupName + "=\"" + groupName + "\">"); 00697 00698 for (Iterator iter = backendRecoveryPolicy.values().iterator(); iter 00699 .hasNext();) 00700 { 00701 BackendRecoveryPolicy p = (BackendRecoveryPolicy) iter.next(); 00702 info.append(p.getXml()); 00703 } 00704 00705 info.append("</" + DatabasesXmlTags.ELT_Distribution + ">"); 00706 return info.toString(); 00707 } |
|
Returns the group name this virtual database belongs to.
DistributedVirtualDatabase.java の 164 行で定義されています。 参照元 org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabase.equals(), org.objectweb.cjdbc.controller.virtualdatabase.protocol.VirtualDatabaseConfiguration.isCompatible(), と org.objectweb.cjdbc.controller.virtualdatabase.protocol.VirtualDatabaseConfiguration.VirtualDatabaseConfiguration().
00165 { 00166 return groupName; 00167 } |
|
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 }
|
|
DistributedVirtualDatabase.java の 584 行で定義されています。
00585 {
00586 return null;
00587 }
|
|
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 } |
|
DistributedVirtualDatabase.java の 439 行で定義されています。 参照先 org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabase.backendsPerController, org.objectweb.cjdbc.common.log.Trace.debug(), org.objectweb.cjdbc.controller.backend.DatabaseBackend.equals(), org.objectweb.cjdbc.common.log.Trace.error(), org.objectweb.cjdbc.controller.backend.DatabaseBackend.getName(), org.objectweb.cjdbc.common.log.Trace.info(), org.objectweb.cjdbc.common.log.Trace.isDebugEnabled(), org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabase.isLocalMessage(), と org.objectweb.cjdbc.common.log.Trace.warn().
00440 { 00441 try 00442 { 00443 if (msg instanceof Message) 00444 { 00445 Object content = msg.getObject(); 00446 if (content instanceof DistributedRequest) 00447 { //Distributed request execution 00448 if (logger.isDebugEnabled()) 00449 logger.debug("DistributedRequest from: " + msg.getSrc()); 00450 return ((Serializable) ((DistributedRequest) content) 00451 .executeRequest((DistributedRequestManager) this.requestManager)); 00452 } 00453 if (content instanceof Commit) 00454 { //Distributed commit execution 00455 if (logger.isDebugEnabled()) 00456 logger.debug("Commit from: " + msg.getSrc()); 00457 return ((Serializable) ((Commit) content) 00458 .commit((DistributedRequestManager) this.requestManager)); 00459 } 00460 if (content instanceof Rollback) 00461 { //Distributed commit execution 00462 if (logger.isDebugEnabled()) 00463 logger.debug("Rollback from: " + msg.getSrc()); 00464 return ((Serializable) ((Rollback) content) 00465 .rollback((DistributedRequestManager) this.requestManager)); 00466 } 00467 else if (content instanceof VirtualDatabaseConfiguration) 00468 { // Check if given configuration is compatible with the local one 00469 if (logger.isDebugEnabled()) 00470 logger.debug("VirtualDatabaseConfiguration from: " + msg.getSrc()); 00471 if (isLocalMessage(msg)) 00472 return Boolean.TRUE; 00473 else 00474 return new Boolean(((VirtualDatabaseConfiguration) content) 00475 .isCompatible(this)); 00476 } 00477 else if (content instanceof BackendStatus) 00478 { // Update backend list from sender 00479 Address src = msg.getSrc(); 00480 ArrayList remoteBackendList = ((BackendStatus) content).getBackends(); 00481 backendsPerController.put(src, remoteBackendList); 00482 if (logger.isDebugEnabled()) 00483 logger 00484 .debug(Translate 00485 .get( 00486 "virtualdatabase.distributed.configuration.updating.backend.list", 00487 src.toString())); 00488 } 00489 else if (content instanceof EnableBackend) 00490 { 00491 Address src = msg.getSrc(); 00492 ArrayList remoteBackendList = (ArrayList) backendsPerController 00493 .get(src); 00494 DatabaseBackend enabledBackend = ((EnableBackend) content) 00495 .getBackend(); 00496 int size = remoteBackendList.size(); 00497 boolean backendFound = false; 00498 for (int i = 0; i < size; i++) 00499 { 00500 DatabaseBackend b = (DatabaseBackend) remoteBackendList.get(i); 00501 if (b.equals(enabledBackend)) 00502 { 00503 logger.info("Backend " + b.getName() + " enabled on controller " 00504 + src); 00505 remoteBackendList.set(i, enabledBackend); 00506 backendFound = true; 00507 break; 00508 } 00509 } 00510 if (!backendFound) 00511 { 00512 logger.warn("Updating backend list with unknown backend " 00513 + enabledBackend.getName() + " enabled on controller " + src); 00514 remoteBackendList.add(enabledBackend); 00515 } 00516 } 00517 else 00518 { 00519 logger.warn("Unhandled message type received: " + content.getClass() 00520 + "(" + content + ")"); 00521 } 00522 } 00523 else 00524 { 00525 String errorMsg = "Unsupported message type (" + msg.getClass() + ")"; 00526 logger.error(errorMsg); 00527 return new ControllerException(errorMsg); 00528 } 00529 return msg.makeReply(); 00530 } 00531 catch (Exception e) 00532 { 00533 if (e instanceof RuntimeException) 00534 logger.warn("Error while handling group message " + msg, e); 00535 return e; 00536 } 00537 } |
|
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 } |
|
Check if the given backend definition is compatible with the backend definitions of this distributed virtual database. Not that if the given backend does not exist in the current configuration, it is considered as compatible. Incompatibility results from 2 backends with the same JDBC URL.
DistributedVirtualDatabase.java の 392 行で定義されています。 参照先 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.acquireReadLockBackendLists(), org.objectweb.cjdbc.common.log.Trace.error(), org.objectweb.cjdbc.controller.backend.DatabaseBackend.getName(), org.objectweb.cjdbc.controller.backend.DatabaseBackend.getURL(), と org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.releaseReadLockBackendLists(). 参照元 org.objectweb.cjdbc.controller.virtualdatabase.protocol.VirtualDatabaseConfiguration.isCompatible().
00394 { 00395 try 00396 { 00397 acquireReadLockBackendLists(); 00398 } 00399 catch (InterruptedException e) 00400 { 00401 String msg = "Unable to acquire read lock on backend list in isCompatibleBackend (" 00402 + e + ")"; 00403 logger.error(msg); 00404 throw new VirtualDatabaseException(msg); 00405 } 00406 00407 try 00408 { 00409 // Find the backend 00410 String backendName = backend.getName(); 00411 int size = backends.size(); 00412 DatabaseBackend b = null; 00413 for (int i = 0; i < size; i++) 00414 { 00415 b = (DatabaseBackend) backends.get(i); 00416 if (b.getName().equals(backendName)) 00417 return !b.getURL().equals(backend.getURL()); 00418 } 00419 } 00420 catch (RuntimeException re) 00421 { 00422 throw new VirtualDatabaseException(re); 00423 } 00424 finally 00425 { 00426 releaseReadLockBackendLists(); 00427 } 00428 // This backend does not exist here 00429 return true; 00430 } |
|
Is this virtual database distributed ?
org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseを再定義しています。 DistributedVirtualDatabase.java の 662 行で定義されています。
00663 { 00664 return true; 00665 } |
|
DistributedVirtualDatabase.java の 539 行で定義されています。 参照先 org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabase.channel. 参照元 org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabase.handle().
00540 { 00541 return channel.getLocalAddress().equals(msg.getSrc()); 00542 } |
|
Returns the poolConnectionThreads.
VirtualDatabase.java の 1462 行で定義されています。
01463 { 01464 return poolConnectionThreads; 01465 } |
|
Makes this virtual database join a virtual database group. Those groups are mapped to JavaGroups groups.
DistributedVirtualDatabase.java の 212 行で定義されています。 参照先 org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabase.broadcastBackendInformation(), org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabase.channel, org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabase.checkConfigurationCompatibility(), org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabase.currentView, org.objectweb.cjdbc.common.log.Trace.debug(), org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabase.dispatcher, org.objectweb.cjdbc.common.log.Trace.error(), org.objectweb.cjdbc.common.log.Trace.info(), org.objectweb.cjdbc.common.log.Trace.isDebugEnabled(), と org.objectweb.cjdbc.common.log.Trace.warn().
00213 { 00214 try 00215 { 00216 // Read the protocol stack configuration from jgroups.xml 00217 URL jgroupConfigFile = DistributedVirtualDatabase.class 00218 .getResource("/jgroups.xml"); 00219 if (jgroupConfigFile == null) 00220 logger.warn(Translate 00221 .get("virtualdatabase.distributed.jgroups.xml.not.found")); 00222 else 00223 logger.info(Translate.get("virtualdatabase.distributed.jgroups.using", 00224 jgroupConfigFile.toString())); 00225 channel = new JChannel(jgroupConfigFile); 00226 if (logger.isDebugEnabled()) 00227 logger.debug("Group communication channel is configured as follows: " 00228 + channel.getProperties()); 00229 00230 // Join the group 00231 channel.connect(groupName); 00232 dispatcher = new MessageDispatcher(channel /* group channel */ 00233 , this /* messageListener */ 00234 , this /* membershipListener */ 00235 , this /* requestHandler */ 00236 , false /* deadlock detection */ 00237 ); 00238 00239 logger.info("Group " + groupName + " connected to " 00240 + channel.getLocalAddress()); 00241 00242 // Check if we are alone or not 00243 currentView = channel.getView(); 00244 if (currentView.size() == 1) 00245 { 00246 logger.info(Translate.get( 00247 "virtualdatabase.distributed.configuration.first.in.group", 00248 groupName)); 00249 return; 00250 } 00251 00252 // Compute the group list without us 00253 Vector allButUs = currentView.getMembers(); 00254 00255 // Our controller id is our position in the membership. 00256 // This assumes that all controllers have the view in the same order. 00257 ((DistributedRequestManager) requestManager).setControllerId(allButUs 00258 .indexOf(channel.getLocalAddress())); 00259 allButUs.remove(channel.getLocalAddress()); 00260 00261 // Check with the other controller that our config is compatible 00262 if (checkConfigurationCompatibility(allButUs) == false) 00263 { 00264 String msg = Translate 00265 .get("virtualdatabase.distributed.configuration.not.compatible"); 00266 logger.error(msg); 00267 throw new ControllerException(msg); 00268 } 00269 00270 logger.info(Translate 00271 .get("virtualdatabase.distributed.configuration.compatible")); 00272 00273 // Distribute backends among controllers knowing that at this point 00274 // there is no conflict on the backend distribution policies. 00275 broadcastBackendInformation(allButUs); 00276 } 00277 catch (Exception e) 00278 { 00279 String msg = Translate.get("virtualdatabase.distributed.joingroup.error", 00280 groupName); 00281 if (e instanceof RuntimeException) 00282 logger.error(msg, e); 00283 throw new Exception(msg + " (" + e + ")"); 00284 } 00285 } |
|
DistributedVirtualDatabase.java の 574 行で定義されています。 参照先 org.objectweb.cjdbc.common.log.Trace.debug(), と org.objectweb.cjdbc.common.log.Trace.isDebugEnabled().
|
|
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 group name used by the controllers hosting this virtual database.
DistributedVirtualDatabase.java の 174 行で定義されています。
00175 {
00176 this.groupName = groupName;
00177 }
|
|
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 distributed request manager for this database.
org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseを再定義しています。 DistributedVirtualDatabase.java の 194 行で定義されています。
00195 { 00196 if (!(requestManager instanceof DistributedRequestManager)) 00197 throw new RuntimeException( 00198 "A distributed virtual database can only work with a distributed request manager."); 00199 this.requestManager = requestManager; 00200 } |
|
Sets a new SQL Monitor
VirtualDatabase.java の 1283 行で定義されています。
01284 {
01285 this.sqlMonitor = sqlMonitor;
01286 }
|
|
DistributedVirtualDatabase.java の 592 行で定義されています。
00593 { 00594 } |
|
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 } |
|
DistributedVirtualDatabase.java の 612 行で定義されています。 参照先 org.objectweb.cjdbc.common.log.Trace.warn().
00613 { 00614 logger.warn("Member " + suspectedMember + " is suspected of failure"); 00615 } |
|
DistributedVirtualDatabase.java の 620 行で定義されています。 参照先 org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabase.currentView, と org.objectweb.cjdbc.common.log.Trace.info().
00621 { 00622 Vector newMembers = newView.getMembers(); 00623 int newSize = newMembers.size(); 00624 for (int i = 0; i < newSize; i++) 00625 { 00626 Address addr = (Address) newMembers.get(i); 00627 if (!currentView.containsMember(addr)) 00628 logger.info("New controller " + addr + " detected."); 00629 } 00630 Vector currentMembers = currentView.getMembers(); 00631 int currentSize = currentMembers.size(); 00632 for (int i = 0; i < currentSize; i++) 00633 { 00634 Address addr = (Address) currentMembers.get(i); 00635 if (!newView.containsMember(addr)) 00636 { 00637 logger.info("Controller " + addr + " has failed."); 00638 00639 } 00640 } 00641 } |
|
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 } |
|
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(). |
|
backendName -> DistributedVirtualDatabase.java の 93 行で定義されています。 参照元 org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabase.addBackendRecoveryPolicy(), org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabase.DistributedVirtualDatabase(), org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabase.getBackendRecoveryPolicy(), と org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabase.getDistributionXml(). |
|
VirtualDatabase.java の 94 行で定義されています。 |
|
JGroups Address -> DistributedVirtualDatabase.java の 95 行で定義されています。 参照元 org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabase.broadcastBackendInformation(), org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabase.DistributedVirtualDatabase(), と org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabase.handle(). |
|
JGroups channel DistributedVirtualDatabase.java の 98 行で定義されています。 参照元 org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabase.finalize(), org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabase.getChannel(), org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabase.isLocalMessage(), と org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabase.joinGroup(). |
|
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(). |
|
DistributedVirtualDatabase.java の 101 行で定義されています。 参照元 org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabase.joinGroup(), と org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabase.viewAccepted(). |
|
MessageDispatcher to communicate with the group DistributedVirtualDatabase.java の 100 行で定義されています。 参照元 org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabase.broadcastBackendInformation(), org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabase.checkConfigurationCompatibility(), org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabase.getBackendStatus(), org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabase.getDispatcher(), と org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabase.joinGroup(). |
|
Group name DistributedVirtualDatabase.java の 91 行で定義されています。 |
|
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 行で定義されています。 |
|
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(). |