Package mil.nga.giat.geowave.index

Examples of mil.nga.giat.geowave.index.NumericIndexStrategy


        continue;
      }
      final String tableName = AccumuloUtils.getQualifiedTableName(
          tableNamespace,
          index.getId().getString());
      final NumericIndexStrategy indexStrategy = index.getIndexStrategy();
      final TreeSet<Range> ranges;
      if (query != null) {
        final MultiDimensionalNumericData indexConstraints = query.getIndexConstraints(indexStrategy);
        if ((maxSplits != null) && (maxSplits > 0)) {
          ranges = AccumuloUtils.byteArrayRangesToAccumuloRanges(AccumuloUtils.constraintsToByteArrayRanges(
View Full Code Here


      final DataAdapter<T> adapter,
      final Index index,
      final Query query,
      final double[] targetResolutionPerDimension ) {
    // determine the correct tier to query for the given resolution
    final NumericIndexStrategy strategy = index.getIndexStrategy();
    if (strategy instanceof HierarchicalNumericIndexStrategy) {
      final TreeMap<Double, SubStrategy> sortedStrategies = new TreeMap<Double, SubStrategy>();
      SubStrategy targetIndexStrategy = null;
      for (final SubStrategy subStrategy : ((HierarchicalNumericIndexStrategy) strategy).getSubStrategies()) {
        final double[] idRangePerDimension = subStrategy.getIndexStrategy().getHighestPrecisionIdRangePerDimension();
View Full Code Here

    dataPerDimension3[2] = new NumericValue(
        cal.getTimeInMillis());

    MultiDimensionalNumericData indexedData = new BasicNumericDataset(
        dataPerDimension1);
    final NumericIndexStrategy strategy = new SpatialTemporalFactory().createIndexStrategy(DataType.VECTOR);

    final List<ByteArrayId> ids1 = strategy.getInsertionIds(indexedData);
    assertEquals(
        1,
        ids1.size());
    assertEquals(
        13,
        ids1.get(
            0).getBytes().length);

    // same bin
    indexedData = new BasicNumericDataset(
        dataPerDimension2);
    final List<ByteArrayId> ids2 = strategy.getInsertionIds(indexedData);
    assertEquals(
        1,
        ids2.size());
    assertTrue(compare(
        ids1.get(
            0).getBytes(),
        ids2.get(
            0).getBytes(),
        5));

    // different bin
    indexedData = new BasicNumericDataset(
        dataPerDimension3);
    final List<ByteArrayId> ids3 = strategy.getInsertionIds(indexedData);
    assertEquals(
        1,
        ids3.size());
    assertFalse(compare(
        ids1.get(
View Full Code Here

        cal.getTimeInMillis(),
        calEnd.getTimeInMillis());

    MultiDimensionalNumericData indexedData = new BasicNumericDataset(
        dataPerDimension1);
    final NumericIndexStrategy strategy = TieredSFCIndexFactory.createEqualIntervalPrecisionTieredStrategy(
        SPATIAL_TEMPORAL_DIMENSIONS,
        new int[] {
          20,
          20,
          20
        },
        SFCType.HILBERT,
        4);

    final List<ByteArrayId> ids1 = strategy.getInsertionIds(indexedData);
    assertEquals(
        1,
        ids1.size());
    assertEquals(
        10,
        ids1.get(
            0).getBytes().length);

    // different bin bin
    indexedData = new BasicNumericDataset(
        dataPerDimension2);
    final List<ByteArrayId> ids2 = strategy.getInsertionIds(indexedData);
    assertEquals(
        1,
        ids2.size());
    // different tier
    assertFalse(compare(
        ids1.get(
            0).getBytes(),
        ids2.get(
            0).getBytes(),
        1));
    // same time
    assertTrue(compare(
        ids1.get(
            0).getBytes(),
        ids2.get(
            0).getBytes(),
        1,
        5));

    // different bin
    indexedData = new BasicNumericDataset(
        dataPerDimension3);
    final List<ByteArrayId> ids3 = strategy.getInsertionIds(indexedData);
    assertEquals(
        1,
        ids3.size());
    assertFalse(compare(
        ids1.get(
View Full Code Here

  protected Map<NumericIndexStrategy, ScannerBase> getScanners(
      final AccumuloOperations accumuloOperations,
      final boolean separateSubStrategies ) {
    final String tableName = StringUtils.stringFromBinary(index.getId().getBytes());
    final Map<NumericIndexStrategy, ScannerBase> resultScanners = new HashMap<NumericIndexStrategy, ScannerBase>();
    final NumericIndexStrategy indexStrategy = index.getIndexStrategy();
    if ((indexStrategy instanceof HierarchicalNumericIndexStrategy) && separateSubStrategies) {
      final SubStrategy[] subStrategies = ((HierarchicalNumericIndexStrategy) indexStrategy).getSubStrategies();
      for (final SubStrategy subStrategy : subStrategies) {
        resultScanners.put(
            subStrategy.getIndexStrategy(),
View Full Code Here

          rendererBytes,
          DistributableRenderer.class);

      final String indexStrategyStr = options.get(INDEX_STRATEGY);
      final byte[] indexStrategyBytes = ByteArrayUtils.byteArrayFromString(indexStrategyStr);
      final NumericIndexStrategy indexStrategy = PersistenceUtils.fromBinary(
          indexStrategyBytes,
          NumericIndexStrategy.class);
      final AbstractRowProvider rowProvider = renderer.newRowProvider(indexStrategy);
      wrappedIterator = new RowProviderSkippingIterator(
          source,
View Full Code Here

  }

  @Test
  public void testLineWithPrecisionOnTheTileEdge() {

    NumericIndexStrategy strategy = TieredSFCIndexFactory.createSingleTierStrategy(
        SPATIAL_TEMPORAL_DIMENSIONS,
        new int[] {
          14,
          14,
          14
View Full Code Here

TOP

Related Classes of mil.nga.giat.geowave.index.NumericIndexStrategy

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.