use of org.apache.jena.tdb.base.record.Record in project jena by apache.
the class TestRecordBuffer method recBufferIterate05.
@Test
public void recBufferIterate05() {
RecordBuffer rb = make(3, 5);
Iterator<Record> iter = rb.iterator(intToRecord(1), null);
same(iter, 2, 4, 6);
}
use of org.apache.jena.tdb.base.record.Record in project jena by apache.
the class TestRecordBuffer method recBufferIterate02.
@Test
public void recBufferIterate02() {
RecordBuffer rb = make(3, 5);
Iterator<Record> iter = rb.iterator();
same(iter, 2, 4, 6);
}
use of org.apache.jena.tdb.base.record.Record in project jena by apache.
the class TestRecordBuffer method recBufferIterate04.
@Test
public void recBufferIterate04() {
RecordBuffer rb = make(3, 5);
Iterator<Record> iter = rb.iterator(intToRecord(3), null);
same(iter, 4, 6);
}
use of org.apache.jena.tdb.base.record.Record in project jena by apache.
the class TestRecordBuffer method recBufferIterate10.
@Test
public void recBufferIterate10() {
RecordBuffer rb = make(5, 5);
Iterator<Record> iter = rb.iterator(intToRecord(4), intToRecord(8));
same(iter, 4, 6);
}
use of org.apache.jena.tdb.base.record.Record in project jena by apache.
the class ProcRewriteIndex method exec.
public static void exec(Location srcLoc, Location dstLoc, String indexName) {
FileSet destination = new FileSet(dstLoc, indexName);
int readCacheSize = 0;
int writeCacheSize = -1;
int dftKeyLength;
int dftValueLength;
if (indexName.length() == 3) {
dftKeyLength = SystemTDB.LenIndexTripleRecord;
dftValueLength = 0;
} else if (indexName.length() == 4) {
dftKeyLength = SystemTDB.LenIndexQuadRecord;
dftValueLength = 0;
} else {
System.err.printf("Can't determine record size for %s\n", indexName);
return;
}
RecordFactory recordFactory = null;
BPlusTreeParams bptParams = null;
BlockMgr blkMgrNodes;
BlockMgr blkMgrRecords;
int blockSize = SystemTDB.BlockSize;
RangeIndex rangeIndex = SetupIndex.makeRangeIndex(srcLoc, indexName, blockSize, dftKeyLength, dftValueLength, readCacheSize, writeCacheSize);
BPlusTree bpt = (BPlusTree) rangeIndex;
bptParams = bpt.getParams();
recordFactory = bpt.getRecordFactory();
int blockSizeNodes = blockSize;
int blockSizeRecords = blockSize;
blkMgrNodes = BlockMgrFactory.create(destination, Names.bptExtTree, blockSizeNodes, readCacheSize, writeCacheSize);
blkMgrRecords = BlockMgrFactory.create(destination, Names.bptExtRecords, blockSizeRecords, readCacheSize, writeCacheSize);
Iterator<Record> iterator = bpt.iterator();
// // Fakery.
// blkMgrNodes = BlockMgrFactory.create(destination, Names.bptExt1, blockSize, readCacheSize, writeCacheSize) ;
// blkMgrRecords = BlockMgrFactory.create(destination, Names.bptExt2, blockSize, readCacheSize, writeCacheSize) ;
// recordFactory = new RecordFactory(dftKeyLength, dftValueLength) ;
// bptParams = new BPlusTreeParams(3, recordFactory) ;
// List<Record> data = TestBPlusTreeRewriter.createData(10, recordFactory) ;
// iterator = data.iterator() ;
//System.out.println("Rewrite: "+srcLoc+" "+indexName+" --> "+destination) ;
BPlusTree bpt2 = BPlusTreeRewriter.packIntoBPlusTree(iterator, bptParams, recordFactory, blkMgrNodes, blkMgrRecords);
if (bpt2 == null)
return;
//
// Iterator<Record> iter = bpt2.iterator() ;
// for ( ; iter.hasNext() ; )
// {
// Record r = iter.next() ;
// System.out.println(r) ;
// }
bpt2.close();
}
Aggregations