/** Make a node table overriding the node->id and id->node table names */ private NodeTable makeNodeTable$(Location location, String indexNode2Id, String indexId2Node, StoreParams params) { FileSet fsNodeToId = new FileSet(location, indexNode2Id) ; FileSet fsId2Node = new FileSet(location, indexId2Node) ; NodeTable nt = /*nodeTableBuilder.*/buildNodeTable(fsNodeToId, fsId2Node, params) ; return nt ; }
private ObjectFile determineNodeTable(Location loc) { // Directly open the nodes.dat file. StoreParams storeParams = StoreParams.getDftStoreParams(); FileSet fsId2Node = new FileSet(loc, storeParams.getIndexId2Node()) ; String file = fsId2Node.filename(Names.extNodeData); ObjectFile objFile = FileFactory.createObjectFileDisk(file); return objFile; }
public static RangeIndex buildRangeIndexMem(RecordFactory recordFactory) { FileSet fileSet = FileSet.mem() ; return buildRangeIndex(fileSet, recordFactory) ; }
private static BlockMgr create(FileSet fileSet, String ext, FileMode fileMode, int blockSize, int readBlockCacheSize, int writeBlockCacheSize) { if ( fileSet.isMem() ) return createMem(fileSet.filename(ext), blockSize) ; else return createFile(fileSet.filename(ext), fileMode, blockSize, readBlockCacheSize, writeBlockCacheSize) ; }
@Override public String toString() { return "FileSet:"+filename(null) ; }
/** Create a FileSet given Location (directory) and name within the directory */ public FileSet(Location directory, String basename) { initFileSet(directory, basename) ; }
/** Create a B+Tree using defaults */ public static RangeIndex createBPTree(FileSet fileset, RecordFactory factory) { int readCacheSize = SystemTDB.BlockReadCacheSize ; int writeCacheSize = SystemTDB.BlockWriteCacheSize ; int blockSize = SystemTDB.BlockSize ; if ( fileset.isMem() ) { readCacheSize = 0 ; writeCacheSize = 0 ; blockSize = SystemTDB.BlockSizeTest ; } return createBPTreeByBlockSize(fileset, blockSize, readCacheSize, writeCacheSize, factory) ; }
public static ObjectFile makeObjectFile(FileSet fsIdToNode) { String filename = fsIdToNode.filename(Names.extNodeData) ; ObjectFile objFile = FileFactory.createObjectFileDisk(filename); return objFile ; }
private void initFileSet(Location directory, String basename) { // Default - don't use the locations metadata initFileSet(directory, basename, false) ; }
/** * Add a caching layer to a BlockMgr if appropriate. This does not make * sense for memory BlockMgr or for memory mapper files. These are skipped. */ public static BlockMgr addCache(BlockMgr blockMgr, FileSet fileSet, FileMode fileMode, int readBlockCacheSize, int writeBlockCacheSize) { if ( fileSet.isMem() ) return blockMgr ; if ( fileMode == null ) fileMode = SystemTDB.fileMode() ; if ( fileMode == FileMode.mapped ) return blockMgr ; return addCache(blockMgr, readBlockCacheSize, writeBlockCacheSize) ; }
public static Index buildIndexMem(RecordFactory recordFactory) { FileSet fileSet = FileSet.mem() ; return buildIndex(fileSet, recordFactory) ; }
public static RangeIndex makeRangeIndex(Location location, String indexName, int blkSize, int dftKeyLength, int dftValueLength, int readCacheSize,int writeCacheSize) { FileSet fs = new FileSet(location, indexName) ; RangeIndex rIndex = makeBPlusTree(fs, blkSize, readCacheSize, writeCacheSize, dftKeyLength, dftValueLength) ; return rIndex ; }
private ObjectFile determineNodeTable(Location loc) { // Directly open the nodes.dat file. StoreParams storeParams = StoreParams.getDftStoreParams(); FileSet fsId2Node = new FileSet(loc, storeParams.getIndexId2Node()) ; String file = fsId2Node.filename(Names.extNodeData); ObjectFile objFile = FileFactory.createObjectFileDisk(file); return objFile; }
public boolean exists(String ext) { if ( location.isMem() ) return true ; String fn = filename(ext) ; File f = new File(fn) ; if ( f.isDirectory() ) log.warn("File clashes with a directory") ; return f.exists() && f.isFile() ; }
/** Create a FileSet given Location (directory) and name within the directory */ public FileSet(String directory, String basename) { initFileSet(Location.create(directory), basename) ; }
static TupleIndexRecord create(String description) { IndexParams indexParams = StoreParams.getDftStoreParams() ; RangeIndex rIdx = IndexFactory.buildRangeIndex(FileSet.mem(), factory, indexParams) ; ColumnMap cmap = new ColumnMap("SPO", description) ; TupleIndexRecord index = new TupleIndexRecord(3, cmap, description, factory, rIdx) ; return index ; }
public static RangeIndex buildRangeIndex(Location location, String indexName, RecordFactory recordFactory) { FileSet fileset = new FileSet(location, indexName) ; return buildRangeIndex(fileset, recordFactory) ; }
static public FileRef create(FileSet fileSet, String ext) { return create(fileSet.filename(ext)) ; }
/** Create a FileSet given Location (directory) and name within the directory */ public FileSet(String filename) { Tuple<String> t = FileOps.splitDirFile(filename) ; String dir = t.get(0) ; String fn = t.get(1) ; if ( dir == null ) dir = "." ; initFileSet(Location.create(dir), fn) ; }