我正在尝试在db中为关系添加索引,但不知道是不是正确?
ListParameterization spatparams = new ListParameterization();
spatparams.addParameter(INDEX_ID, RStarTreeFactory.class);
spatparams.addParameter(AbstractPageFileFactory.Parameterizer.PAGE_SIZE_ID, 300);
spatparams.addParameter(AbstractRStarTreeFactory.Parameterizer.INSERTION_STRATEGY_ID, ApproximativeLeastOverlapInsertionStrategy.class);
spatparams.addParameter(ApproximativeLeastOverlapInsertionStrategy.Parameterizer.INSERTION_CANDIDATES_ID, 1);
//从现有阵列加载数据的适配器。
DatabaseConnection dbc = new ArrayAdapterDatabaseConnection(data);
//创建一个数据库(可能包含多个关系!)
Collection<IndexFactory<?, ?>> indexFactories = new ArrayList<>();
ObjectListParameter<IndexFactory<?, ?>> indexFactoryP = new ObjectListParameter<>(INDEX_ID, IndexFactory.class, true);
indexFactories.addAll(indexFactoryP.instantiateClasses(spatparams));
Database db = new StaticArrayDatabase(dbc, indexFactories);
db.initialize();
答案 0 :(得分:1)
要通过参数化API实例化一个类,您不需要创建新的参数。
RStarTreeFactory<DoubleVector> f =
ClassGenericsUtil.parameterizeOrAbort(RStarTreeFactory.class, params);
对于R-star树,我建议使用SortTileRecursive批量加载。