Package mil.nga.giat.geowave.store.index

Examples of mil.nga.giat.geowave.store.index.Index


        numIndices);
    for (int i = 0; i < numIndices; i++) {
      final int indexLength = in.readInt();
      final byte[] indexBytes = new byte[indexLength];
      in.readFully(indexBytes);
      final Index index = PersistenceUtils.fromBinary(
          indexBytes,
          Index.class);
      final int numRanges = in.readInt();
      final List<Range> rangeList = new ArrayList<Range>(
          numRanges);
View Full Code Here


  }

  @Test
  public void testIndexOptions() {

    final Index index = IndexType.SPATIAL_VECTOR.createDefaultIndex();
    final WritableDataAdapter<TestGeometry> adapter = new TestGeometryAdapter();

    accumuloOptions.setCreateTable(false);
    accumuloOptions.setPersistIndex(false);

    final List<ByteArrayId> rowIds = mockDataStore.ingest(
        adapter,
        index,
        new TestGeometry(
            factory.createPoint(new Coordinate(
                25,
                32)),
            "test_pt"));

    // as the table didn't already exist, the flag indicates not to create
    // it, so no rows will be returned
    assertEquals(
        0,
        rowIds.size());

    accumuloOptions.setCreateTable(true);

    final ByteArrayId rowId1 = mockDataStore.ingest(
        adapter,
        index,
        new TestGeometry(
            factory.createPoint(new Coordinate(
                25,
                32)),
            "test_pt_1")).get(
        0);

    // as we have chosen not to persist the index, we will not see an index
    // entry in the index store
    assertEquals(
        false,
        indexStore.indexExists(index.getId()));

    final TestGeometry geom1 = mockDataStore.getEntry(
        index,
        rowId1);

    // even though we didn't persist the index, the test point was still
    // stored
    assertEquals(
        "test_pt_1",
        geom1.id);

    accumuloOptions.setPersistIndex(true);

    final ByteArrayId rowId2 = mockDataStore.ingest(
        adapter,
        index,
        new TestGeometry(
            factory.createPoint(new Coordinate(
                25,
                32)),
            "test_pt_2")).get(
        0);

    // as we have chosen to persist the index, we will see the index entry
    // in the index store
    assertEquals(
        true,
        indexStore.indexExists(index.getId()));

    final TestGeometry geom2 = mockDataStore.getEntry(
        index,
        rowId2);
View Full Code Here

  }

  @Test
  public void testLocalityGroups() {

    final Index index = IndexType.SPATIAL_VECTOR.createDefaultIndex();
    final WritableDataAdapter<TestGeometry> adapter = new TestGeometryAdapter();

    final String tableName = StringUtils.stringFromBinary(index.getId().getBytes());
    final byte[] adapterId = adapter.getAdapterId().getBytes();

    accumuloOptions.setUseLocalityGroups(false);

    final ByteArrayId rowId1 = mockDataStore.ingest(
View Full Code Here

  }

  @Test
  public void testAdapterOptions() {

    final Index index = IndexType.SPATIAL_VECTOR.createDefaultIndex();
    final WritableDataAdapter<TestGeometry> adapter = new TestGeometryAdapter();

    accumuloOptions.setPersistAdapter(false);

    final ByteArrayId rowId1 = mockDataStore.ingest(
View Full Code Here

  }

  @Test
  public void testAlternateIndexOption() {

    final Index index = IndexType.SPATIAL_VECTOR.createDefaultIndex();
    final WritableDataAdapter<TestGeometry> adapter = new TestGeometryAdapter();

    final ByteArrayId adapterId = adapter.getAdapterId();

    accumuloOptions.setUseAltIndex(false);
View Full Code Here

        geom3.id);
  }

  @Test
  public void testDeleteAll() {
    final Index index = IndexType.SPATIAL_VECTOR.createDefaultIndex();
    final WritableDataAdapter<TestGeometry> adapter0 = new TestGeometryAdapter();
    final WritableDataAdapter<TestGeometry> adapter1 = new AnotherAdapter();

    accumuloOptions.setUseAltIndex(true);
View Full Code Here

    // This is an adapter, that is needed to describe how to persist the
    // data type passed
    final FeatureDataAdapter adapter = createDataAdapter(point);

    // This describes how to index the data
    final Index index = createSpatialIndex();

    // features require a featureID - this should be unqiue as it's a
    // foreign key on the feature
    // (i.e. sending in a new feature with the same feature id will
    // overwrite the existing feature)
View Full Code Here

        TEST_CASE_BASE);
  }

  @Test
  public void testIngestAndQuerySpatialPointsAndLines() {
    final Index spatialIndex = IndexType.SPATIAL_VECTOR.createDefaultIndex();
    // ingest both lines and points
    testIngest(
        IndexType.SPATIAL_VECTOR,
        HAIL_SHAPEFILE_FILE);
    testIngest(
View Full Code Here

            GeoWaveITSuite.accumuloOperations),
        new AccumuloDataStatisticsStore(
            GeoWaveITSuite.accumuloOperations),
            GeoWaveITSuite.accumuloOperations);
    final DistributableQuery query = resourceToQuery(savedFilterResource);
    final Index index = indexType.createDefaultIndex();
    final CloseableIterator<?> actualResults;

    actualResults = geowaveStore.query(
        index,
        query);
View Full Code Here

    // This is an adapter, that is needed to describe how to persist the
    // data type passed
    final FeatureDataAdapter adapter = createDataAdapter(point);

    // This describes how to index the data
    final Index index = createSpatialIndex();

    // features require a featureID - this should be unqiue as it's a
    // foreign key on the feature
    // (i.e. sending in a new feature with the same feature id will
    // overwrite the existing feature)
View Full Code Here

TOP

Related Classes of mil.nga.giat.geowave.store.index.Index

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.