You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2014/12/02 17:16:46 UTC
jena git commit: Add new build method for TupleIndexes
Repository: jena
Updated Branches:
refs/heads/master 2314c1973 -> 182ea9702
Add new build method for TupleIndexes
Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/182ea970
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/182ea970
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/182ea970
Branch: refs/heads/master
Commit: 182ea97024807a3947e30ce145efeeb1a06dc374
Parents: 2314c19
Author: Andy Seaborne <an...@apache.org>
Authored: Tue Dec 2 16:16:41 2014 +0000
Committer: Andy Seaborne <an...@apache.org>
Committed: Tue Dec 2 16:16:41 2014 +0000
----------------------------------------------------------------------
.../java/com/hp/hpl/jena/tdb/setup/Build.java | 22 ++++++++------------
1 file changed, 9 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jena/blob/182ea970/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/Build.java
----------------------------------------------------------------------
diff --git a/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/Build.java b/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/Build.java
index b23d804..daa31ba 100644
--- a/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/Build.java
+++ b/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/Build.java
@@ -18,21 +18,14 @@
package com.hp.hpl.jena.tdb.setup;
-import org.apache.jena.atlas.lib.ColumnMap ;
import org.slf4j.Logger ;
import org.slf4j.LoggerFactory ;
import com.hp.hpl.jena.tdb.TDBFactory ;
-import com.hp.hpl.jena.tdb.base.file.FileSet ;
import com.hp.hpl.jena.tdb.base.file.Location ;
-import com.hp.hpl.jena.tdb.base.record.RecordFactory ;
-import com.hp.hpl.jena.tdb.index.IndexFactory ;
-import com.hp.hpl.jena.tdb.index.IndexParams ;
-import com.hp.hpl.jena.tdb.index.RangeIndex ;
import com.hp.hpl.jena.tdb.store.DatasetPrefixesTDB ;
import com.hp.hpl.jena.tdb.store.nodetable.NodeTable ;
import com.hp.hpl.jena.tdb.store.tupletable.TupleIndex ;
-import com.hp.hpl.jena.tdb.store.tupletable.TupleIndexRecord ;
import com.hp.hpl.jena.tdb.sys.DatasetControl ;
/** Building datastructures on top of the base file
@@ -44,6 +37,14 @@ public class Build
private static Logger log = LoggerFactory.getLogger(Build.class) ;
private static StoreParams params = StoreParams.getDftStoreParams() ;
+ public static TupleIndex openTupleIndex(Location loc, String indexName, String primary, String indexOrder) {
+ return openTupleIndex(loc, indexName, primary, indexOrder, params) ;
+ }
+
+ public static TupleIndex openTupleIndex(Location location, String indexName, String primary, String indexOrder, StoreParams params) {
+ return DatasetBuilderStd.stdBuilder().makeTupleIndex(location, indexName, primary, indexOrder, params) ;
+ }
+
public static TupleIndex openTupleIndex(Location location, String indexName, String primary, String indexOrder, int readCacheSize, int writeCacheSize, int dftKeyLength, int dftValueLength)
{
// XXX replace with:
@@ -52,12 +53,7 @@ public class Build
StoreParamsBuilder spb = StoreParams.builder() ;
spb.blockReadCacheSize(readCacheSize) ;
spb.blockWriteCacheSize(writeCacheSize) ;
- RecordFactory recordFactory = new RecordFactory(dftKeyLength, dftValueLength) ;
- IndexParams idxParams = spb.build() ;
- FileSet fs = new FileSet(location, indexName) ;
- RangeIndex rIndex = IndexFactory.buildRangeIndex(fs, recordFactory, idxParams) ;
- TupleIndex tupleIndex = new TupleIndexRecord(primary.length(), new ColumnMap(primary, indexOrder), indexOrder, rIndex.getRecordFactory(), rIndex) ;
- return tupleIndex ;
+ return openTupleIndex(location, indexName, primary, indexOrder, spb.build()) ;
}
public static DatasetPrefixesTDB makePrefixes(Location location, DatasetControl policy) {