@Override public Context getContext() { // Not the transactional dataset. return getBaseDatasetGraph().getContext() ; }
public BlockMgrJournal(Transaction txn, FileRef fileRef, BlockMgr underlyingBlockMgr) { Context context = txn.getBaseDataset().getContext() ; String mode = (null != context) ? (String) context.get(TDB.transactionJournalWriteBlockMode, "") : "" ; if ("direct".equalsIgnoreCase(mode)) writeBlockBufferAllocator = new BufferAllocatorDirect() ; else if ("mapped".equalsIgnoreCase(mode)) writeBlockBufferAllocator = new BufferAllocatorMapped(SystemTDB.BlockSize) ; else writeBlockBufferAllocator = new BufferAllocatorMem() ; reset(txn, fileRef, underlyingBlockMgr) ; if ( txn.getTxnMode() == ReadWrite.READ && underlyingBlockMgr instanceof BlockMgrJournal ) System.err.println("Two level BlockMgrJournal") ; }
private DatasetGraphTDB buildWritable() { BlockMgrBuilder blockMgrBuilder = new BlockMgrBuilderTx() ; ObjectFileBuilder objectFileBuilder = new ObjectFileBuilderTx(); DatasetBuilderStd x = new DatasetBuilderStd(blockMgrBuilder, objectFileBuilder); DatasetGraphTDB dsg2 = x._build(dsg.getLocation(), dsg.getConfig().params, true, dsg.getReorderTransform()) ; dsg2.getContext().putAll(dsg.getContext()) ; return dsg2 ; }
DatasetGraphTxn build(Transaction txn, ReadWrite mode) { this.txn = txn; DatasetGraphTDB dsgTDB ; switch(mode) { case READ : dsgTDB = buildReadonly() ; break ; case WRITE : dsgTDB = buildWritable() ; break ; default: dsgTDB = null ; } DatasetGraphTxn dsgTxn = new DatasetGraphTxn(dsgTDB, txn) ; // Copy context. Changes not propagated back to the base dataset. dsgTxn.getContext().putAll(dsg.getContext()) ; return dsgTxn ; }
private synchronized DatasetGraphTDB buildWorker(Location location, boolean writeable, ReorderTransformation _transform, StoreParams params) { recorder.start() ; DatasetControl policy = createConcurrencyPolicy() ; NodeTable nodeTable = makeNodeTable(location, params) ; TripleTable tripleTable = makeTripleTable(location, nodeTable, policy, params) ; QuadTable quadTable = makeQuadTable(location, nodeTable, policy, params) ; DatasetPrefixesTDB prefixes = makePrefixTable(location, policy, params) ; ReorderTransformation transform = (_transform == null) ? chooseReorderTransformation(location) : _transform ; StorageConfig storageConfig = new StorageConfig(location, params, writeable, recorder.blockMgrs, recorder.objectFiles, recorder.bufferChannels) ; recorder.finish() ; DatasetGraphTDB dsg = new DatasetGraphTDB(tripleTable, quadTable, prefixes, transform, storageConfig) ; // TDB does filter placement on BGPs itself. dsg.getContext().set(ARQ.optFilterPlacementBGP, false) ; QC.setFactory(dsg.getContext(), OpExecutorTDB1.OpExecFactoryTDB) ; return dsg ; }