Search in sources :

Example 1 with TierIndexMetaData

use of org.locationtech.geowave.core.index.sfc.tiered.TieredSFCIndexStrategy.TierIndexMetaData in project geowave by locationtech.

the class XZHierarchicalIndexStrategy method getQueryRanges.

@Override
public QueryRanges getQueryRanges(final MultiDimensionalNumericData indexedRange, final int maxEstimatedRangeDecomposition, final IndexMetaData... hints) {
    // TODO don't just pass max ranges along to the SFC, take tiering and
    // binning into account to limit the number of ranges correctly
    TierIndexMetaData tieredHints = null;
    XZHierarchicalIndexMetaData xzHints = null;
    if ((hints != null) && (hints.length > 0)) {
        tieredHints = (TierIndexMetaData) hints[0];
        xzHints = (XZHierarchicalIndexMetaData) hints[1];
    }
    final QueryRanges queryRanges = rasterStrategy.getQueryRanges(indexedRange, maxEstimatedRangeDecomposition, tieredHints);
    final List<BinnedNumericDataset> binnedQueries = BinnedNumericDataset.applyBins(indexedRange, baseDefinitions);
    final List<SinglePartitionQueryRanges> partitionedRanges = new ArrayList<>();
    if ((xzHints == null) || (xzHints.pointCurveCount > 0)) {
        partitionedRanges.addAll(BinnedSFCUtils.getQueryRanges(binnedQueries, pointCurve, // for
        maxEstimatedRangeDecomposition, // SFCs
        pointCurveMultiDimensionalId));
    }
    if ((xzHints == null) || (xzHints.xzCurveCount > 0)) {
        partitionedRanges.addAll(BinnedSFCUtils.getQueryRanges(binnedQueries, xzCurve, // for
        maxEstimatedRangeDecomposition, // SFCs
        xzCurveMultiDimensionalId));
    }
    if (partitionedRanges.isEmpty()) {
        return queryRanges;
    }
    final List<QueryRanges> queryRangesList = new ArrayList<>();
    queryRangesList.add(queryRanges);
    queryRangesList.add(new QueryRanges(partitionedRanges));
    return new QueryRanges(queryRangesList);
}
Also used : SinglePartitionQueryRanges(org.locationtech.geowave.core.index.SinglePartitionQueryRanges) QueryRanges(org.locationtech.geowave.core.index.QueryRanges) BinnedNumericDataset(org.locationtech.geowave.core.index.numeric.BinnedNumericDataset) SinglePartitionQueryRanges(org.locationtech.geowave.core.index.SinglePartitionQueryRanges) ArrayList(java.util.ArrayList) TierIndexMetaData(org.locationtech.geowave.core.index.sfc.tiered.TieredSFCIndexStrategy.TierIndexMetaData)

Aggregations

ArrayList (java.util.ArrayList)1 QueryRanges (org.locationtech.geowave.core.index.QueryRanges)1 SinglePartitionQueryRanges (org.locationtech.geowave.core.index.SinglePartitionQueryRanges)1 BinnedNumericDataset (org.locationtech.geowave.core.index.numeric.BinnedNumericDataset)1 TierIndexMetaData (org.locationtech.geowave.core.index.sfc.tiered.TieredSFCIndexStrategy.TierIndexMetaData)1