@Override public void finishException(Exception ex) { try { dsgtdb.getTxnSystem().getTxnMgr().finishExclusiveMode(); } catch (Exception ex2) { ex.addSuppressed(ex2); } }
/** * Return the {@link TransactionCoordinator} for a TDB2-backed DatasetGraph * or null, if not backed by TDB2. */ public static TransactionCoordinator getTransactionCoordinator(DatasetGraph dsg) { DatasetGraphTDB dsgtdb = getDatasetGraphTDB(dsg); if ( dsgtdb == null ) return null; return dsgtdb.getTxnSystem().getTxnMgr(); }
@Override public void startBulk() { // Lock everyone else out while we multithread. dsgtdb.getTxnSystem().getTxnMgr().startExclusiveMode(); super.startBulk(); // Set the data pipeline BulkProcesses.start(dataProcess); }
/** Use via {@link TDBInternal#expel} wherever possible. * <p> * Stop managing a location.<br/> * Use with great care (testing only). */ public static synchronized void internalExpel(Location location, boolean force) { StoreConnection sConn = cache.get(location) ; if (sConn == null) return ; TransactionCoordinator txnCoord = sConn.getDatasetGraphTDB().getTxnSystem().getTxnMgr(); if (!force && txnCoord.countActive() > 0 ) throw new TransactionException("Can't expel: Active transactions for location: " + location) ; // No transactions at this point // (or we don't care and are clearing up forcefully.) sConn.getDatasetGraphTDB().shutdown() ; // Done by DatasetGraphTDB() //txnCoord.shutdown(); sConn.isValid = false ; cache.remove(location) ; // Release the lock after the cache is emptied. if (SystemTDB.DiskLocationMultiJvmUsagePrevention && ! location.isMem() ) { if ( ! sConn.lock.isLockedHere() ) SystemTDB.errlog.warn("Location " + location.getDirectoryPath() + " was not locked by this process."); sConn.lock.unlock(); ProcessFileLock.release(sConn.lock); } }
throw new TDBException("Inconsistent datasets : "+dsgCurrent.getLocation()+" , "+dsgBase.getLocation()); TransactionalSystem txnSystem = dsgBase.getTxnSystem(); TransactionCoordinator txnMgr = dsgBase.getTxnSystem().getTxnMgr(); CopyDSG.copy(dsgBase, dsgCompact); TransactionCoordinator txnMgr2 = dsgCompact.getTxnSystem().getTxnMgr(); txnMgr2.startExclusiveMode();
@Override public void finishBulk() { // Close off the data pipeline BulkProcesses.finish(dataProcess); boolean doTriples = countTriples() != 0; boolean doQuads = countQuads() != 0 ; if ( doTriples ) { TupleIndex srcIdx3 = PhasedOps.findInIndexMap(loaderPlan.primaryLoad3()[0], indexMap); TupleIndex[][] indexSets3 = PhasedOps.indexSetsFromNames(loaderPlan.secondaryIndex3(), indexMap); executeSecondary(srcIdx3, indexSets3, dsgtdb, output); } if ( doQuads ) { TupleIndex srcIdx4 = PhasedOps.findInIndexMap(loaderPlan.primaryLoad4()[0], indexMap); TupleIndex[][] indexSets4 = PhasedOps.indexSetsFromNames(loaderPlan.secondaryIndex4(), indexMap); executeSecondary(srcIdx4, indexSets4, dsgtdb, output); } super.finishBulk(); dsgtdb.getTxnSystem().getTxnMgr().finishExclusiveMode(); }