The RM is composed of a Request Scheduler, an optional Query Cache, and a Load Balancer and an optional Recovery Log.
RequestManager.java の 78 行で定義されています。
|
|
Add a task to a BackendWorkerThread using the proper synchronization.
RequestManager.java の 1121 行で定義されています。 参照先 org.objectweb.cjdbc.controller.loadbalancer.BackendWorkerThread.addTask().
01122 {
01123 synchronized (bwt)
01124 {
01125 bwt.addTask(task);
01126 bwt.notify();
01127 }
01128 }
|
|
Check that Scheduler and Load Balancer are not null and have compatible RAIDb levels.
RequestManager.java の 211 行で定義されています。 参照先 org.objectweb.cjdbc.controller.loadbalancer.AbstractLoadBalancer.getRAIDbLevel(), org.objectweb.cjdbc.controller.scheduler.AbstractScheduler.getRAIDbLevel(), と org.objectweb.cjdbc.controller.requestmanager.RequestManager.scheduler. 参照元 org.objectweb.cjdbc.controller.requestmanager.RequestManager.RequestManager().
00214 { 00215 if (scheduler == null) 00216 throw new SQLException(Translate.get("requestmanager.null.scheduler")); 00217 00218 if (loadBalancer == null) 00219 throw new SQLException(Translate.get("requestmanager.null.loadbalancer")); 00220 00221 if (scheduler.getRAIDbLevel() != loadBalancer.getRAIDbLevel()) 00222 throw new SQLException(Translate.get( 00223 "requestmanager.incompatible.raidb.levels", 00224 new String[]{"" + scheduler.getRAIDbLevel(), 00225 "" + loadBalancer.getRAIDbLevel()})); 00226 00227 // requiredGranularity is the maximum of each component granularity 00228 this.scheduler = scheduler; 00229 schedulerParsingranularity = scheduler.getParsingGranularity(); 00230 requiredGranularity = schedulerParsingranularity; 00231 this.loadBalancer = loadBalancer; 00232 loadBalancerParsingranularity = loadBalancer.getParsingGranularity(); 00233 if (loadBalancerParsingranularity > requiredGranularity) 00234 requiredGranularity = loadBalancerParsingranularity; 00235 } |
|
Creates a new backup with the corresponding checkpoint Note that this will disable the backend for the time of the backup
RequestManager.java の 1408 行で定義されています。 参照先 org.objectweb.cjdbc.controller.core.backup.Octopus.backup().
01411 { 01412 // Sanity checks 01413 if (recoveryLog == null) 01414 { 01415 String msg = Translate.get("recovery.store.checkpoint.failed.cause.null", 01416 checkpointName); 01417 logger.error(msg); 01418 throw new SQLException(msg); 01419 } 01420 01421 // Wait for all pending transactions to finish 01422 logger.info(Translate.get("requestmanager.wait.pending.transactions")); 01423 scheduler.suspendNewTransactionsForCheckpoint(); 01424 scheduler.suspendWrites(); 01425 01426 // Disable backend if needed 01427 if (db.isReadEnabled()) 01428 { 01429 disableBackend(db); 01430 logger.info(Translate.get("backend.state.disabled", db.getName())); 01431 } 01432 01433 // Store checkpoint 01434 recoveryLog.storeCheckpoint(checkpointName); 01435 logger.info(Translate.get("recovery.checkpoint.stored", checkpointName)); 01436 01437 // Resume writes and transactions 01438 scheduler.resumeNewTransactions(); 01439 scheduler.resumeWrites(); 01440 01441 try 01442 { 01443 logger.info(Translate 01444 .get("controller.backup.octopus.start", db.getName())); 01445 Octopus octopus = new Octopus(db, checkpointName, tables); 01446 octopus.backup(); 01447 db.setLastKnownCheckpoint(checkpointName); 01448 } 01449 catch (OctopusException e) 01450 { 01451 logger.error(Translate.get("controller.backup.octopus.failed", e)); 01452 throw new SQLException(e.getMessage()); 01453 } 01454 catch (BackupException be) 01455 { 01456 logger.error(Translate.get("controller.backup.failed", be)); 01457 throw new SQLException(be.getMessage()); 01458 } 01459 logger.info(Translate.get("controller.backup.complete", db.getName())); 01460 01461 // if (enableAfter) 01462 // { 01463 // enableBackendFromCheckpoint(db,checkpointName); 01464 // } 01465 01466 } |
|
Begin a new transaction and return the corresponding transaction identifier. This method is called from the driver when setAutoCommit(false) is called.
org.objectweb.cjdbc.controller.requestmanager.distributed.DistributedRequestManagerで再定義されています。 RequestManager.java の 900 行で定義されています。 参照先 org.objectweb.cjdbc.controller.requestmanager.TransactionMarkerMetaData.setTransactionId().
00901 { 00902 try 00903 { 00904 TransactionMarkerMetaData tm = new TransactionMarkerMetaData(0, 00905 beginTimeout, login); 00906 00907 // Wait for the scheduler to give us the authorization to execute 00908 long tid = scheduler.begin(tm); 00909 tm.setTransactionId(tid); 00910 00911 if (logger.isDebugEnabled()) 00912 logger.debug(Translate.get("transaction.begin", String.valueOf(tid))); 00913 00914 try 00915 { 00916 // Send to load balancer 00917 loadBalancer.begin(tm); 00918 00919 // Log the begin 00920 if (recoveryLog != null) 00921 { 00922 recoveryLog.begin(tm); 00923 } 00924 } 00925 catch (SQLException e) 00926 { 00927 throw e; 00928 } 00929 finally 00930 { 00931 // Notify scheduler for completion in any case 00932 scheduler.beginCompleted(tid); 00933 } 00934 00935 tidLoginTable.put(new Long(tid), tm); 00936 return tid; 00937 } 00938 catch (RuntimeException e) 00939 { 00940 logger.fatal(Translate.get( 00941 "fatal.runtime.exception.requestmanager.begin", e)); 00942 throw new SQLException(e.getMessage()); 00943 } 00944 } |
|
Commit a transaction given its id.
org.objectweb.cjdbc.controller.requestmanager.distributed.DistributedRequestManagerで再定義されています。 RequestManager.java の 983 行で定義されています。 参照先 org.objectweb.cjdbc.controller.requestmanager.TransactionMarkerMetaData.getTransactionId().
00984 { 00985 try 00986 { 00987 Long tid = new Long(transactionId); 00988 TransactionMarkerMetaData tm = getTransactionMarker(tid); 00989 00990 // Wait for the scheduler to give us the authorization to execute 00991 scheduler.commit(tm); 00992 00993 if (logger.isDebugEnabled()) 00994 logger.debug(Translate.get("transaction.commit", String.valueOf(tid))); 00995 00996 try 00997 { 00998 // Send to load balancer 00999 loadBalancer.commit(tm); 01000 01001 // Notify the cache 01002 if (requestCache != null) 01003 requestCache.commit(tm.getTransactionId()); 01004 01005 // Notify the recovery log manager 01006 if (recoveryLog != null) 01007 recoveryLog.commit(tm); 01008 } 01009 catch (SQLException e) 01010 { 01011 throw e; 01012 } 01013 catch (AllBackendsFailedException e) 01014 { 01015 String msg = "All backends failed to commit transaction " 01016 + transactionId + " (" + e + ")"; 01017 logger.error(msg); 01018 throw new SQLException(msg); 01019 } 01020 finally 01021 { 01022 // Notify scheduler for completion 01023 scheduler.commitCompleted(transactionId); 01024 01025 completeTransaction(tid); 01026 } 01027 } 01028 catch (RuntimeException e) 01029 { 01030 logger.fatal(Translate.get( 01031 "fatal.runtime.exception.requestmanager.commit", e)); 01032 throw new SQLException(e.getMessage()); 01033 } 01034 } |
|
Complete the transaction by removing it for the tidLoginTable.
RequestManager.java の 972 行で定義されています。
00973 { 00974 tidLoginTable.remove(tid); 00975 } |
|
Disable a backend that is currently enabled on this virtual database. The backend is disabled without further check. The load balancer disabled method is called on the specified backend.
RequestManager.java の 1308 行で定義されています。
01309 { 01310 if (db.isReadEnabled() || db.isWriteEnabled()) 01311 { 01312 loadBalancer.disableBackend(db); 01313 logger.info(Translate.get("backend.state.disabled", db.getName())); 01314 } 01315 else 01316 { 01317 throw new SQLException(Translate.get("backend.already.disabled", db 01318 .getName())); 01319 } 01320 } |
|
The backend must belong to this virtual database and be in the enabled state. The backend is disabled once all the pending write queries are executed. A checkpoint is inserted in the recovery log.
RequestManager.java の 1333 行で定義されています。
01335 { 01336 ArrayList al = new ArrayList(1); 01337 al.add(db); 01338 this.disableBackendsForCheckpoint(al, checkpointName); 01339 } |
|
Disable a list of backends. Only to store only one checkpoint, and to disable all the backends at the same time so the the system is in a coherent state.
RequestManager.java の 1361 行で定義されています。 参照先 org.objectweb.cjdbc.controller.backend.DatabaseBackend.getName(), と org.objectweb.cjdbc.controller.backend.DatabaseBackend.setLastKnownCheckpoint().
01363 { 01364 // Sanity checks 01365 if (recoveryLog == null) 01366 { 01367 String msg = Translate.get("recovery.store.checkpoint.failed.cause.null", 01368 checkpointName); 01369 logger.error(msg); 01370 throw new SQLException(msg); 01371 } 01372 01373 // Wait for all pending transactions to finish 01374 logger.info(Translate.get("requestmanager.wait.pending.transactions")); 01375 scheduler.suspendNewTransactionsForCheckpoint(); 01376 scheduler.suspendWrites(); 01377 01378 // Store checkpoint 01379 recoveryLog.storeCheckpoint(checkpointName); 01380 logger.info(Translate.get("recovery.checkpoint.stored", checkpointName)); 01381 01382 // Disable all backends 01383 int size = backends.size(); 01384 DatabaseBackend db; 01385 for (int i = 0; i < size; i++) 01386 { 01387 db = (DatabaseBackend) backends.get(i); 01388 loadBalancer.disableBackend(db); 01389 db.setLastKnownCheckpoint(checkpointName); 01390 logger.info(Translate.get("backend.state.disabled", db.getName())); 01391 } 01392 01393 // Resume transactions and writes 01394 scheduler.resumeNewTransactions(); 01395 scheduler.resumeWrites(); 01396 } |
|
Enable a backend that has been previously added to this virtual database and that is in the disabled state. The backend is enabled without further check. The enableBackend method of the load balancer is called.
org.objectweb.cjdbc.controller.requestmanager.distributed.DistributedRequestManagerで再定義されています。 RequestManager.java の 1109 行で定義されています。
01110 { 01111 loadBalancer.enableBackend(db, true); 01112 logger.info(Translate.get("backend.state.enabled", db.getName())); 01113 } |
|
The backend must have been previously added to this virtual database and be in the disabled state. All the queries since the given checkpoint are played and the backend state is set to enabled when it is completely synchronized.
RequestManager.java の 1188 行で定義されています。 参照先 org.objectweb.cjdbc.controller.recoverylog.RecoveryTask.getId(), と org.objectweb.cjdbc.controller.recoverylog.RecoveryTask.getTask().
01190 { 01191 // Sanity check 01192 if (recoveryLog == null) 01193 { 01194 String msg = Translate.get( 01195 "recovery.restore.checkpoint.failed.cause.null", checkpointName); 01196 logger.error(msg); 01197 throw new SQLException(msg); 01198 } 01199 01200 db.initializeConnections(); 01201 recoveryLog.beginRecovery(); 01202 01203 // Get the checkpoint from the recovery log 01204 long logIdx; 01205 try 01206 { 01207 logIdx = recoveryLog.getCheckpointRequestId(checkpointName); 01208 } 01209 catch (SQLException e) 01210 { 01211 recoveryLog.endRecovery(); 01212 String msg = Translate.get("recovery.cannot.get.checkpoint", e); 01213 logger.error(msg); 01214 throw new SQLException(msg); 01215 } 01216 01217 // Get a temporary worker thread to execute the queries on this backend 01218 BackendWorkerThread bwt = new BackendWorkerThread(db, loadBalancer); 01219 bwt.start(); 01220 RecoveryTask recoveryTask = null; 01221 01222 logger.info(Translate.get("recovery.start.process")); 01223 01224 // Replay the whole log 01225 while (logIdx != -1) 01226 { 01227 try 01228 { 01229 recoveryTask = recoveryLog.recoverNextRequest(logIdx); 01230 } 01231 catch (SQLException e) 01232 { 01233 // Signal end of recovery and kill worker thread 01234 recoveryLog.endRecovery(); 01235 addWorkerTask(bwt, new KillThreadTask(1, 1)); 01236 String msg = Translate.get("recovery.cannot.recover.from.index", e); 01237 logger.error(msg); 01238 throw new SQLException(msg); 01239 } 01240 if (recoveryTask == null) 01241 break; 01242 addWorkerTask(bwt, recoveryTask.getTask()); 01243 logIdx = recoveryTask.getId(); 01244 } 01245 01246 // Suspend the writes 01247 scheduler.suspendWrites(); 01248 01249 // Play the remaining writes that were pending 01250 logIdx++; 01251 01252 while (logIdx != -1) 01253 { 01254 try 01255 { 01256 recoveryTask = recoveryLog.recoverNextRequest(logIdx); 01257 } 01258 catch (SQLException e) 01259 { 01260 // Signal end of recovery and kill worker thread 01261 recoveryLog.endRecovery(); 01262 addWorkerTask(bwt, new KillThreadTask(1, 1)); 01263 String msg = Translate.get("recovery.cannot.recover.from.index", e); 01264 logger.error(msg); 01265 scheduler.resumeWrites(); 01266 throw new SQLException(msg); 01267 } 01268 if (recoveryTask == null) 01269 break; 01270 addWorkerTask(bwt, recoveryTask.getTask()); 01271 logIdx = recoveryTask.getId(); 01272 } 01273 01274 // We are done with the recovery 01275 logger.info(Translate.get("recovery.process.complete")); 01276 addWorkerTask(bwt, new KillThreadTask(1, 1)); 01277 try 01278 { 01279 bwt.join(); 01280 } 01281 catch (InterruptedException e) 01282 { 01283 recoveryLog.endRecovery(); 01284 String msg = Translate.get("recovery.join.failed", e); 01285 logger.error(msg); 01286 scheduler.resumeWrites(); 01287 throw new SQLException(msg); 01288 } 01289 01290 recoveryLog.endRecovery(); 01291 01292 // Now enable it 01293 loadBalancer.enableBackend(db, true); 01294 scheduler.resumeWrites(); 01295 logger.info(Translate.get("backend.state.enabled", db.getName())); 01296 } |
|
Perform a read request and return the reply. Call first the scheduler (if defined), then the cache (if defined) and finally the load balancer.
RequestManager.java の 290 行で定義されています。 参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.execReadRequest().
00292 { 00293 // Sanity check 00294 if (!request.isAutoCommit()) 00295 { // Check that the transaction has been started 00296 long tid = request.getTransactionId(); 00297 if (!tidLoginTable.containsKey(new Long(tid))) 00298 throw new SQLException(Translate.get("transaction.not.started", tid)); 00299 } 00300 00301 // If we need to parse the request, try to get the parsing from the cache. 00302 // Note that if we have a cache miss but backgroundParsing has been turned 00303 // on, then this call will start a ParsedThread in background. 00304 if ((requiredGranularity != ParsingGranularities.NO_PARSING) 00305 && (!request.isParsed())) 00306 { 00307 if (parsingCache == null) 00308 request.parse(dbs, requiredGranularity, isCaseSensitiveParsing); 00309 else 00310 parsingCache.getParsingFromCache(request); 00311 } 00312 00313 // 00314 // SCHEDULER 00315 // 00316 00317 // Get the parsing now if the request is not yet parsed. The parsing is 00318 // handled by the ParsingCache that may already have parsed the request 00319 // in background (if backgroundParsing is set). 00320 if ((schedulerParsingranularity != ParsingGranularities.NO_PARSING) 00321 && !request.isParsed()) 00322 { 00323 if (parsingCache == null) 00324 request.parse(dbs, requiredGranularity, isCaseSensitiveParsing); 00325 else 00326 parsingCache.getParsingFromCacheAndParseIfMissing(request); 00327 } 00328 00329 // Wait for the scheduler to give us the authorization to execute 00330 scheduler.scheduleReadRequest(request); 00331 00332 if (logger.isDebugEnabled()) 00333 logger.debug(Translate.get("requestmanager.read.request", new String[]{ 00334 request.getId() + "", 00335 request.getSQLShortForm(vdb.getSQLShortFormLength())})); 00336 00337 // 00338 // CACHE 00339 // 00340 00341 ControllerResultSet result = null; 00342 try 00343 { // Check cache if any 00344 if (requestCache != null) 00345 { 00346 CacheEntry qce = requestCache.getFromCache(request, true); 00347 if (qce != null) 00348 { 00349 result = qce.getResult(); 00350 if (result != null) 00351 { // Cache hit ! 00352 if (vdb.getSQLMonitor() != null) 00353 vdb.getSQLMonitor().logCacheHit(request); 00354 00355 scheduler.readCompleted(request); 00356 return result; 00357 } 00358 } 00359 } 00360 00361 // 00362 // LOAD BALANCER 00363 // 00364 00365 // At this point, we have a result cache miss. 00366 // If we had a parsing cache miss too, wait for the parsing to be done if 00367 // needed. 00368 if ((loadBalancerParsingranularity != ParsingGranularities.NO_PARSING) 00369 && !request.isParsed()) 00370 { 00371 if (parsingCache == null) 00372 request.parse(dbs, requiredGranularity, isCaseSensitiveParsing); 00373 else 00374 parsingCache.getParsingFromCacheAndParseIfMissing(request); 00375 } 00376 00377 // Send the request to the load balancer 00378 result = new ControllerResultSet(request, loadBalancer 00379 .execReadRequest(request), metadataCache); 00380 00381 // 00382 // UPDATES & NOTIFICATIONS 00383 // 00384 00385 // Update cache 00386 if ((requestCache != null) 00387 && (request.getCacheAbility() != RequestType.UNCACHEABLE)) 00388 { 00389 if (!request.isParsed() 00390 && (cacheParsingranularity != ParsingGranularities.NO_PARSING)) 00391 { // The cache was the only one to need parsing and 00392 // the request was not previously in the cache 00393 { 00394 if (parsingCache == null) 00395 request.parse(dbs, requiredGranularity, isCaseSensitiveParsing); 00396 else 00397 parsingCache.getParsingFromCacheAndParseIfMissing(request); 00398 } 00399 } 00400 requestCache.addToCache(request, result); 00401 } 00402 } 00403 catch (Exception failed) 00404 { 00405 if (requestCache != null) 00406 requestCache.removeFromPendingQueries(request); 00407 scheduler.readCompleted(request); 00408 String msg = Translate.get("requestmanager.request.failed", new String[]{ 00409 request.getSQLShortForm(vdb.getSQLShortFormLength()), 00410 failed.getMessage()}); 00411 if (failed instanceof RuntimeException) 00412 logger.warn(msg, failed); 00413 else 00414 logger.warn(msg); 00415 throw new SQLException(msg); 00416 } 00417 00418 // Notify scheduler of completion 00419 scheduler.readCompleted(request); 00420 00421 return result; 00422 } |
|
Call a stored procedure that returns a ResultSet.
RequestManager.java の 702 行で定義されています。 参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.execReadStoredProcedure().
00704 { 00705 // Sanity check 00706 if (!proc.isAutoCommit()) 00707 { // Check that the transaction has been started 00708 long tid = proc.getTransactionId(); 00709 if (!tidLoginTable.containsKey(new Long(tid))) 00710 throw new SQLException(Translate.get("transaction.not.started", tid)); 00711 } 00712 00713 // 00714 // SCHEDULER 00715 // 00716 00717 // Note that no parsing is required for stored procedures. 00718 // We build a fake request that span over all tables to be sure 00719 // that the scheduler will lock everything. 00720 SelectRequest spanOnAllTables = null; 00721 if (requiredGranularity != ParsingGranularities.NO_PARSING) 00722 { 00723 String sql = "SELECT * FROM"; 00724 ArrayList tables = dbs.getTables(); 00725 int size = tables.size(); 00726 // The following code does not generate a syntaxically correct SQL 00727 // request (an extra coma at the beginning) but that is not an issue. 00728 for (int i = 0; i < size; i++) 00729 sql += " ," + ((DatabaseTable) tables.get(i)).getName(); 00730 00731 spanOnAllTables = new SelectRequest(sql, false, 0); 00732 } 00733 else 00734 spanOnAllTables = new SelectRequest("select * from x", false, 0); 00735 00736 // Wait for the scheduler to give us the authorization to execute 00737 scheduler.scheduleReadRequest(spanOnAllTables); 00738 00739 if (logger.isDebugEnabled()) 00740 logger.debug(Translate.get("requestmanager.read.store.procedure", 00741 new String[]{String.valueOf(proc.getId()), 00742 proc.getSQLShortForm(vdb.getSQLShortFormLength())})); 00743 00744 // 00745 // CACHE 00746 // 00747 00748 // Cache is always flushed unless the user has explicitely set the 00749 // connection to read-only mode in which case we assume that the 00750 // users deliberately forces the cache not to be flushed when calling 00751 // this stored procedure. 00752 if ((requestCache != null) && (!proc.isReadOnly())) 00753 requestCache.flushCache(); 00754 00755 ControllerResultSet result = null; 00756 try 00757 { 00758 // 00759 // LOAD BALANCER 00760 // 00761 00762 // Send the request to the load balancer 00763 if (proc.isReadOnly()) 00764 result = new ControllerResultSet(proc, loadBalancer 00765 .execReadOnlyReadStoredProcedure(proc), metadataCache); 00766 else 00767 result = new ControllerResultSet(proc, loadBalancer 00768 .execReadStoredProcedure(proc), metadataCache); 00769 00770 // 00771 // RECOVERY LOG 00772 // 00773 00774 if (recoveryLog != null) 00775 recoveryLog.logRequest(proc, true); 00776 00777 } 00778 catch (Exception failed) 00779 { 00780 scheduler.readCompleted(spanOnAllTables); 00781 String msg = Translate.get("requestmanager.store.procedure.failed", 00782 new String[]{proc.getSQLShortForm(vdb.getSQLShortFormLength()), 00783 failed.getMessage()}); 00784 logger.warn(msg); 00785 throw new SQLException(msg); 00786 } 00787 00788 // Notify scheduler of completion 00789 scheduler.readCompleted(spanOnAllTables); 00790 00791 return result; 00792 } |
|
Perform a write request and return the number of rows affected Call first the scheduler (if defined), then notify the cache (if defined) and finally call the load balancer.
org.objectweb.cjdbc.controller.requestmanager.distributed.DistributedRequestManagerで再定義されています。 RequestManager.java の 433 行で定義されています。 参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.execWriteRequest().
00434 { 00435 scheduleExecWriteRequest(request); 00436 int execWriteRequestResult = 0; 00437 try 00438 { 00439 execWriteRequestResult = loadBalanceExecWriteRequest(request); 00440 } 00441 catch (AllBackendsFailedException e) 00442 { 00443 logger.fatal(Translate 00444 .get("requestmanager.write.request.failed.unexpected"), e); 00445 } 00446 updateAndNotifyExecWriteRequest(request, true); 00447 return execWriteRequestResult; 00448 } |
|
Perform a write request and return the auto generated keys. Call first the scheduler (if defined), then notify the cache (if defined) and finally call the load balancer.
org.objectweb.cjdbc.controller.requestmanager.distributed.DistributedRequestManagerで再定義されています。 RequestManager.java の 459 行で定義されています。 参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.execWriteRequestWithKeys().
00461 { 00462 scheduleExecWriteRequest(request); 00463 ControllerResultSet execWriteRequestWithKeysResult = null; 00464 try 00465 { 00466 execWriteRequestWithKeysResult = loadBalanceExecWriteRequestWithKeys(request); 00467 } 00468 catch (AllBackendsFailedException e) 00469 { 00470 logger.fatal(Translate 00471 .get("requestmanager.write.request.keys.failed.unexpected"), e); 00472 } 00473 updateAndNotifyExecWriteRequest(request, true); 00474 return execWriteRequestWithKeysResult; 00475 } |
|
Call a stored procedure that performs an update.
org.objectweb.cjdbc.controller.requestmanager.distributed.DistributedRequestManagerで再定義されています。 RequestManager.java の 801 行で定義されています。
00802 { 00803 // Sanity check 00804 if (!proc.isAutoCommit()) 00805 { // Check that the transaction has been started 00806 long tid = proc.getTransactionId(); 00807 if (!tidLoginTable.containsKey(new Long(tid))) 00808 throw new SQLException(Translate.get("transaction.not.started", String 00809 .valueOf(tid))); 00810 } 00811 00812 // 00813 // SCHEDULER 00814 // 00815 00816 // Note that no parsing is required for stored procedures. 00817 // We build a fake request that span over all tables to be sure 00818 // that the scheduler will lock everything. 00819 SelectRequest spanOnAllTables = null; 00820 if (requiredGranularity != ParsingGranularities.NO_PARSING) 00821 { 00822 String sql = "SELECT * FROM"; 00823 ArrayList tables = dbs.getTables(); 00824 int size = tables.size(); 00825 // The following code does not generate a syntaxically correct SQL 00826 // request (an extra coma at the beginning) but that is not an issue. 00827 for (int i = 0; i < size; i++) 00828 sql += " ," + ((DatabaseTable) tables.get(i)).getName(); 00829 00830 spanOnAllTables = new SelectRequest(sql, false, 0); 00831 } 00832 else 00833 spanOnAllTables = new SelectRequest("select * from x", false, 0); 00834 00835 // Wait for the scheduler to give us the authorization to execute 00836 // We schedule a read even if it is a write because there is no 00837 // way to lock all tables for write in a single query. FIXME! 00838 scheduler.scheduleReadRequest(spanOnAllTables); 00839 00840 if (logger.isDebugEnabled()) 00841 logger.debug(Translate.get("requestmanager.read.store.procedure", 00842 new String[]{proc.getId() + "", 00843 proc.getSQLShortForm(vdb.getSQLShortFormLength())})); 00844 00845 // 00846 // CACHE 00847 // 00848 00849 // Flush cache if any 00850 if (requestCache != null) 00851 requestCache.flushCache(); 00852 00853 int result; 00854 try 00855 { 00856 // 00857 // LOAD BALANCER 00858 // 00859 00860 // Send the request to the load balancer 00861 result = loadBalancer.execWriteStoredProcedure(proc); 00862 00863 // 00864 // RECOVERY LOG 00865 // 00866 00867 if (recoveryLog != null) 00868 recoveryLog.logRequest(proc, false); 00869 00870 } 00871 catch (Exception failed) 00872 { 00873 scheduler.readCompleted(spanOnAllTables); 00874 String msg = Translate.get("requestmanager.store.procedure.failed", 00875 new String[]{proc.getSQLShortForm(vdb.getSQLShortFormLength()), 00876 failed.getMessage()}); 00877 logger.warn(msg); 00878 throw new SQLException(msg); 00879 } 00880 00881 // Notify scheduler of completion 00882 scheduler.readCompleted(spanOnAllTables); 00883 00884 return result; 00885 } |
|
Get the
RequestManager.java の 1583 行で定義されています。 参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMetaData.getDatabaseSchema(), org.objectweb.cjdbc.controller.cache.parsing.ParsingCache.getParsingFromCacheAndParseIfMissing(), org.objectweb.cjdbc.controller.virtualdatabase.protocol.VirtualDatabaseConfiguration.isCompatible(), と org.objectweb.cjdbc.controller.virtualdatabase.protocol.VirtualDatabaseConfiguration.VirtualDatabaseConfiguration().
01584 { 01585 return dbs; 01586 } |
|
Get the Request Load Balancer used in this Request Controller.
RequestManager.java の 1593 行で定義されています。 参照元 org.objectweb.cjdbc.controller.virtualdatabase.protocol.VirtualDatabaseConfiguration.isCompatible(), と org.objectweb.cjdbc.controller.virtualdatabase.protocol.VirtualDatabaseConfiguration.VirtualDatabaseConfiguration().
01594 { 01595 return loadBalancer; 01596 } |
|
Returns the metadataCache value.
RequestManager.java の 1627 行で定義されています。
01628 { 01629 return metadataCache; 01630 } |
|
Returns the Recovery Log Manager.
RequestManager.java の 1660 行で定義されています。
01661 { 01662 return recoveryLog; 01663 } |
|
RequestManager.java の 1729 行で定義されています。 参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.run().
01730 { 01731 return requiredGranularity; 01732 } |
|
Get the result cache (if any) used in this Request Manager.
RequestManager.java の 1617 行で定義されています。
01618 { 01619 return requestCache; 01620 } |
|
Get the Request Scheduler (if any) used in this Request Controller.
RequestManager.java の 1694 行で定義されています。 参照元 org.objectweb.cjdbc.controller.virtualdatabase.protocol.VirtualDatabaseConfiguration.isCompatible(), と org.objectweb.cjdbc.controller.virtualdatabase.protocol.VirtualDatabaseConfiguration.VirtualDatabaseConfiguration().
01695 { 01696 return scheduler; 01697 } |
|
Get the TransactionMarkerMetaData for the given transaction id.
RequestManager.java の 953 行で定義されています。 参照先 org.objectweb.cjdbc.controller.requestmanager.TransactionMarkerMetaData.setTimeout().
00955 { 00956 TransactionMarkerMetaData tm = (TransactionMarkerMetaData) tidLoginTable 00957 .get(tid); 00958 00959 if (tm == null) 00960 throw new SQLException(Translate.get("transaction.marker.not.found", "" 00961 + tid)); 00962 00963 tm.setTimeout(commitTimeout); 00964 return tm; 00965 } |
|
Returns the vdb value.
org.objectweb.cjdbc.controller.requestmanager.distributed.DistributedRequestManagerで再定義されています。 RequestManager.java の 1505 行で定義されています。 参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMetaData.getDatabaseSchema(), と org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMetaData.getTablePrivileges().
01506 { 01507 return vdb; 01508 } |
|
Get xml information about this Request Manager
RequestManager.java の 1743 行で定義されています。
01744 { 01745 StringBuffer info = new StringBuffer(); 01746 info.append("<" + DatabasesXmlTags.ELT_RequestManager + " " 01747 + DatabasesXmlTags.ATT_caseSensitiveParsing + "=\"" 01748 + isCaseSensitiveParsing + "\" " + DatabasesXmlTags.ATT_beginTimeout 01749 + "=\"" + beginTimeout / 1000 + "\" " 01750 + DatabasesXmlTags.ATT_commitTimeout + "=\"" + commitTimeout / 1000 01751 + "\" " + DatabasesXmlTags.ATT_rollbackTimeout + "=\"" 01752 + rollbackTimeout / 1000 + "\">"); 01753 if (scheduler != null) 01754 info.append(scheduler.getXml()); 01755 if (parsingCache != null) 01756 info.append(parsingCache.getXml()); 01757 if (requestCache != null) 01758 info.append(requestCache.getXml()); 01759 if (loadBalancer != null) 01760 info.append(loadBalancer.getXml()); 01761 if (recoveryLog != null) 01762 info.append(this.recoveryLog.getXml()); 01763 info.append("</" + DatabasesXmlTags.ELT_RequestManager + ">"); 01764 return info.toString(); 01765 } |
|
Replace all SQL macros with an instanciated value: - NOW() is replaced with a current timestamp. - RAND() is replaced with a random value
RequestManager.java の 270 行で定義されています。
00272 { 00273 String sql = MacrosHandler.macroNow(originalSql, timestampResolution); 00274 sql = MacrosHandler.macroCurrentTimestamp(sql, timestampResolution); 00275 00276 if (handleOnlyNow) 00277 return sql; 00278 00279 return MacrosHandler.macroRand(sql); 00280 } |
|
Method initRequestManagerVariables.
RequestManager.java の 245 行で定義されています。 参照先 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.getDatabaseName(). 参照元 org.objectweb.cjdbc.controller.requestmanager.RequestManager.RequestManager().
00247 { 00248 this.tidLoginTable = new Hashtable(); 00249 this.beginTimeout = beginTimeout; 00250 this.commitTimeout = commitTimeout; 00251 this.rollbackTimeout = rollbackTimeout; 00252 this.vdb = vdb; 00253 logger = Trace.getLogger("org.objectweb.cjdbc.controller.RequestManager." 00254 + vdb.getDatabaseName()); 00255 } |
|
Send the given query to the load balancer.
RequestManager.java の 597 行で定義されています。
00599 { 00600 int result; 00601 try 00602 { // Send the request to the load balancer 00603 if (request.isUpdate() && (requestCache != null)) 00604 { // Try the optimization if we try to update values that are already 00605 // up-to-date. 00606 if (!requestCache.isUpdateNecessary((UpdateRequest) request)) 00607 { 00608 scheduler.writeCompleted(request); 00609 return 0; 00610 } 00611 } 00612 return loadBalancer.execWriteRequest(request); 00613 } 00614 catch (Exception failed) 00615 { 00616 scheduler.writeCompleted(request); 00617 String msg = Translate.get("requestmanager.request.failed", new String[]{ 00618 request.getSQLShortForm(vdb.getSQLShortFormLength()), 00619 failed.getMessage()}); 00620 if (failed instanceof RuntimeException) 00621 logger.warn(msg, failed); 00622 else 00623 logger.warn(msg); 00624 if (failed instanceof AllBackendsFailedException) 00625 throw (AllBackendsFailedException) failed; 00626 else 00627 throw new SQLException(msg); 00628 } 00629 } |
|
Send the given query to the load balancer.
RequestManager.java の 561 行で定義されています。
00564 { 00565 int result; 00566 try 00567 { // Send the request to the load balancer 00568 return new ControllerResultSet(request, loadBalancer 00569 .execWriteRequestWithKeys(request), metadataCache); 00570 } 00571 catch (Exception failed) 00572 { 00573 scheduler.writeCompleted(request); 00574 String msg = Translate.get("requestmanager.request.failed", new String[]{ 00575 request.getSQLShortForm(vdb.getSQLShortFormLength()), 00576 failed.getMessage()}); 00577 if (failed instanceof RuntimeException) 00578 logger.warn(msg, failed); 00579 else 00580 logger.warn(msg); 00581 if (failed instanceof AllBackendsFailedException) 00582 throw (AllBackendsFailedException) failed; 00583 else 00584 throw new SQLException(msg); 00585 } 00586 } |
|
Merge the given schema with the existing database schema.
RequestManager.java の 1552 行で定義されています。
01553 { 01554 try 01555 { 01556 if (dbs == null) 01557 setDatabaseSchema(new DatabaseSchema(backendSchema), false); 01558 else 01559 { 01560 dbs.mergeSchema(backendSchema); 01561 logger.info(Translate 01562 .get("requestmanager.schema.virtualdatabase.merged.new")); 01563 01564 if (schedulerParsingranularity != ParsingGranularities.NO_PARSING) 01565 scheduler.mergeDatabaseSchema(dbs); 01566 01567 if (cacheParsingranularity != ParsingGranularities.NO_PARSING) 01568 requestCache.mergeDatabaseSchema(dbs); 01569 } 01570 } 01571 catch (SQLException e) 01572 { 01573 logger.error(Translate.get("requestmanager.schema.merge.failed", e 01574 .getMessage())); 01575 } 01576 } |
|
Remove a checkpoint and corresponding entries from the log table
RequestManager.java の 1347 行で定義されています。
01348 { 01349 recoveryLog.removeCheckpoint(checkpointName); 01350 } |
|
Recopy all the data of a previous dump recorded by octopus into the named backend. This disables the backend and leave it disable after recovery process. The user has to call the
RequestManager.java の 1141 行で定義されています。 参照先 org.objectweb.cjdbc.controller.core.backup.Octopus.restore().
01143 { 01144 01145 try 01146 { 01147 // no check for disable as we are going to overwrite 01148 // all the database data 01149 if (db.isReadEnabled()) 01150 loadBalancer.disableBackend(db); 01151 // Execute Recovery with octopus 01152 Octopus octopus = new Octopus(db, checkpointName); 01153 octopus.restore(); 01154 } 01155 catch (SQLException e1) 01156 { 01157 // This comes from the loadbalancer 01158 throw new BackupException(ExceptionTypes.BACKEND_CANNOT_BE_DISABLED); 01159 } 01160 catch (OctopusException e) 01161 { 01162 logger.error(Translate.get("controller.octopus.recovery.failed", e)); 01163 throw e; 01164 } 01165 catch (BackupException be) 01166 { 01167 logger.error(Translate.get("controller.backup.recovery.failed", be)); 01168 throw be; 01169 } 01170 finally 01171 { 01172 logger.info(Translate 01173 .get("controller.backup.recovery.done", db.getName())); 01174 } 01175 } |
|
Rollback a transaction given its id.
org.objectweb.cjdbc.controller.requestmanager.distributed.DistributedRequestManagerで再定義されています。 RequestManager.java の 1042 行で定義されています。
01043 { 01044 try 01045 { 01046 Long tid = new Long(transactionId); 01047 TransactionMarkerMetaData tm = getTransactionMarker(tid); 01048 01049 // Wait for the scheduler to give us the authorization to execute 01050 scheduler.rollback(tm); 01051 01052 if (logger.isDebugEnabled()) 01053 logger.debug(Translate.get("transaction.rollback", String 01054 .valueOf(transactionId))); 01055 01056 try 01057 { 01058 // Send to load balancer 01059 loadBalancer.rollback(tm); 01060 01061 // Notify the recovery log manager 01062 if (recoveryLog != null) 01063 { 01064 recoveryLog.rollback(tm); 01065 } 01066 } 01067 catch (SQLException e) 01068 { 01069 throw e; 01070 } 01071 catch (AllBackendsFailedException e) 01072 { 01073 String msg = Translate.get("requestmanager.rollback.failed.all", 01074 new String[]{String.valueOf(transactionId), e.getMessage()}); 01075 logger.error(msg); 01076 throw new SQLException(msg); 01077 } 01078 finally 01079 { 01080 // Notify scheduler for completion 01081 scheduler.rollbackCompleted(transactionId); 01082 01083 completeTransaction(tid); 01084 } 01085 } 01086 catch (RuntimeException e) 01087 { 01088 logger.fatal(Translate.get( 01089 "fatal.runtime.exception.requestmanager.rollback", e)); 01090 throw new SQLException(e.getMessage()); 01091 } 01092 } |
|
Schedule a request for execution.
RequestManager.java の 483 行で定義されています。
00485 { 00486 // Sanity check 00487 if (!request.isAutoCommit()) 00488 { // Check that the transaction has been started 00489 long tid = request.getTransactionId(); 00490 if (!tidLoginTable.containsKey(new Long(tid))) 00491 throw new SQLException(Translate.get("transaction.not.started", tid)); 00492 } 00493 00494 // If we need to parse the request, try to get the parsing from the cache. 00495 // Note that if we have a cache miss but backgroundParsing has been turned 00496 // on, then this call will start a ParsedThread in background. 00497 if ((requiredGranularity != ParsingGranularities.NO_PARSING) 00498 && (!request.isParsed())) 00499 { 00500 if (parsingCache == null) 00501 request.parse(dbs, requiredGranularity, isCaseSensitiveParsing); 00502 else 00503 parsingCache.getParsingFromCache(request); 00504 } 00505 00506 // 00507 // SCHEDULER 00508 // 00509 00510 // Get the parsing now if the request is not yet parsed. The parsing is 00511 // handled by the ParsingCache that may already have parsed the request 00512 // in background (if backgroundParsing is set). 00513 if ((schedulerParsingranularity != ParsingGranularities.NO_PARSING) 00514 && !request.isParsed()) 00515 { 00516 if (parsingCache == null) 00517 request.parse(dbs, requiredGranularity, isCaseSensitiveParsing); 00518 else 00519 parsingCache.getParsingFromCacheAndParseIfMissing(request); 00520 } 00521 00522 // Wait for the scheduler to give us the authorization to execute 00523 try 00524 { 00525 scheduler.scheduleWriteRequest(request); 00526 } 00527 catch (RollbackException e) 00528 { // Something bad happened and we need to rollback this transaction 00529 rollback(request.getTransactionId()); 00530 throw new SQLException(e.getMessage()); 00531 } 00532 00533 if (logger.isDebugEnabled()) 00534 logger.debug(Translate.get("requestmanager.write.request", new String[]{ 00535 String.valueOf(request.getId()), 00536 request.getSQLShortForm(vdb.getSQLShortFormLength())})); 00537 00538 // If we have a parsing cache miss, wait for the parsing to be done if 00539 // needed. Note that even if the cache was the only one to require parsing, 00540 // we wait for the parsing result here, because if it fails, we must not 00541 // execute the query. 00542 if ((requiredGranularity != ParsingGranularities.NO_PARSING) 00543 && !request.isParsed()) 00544 { 00545 if (parsingCache == null) 00546 request.parse(dbs, requiredGranularity, isCaseSensitiveParsing); 00547 else 00548 parsingCache.getParsingFromCacheAndParseIfMissing(request); 00549 } 00550 } |
|
Retrieve the last known checkpoint from the recovery log and set it for each backend. RequestManager.java の 175 行で定義されています。 参照先 org.objectweb.cjdbc.common.log.Trace.error(), org.objectweb.cjdbc.controller.recoverylog.AbstractRecoveryLog.getBackendCheckpoint(), org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.getBackends(), org.objectweb.cjdbc.controller.backend.DatabaseBackend.getName(), org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.getName(), org.objectweb.cjdbc.controller.requestmanager.RequestManager.recoveryLog, と org.objectweb.cjdbc.controller.backend.DatabaseBackend.setLastKnownCheckpoint(). 参照元 org.objectweb.cjdbc.controller.requestmanager.RequestManager.RequestManager().
00176 { 00177 00178 if (recoveryLog == null) 00179 return; 00180 String databaseName = vdb.getName(); 00181 ArrayList backends = vdb.getBackends(); 00182 int size = backends.size(); 00183 DatabaseBackend backend; 00184 String checkpoint; 00185 for (int i = 0; i < size; i++) 00186 { 00187 backend = (DatabaseBackend) backends.get(i); 00188 try 00189 { 00190 checkpoint = recoveryLog.getBackendCheckpoint(databaseName, backend 00191 .getName()); 00192 backend.setLastKnownCheckpoint(checkpoint); 00193 } 00194 catch (SQLException e) 00195 { 00196 logger.error(Translate.get("requestmanager.checkpoint.not.found", 00197 backend.getName()), e); 00198 } 00199 } 00200 00201 } |
|
Sets the parsing case sensitivity. If true the request are parsed in a case sensitive way (table/column name must match exactly the case of the names fetched from the database or enforced by a static schema).
RequestManager.java の 1719 行で定義されています。 参照元 org.objectweb.cjdbc.controller.xml.DatabasesParser.endElement().
01720 { 01721 this.isCaseSensitiveParsing = isCaseSensitiveParsing; 01722 if (parsingCache != null) 01723 parsingCache.setCaseSensitiveParsing(isCaseSensitiveParsing); 01724 } |
|
Sets the
RequestManager.java の 1517 行で定義されています。
01518 { 01519 if (schemaIsStatic) 01520 { 01521 if (isStatic) 01522 { 01523 logger.warn(Translate 01524 .get("requestmanager.schema.replace.static.with.new")); 01525 this.dbs = schema; 01526 } 01527 else 01528 logger.info(Translate.get("requestmanager.schema.ignore.new.dynamic")); 01529 } 01530 else 01531 { 01532 schemaIsStatic = isStatic; 01533 this.dbs = schema; 01534 logger.info(Translate 01535 .get("requestmanager.schema.set.new.virtualdatabase")); 01536 } 01537 01538 if (schedulerParsingranularity != ParsingGranularities.NO_PARSING) 01539 scheduler.setDatabaseSchema(dbs); 01540 01541 if (cacheParsingranularity != ParsingGranularities.NO_PARSING) 01542 requestCache.setDatabaseSchema(dbs); 01543 01544 // Load balancers do not have a specific database schema to update 01545 } |
|
Set the Request Load Balancer to use in this Request Controller.
RequestManager.java の 1603 行で定義されています。 参照先 org.objectweb.cjdbc.controller.loadbalancer.AbstractLoadBalancer.getParsingGranularity().
01604 { 01605 this.loadBalancer = loadBalancer; 01606 loadBalancerParsingranularity = loadBalancer.getParsingGranularity(); 01607 if (loadBalancerParsingranularity > requiredGranularity) 01608 requiredGranularity = loadBalancerParsingranularity; 01609 } |
|
Sets the metadataCache value.
RequestManager.java の 1637 行で定義されています。 参照元 org.objectweb.cjdbc.controller.xml.DatabasesParser.endElement().
01638 {
01639 this.metadataCache = metadataCache;
01640 }
|
|
Sets the ParsingCache.
RequestManager.java の 1647 行で定義されています。 参照先 org.objectweb.cjdbc.controller.cache.parsing.ParsingCache.setCaseSensitiveParsing(), org.objectweb.cjdbc.controller.cache.parsing.ParsingCache.setGranularity(), と org.objectweb.cjdbc.controller.cache.parsing.ParsingCache.setRequestManager(). 参照元 org.objectweb.cjdbc.controller.xml.DatabasesParser.endElement().
01648 { 01649 parsingCache.setRequestManager(this); 01650 parsingCache.setGranularity(requiredGranularity); 01651 parsingCache.setCaseSensitiveParsing(isCaseSensitiveParsing); 01652 this.parsingCache = parsingCache; 01653 } |
|
Sets the Recovery Log Manager.
RequestManager.java の 1670 行で定義されています。
01671 {
01672 this.recoveryLog = recoveryLog;
01673 }
|
|
Set the Request Cache to use in this Request Controller.
RequestManager.java の 1680 行で定義されています。 参照先 org.objectweb.cjdbc.controller.cache.result.AbstractResultCache.getParsingGranularity().
01681 { 01682 requestCache = cache; 01683 cacheParsingranularity = cache.getParsingGranularity(); 01684 if (cacheParsingranularity > requiredGranularity) 01685 requiredGranularity = cacheParsingranularity; 01686 } |
|
Set the Request Scheduler to use in this Request Controller.
RequestManager.java の 1704 行で定義されています。 参照先 org.objectweb.cjdbc.controller.scheduler.AbstractScheduler.getParsingGranularity().
01705 { 01706 this.scheduler = scheduler; 01707 schedulerParsingranularity = scheduler.getParsingGranularity(); 01708 if (schedulerParsingranularity > requiredGranularity) 01709 requiredGranularity = schedulerParsingranularity; 01710 } |
|
Store all the backends checkpoint in the recoverylog
RequestManager.java の 1474 行で定義されています。 参照先 org.objectweb.cjdbc.controller.backend.DatabaseBackend.getLastKnownCheckpoint(), と org.objectweb.cjdbc.controller.backend.DatabaseBackend.getName().
01475 { 01476 if (recoveryLog == null) 01477 return; 01478 int size = backends.size(); 01479 DatabaseBackend backend; 01480 for (int i = 0; i < size; i++) 01481 { 01482 backend = (DatabaseBackend) backends.get(i); 01483 try 01484 { 01485 recoveryLog.storeBackendCheckpoint(databaseName, backend.getName(), 01486 backend.getLastKnownCheckpoint()); 01487 } 01488 catch (SQLException e) 01489 { 01490 logger.error(Translate.get("recovery.store.checkpoint.failed", 01491 new String[]{backend.getName(), e.getMessage()})); 01492 } 01493 } 01494 } |
|
Update the cache, notify the recovery log and finally the scheduler. It is possible to disable scheduler notifications (unless an error occurs in which case the scheduler is always notified). This is especially useful for distributed schedulers when all backends failed at one controller but we have to wait for the confirmation that all other controllers failed. This piece of code is then generic and reusable.
RequestManager.java の 643 行で定義されています。 参照先 org.objectweb.cjdbc.common.sql.AbstractWriteRequest.getTableName().
00645 { 00646 try 00647 { // Notify cache if any 00648 if (requestCache != null) 00649 { // Update cache 00650 requestCache.writeNotify(request); 00651 } 00652 00653 // Log the request 00654 if (recoveryLog != null) 00655 recoveryLog.logRequest(request); 00656 00657 // Update the schema if needed 00658 if (requiredGranularity != ParsingGranularities.NO_PARSING) 00659 { 00660 if (request.isCreate()) 00661 { // Add the table to the schema 00662 dbs.addTable(((CreateRequest) request).getDatabaseTable()); 00663 if (logger.isDebugEnabled()) 00664 logger.debug(Translate.get("requestmanager.schema.add.table", 00665 request.getTableName())); 00666 } 00667 else if (request.isDrop()) 00668 { // Delete the table from the schema 00669 dbs.removeTable(dbs.getTable(request.getTableName())); 00670 if (logger.isDebugEnabled()) 00671 logger.debug(Translate.get("requestmanager.schema.remove.table", 00672 request.getTableName())); 00673 } 00674 } 00675 00676 // Notify scheduler 00677 if (notifyScheduler) 00678 scheduler.writeCompleted(request); 00679 00680 } 00681 catch (Exception failed) 00682 { 00683 scheduler.writeCompleted(request); 00684 String msg = Translate.get("requestmanager.request.failed", new String[]{ 00685 request.getSQLShortForm(vdb.getSQLShortFormLength()), 00686 failed.getMessage()}); 00687 if (failed instanceof RuntimeException) 00688 logger.warn(msg, failed); 00689 else 00690 logger.warn(msg); 00691 throw new SQLException(msg); 00692 } 00693 } |
|
begin timeout in ms RequestManager.java の 93 行で定義されています。 参照元 org.objectweb.cjdbc.controller.requestmanager.RequestManager.RequestManager(). |
|
RequestManager.java の 124 行で定義されています。 参照元 org.objectweb.cjdbc.controller.requestmanager.RequestManager.RequestManager(). |
|
commit timeout in ms RequestManager.java の 95 行で定義されています。 参照元 org.objectweb.cjdbc.controller.requestmanager.RequestManager.RequestManager(). |
|
RequestManager.java の 115 行で定義されています。 |
|
RequestManager.java の 117 行で定義されています。 |
|
The request load balancer to use to send requests to the databases RequestManager.java の 109 行で定義されています。 |
|
RequestManager.java の 125 行で定義されています。 |
|
RequestManager.java の 130 行で定義されています。 |
|
RequestManager.java の 119 行で定義されています。 |
|
RequestManager.java の 118 行で定義されています。 |
|
An optional recovery log RequestManager.java の 112 行で定義されています。 参照元 org.objectweb.cjdbc.controller.requestmanager.RequestManager.RequestManager(), と org.objectweb.cjdbc.controller.requestmanager.RequestManager.setBackendsLastKnownCheckpointFromRecoveryLog(). |
|
An optional request cache to cache responses to SQL requests RequestManager.java の 106 行で定義されています。 参照元 org.objectweb.cjdbc.controller.requestmanager.RequestManager.RequestManager(). |
|
RequestManager.java の 126 行で定義されています。 参照元 org.objectweb.cjdbc.controller.requestmanager.RequestManager.RequestManager(). |
|
rollback timeout in ms RequestManager.java の 97 行で定義されています。 参照元 org.objectweb.cjdbc.controller.requestmanager.RequestManager.RequestManager(). |
|
The request scheduler to order and schedule requests RequestManager.java の 103 行で定義されています。 参照元 org.objectweb.cjdbc.controller.requestmanager.RequestManager.assignAndCheckSchedulerLoadBalancerValidity(), と org.objectweb.cjdbc.controller.requestmanager.RequestManager.RequestManager(). |
|
RequestManager.java の 123 行で定義されています。 |
|
RequestManager.java の 116 行で定義されています。 |
|
Transaction id/Login mapping RequestManager.java の 128 行で定義されています。 |
|
The virtual database owning this Request Manager RequestManager.java の 100 行で定義されています。 |