org.locationtech.geowave.core.store.api.Index.getIndexStrategy()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(9.3k)|赞(0)|评价(0)|浏览(111)

本文整理了Java中org.locationtech.geowave.core.store.api.Index.getIndexStrategy()方法的一些代码示例,展示了Index.getIndexStrategy()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Index.getIndexStrategy()方法的具体详情如下:
包路径:org.locationtech.geowave.core.store.api.Index
类名称:Index
方法名:getIndexStrategy

Index.getIndexStrategy介绍

[英]get the index strategy which maps real-world values to insertion keys and query ranges for efficient range scans within a key-value store.
[中]获取索引策略,该策略将真实值映射到插入键和查询范围,以便在键值存储中进行有效的范围扫描。

代码示例

代码示例来源:origin: locationtech/geowave

protected static boolean hasTime(final Index index) {
 if ((index == null)
   || (index.getIndexStrategy() == null)
   || (index.getIndexStrategy().getOrderedDimensionDefinitions() == null)) {
  return false;
 }
 for (final NumericDimensionDefinition dimension : index.getIndexStrategy().getOrderedDimensionDefinitions()) {
  if (dimension instanceof TimeDefinition) {
   return true;
  }
 }
 return false;
}

代码示例来源:origin: locationtech/geowave

public static boolean isTemporal(final Index index) {
 if (index == null) {
  return false;
 }
 return isTemporal(index.getIndexStrategy());
}

代码示例来源:origin: locationtech/geowave

public static boolean isSpatial(final Index index) {
 if (index == null) {
  return false;
 }
 return isSpatial(index.getIndexStrategy());
}

代码示例来源:origin: locationtech/geowave

public static boolean isSpatialTemporal(final Index index) {
 if (index == null) {
  return false;
 }
 return isSpatialTemporal(index.getIndexStrategy());
}

代码示例来源:origin: locationtech/geowave

private void initializeBitPosition(final double[] maxResolutionSubsamplingPerDimension) {
  if ((maxResolutionSubsamplingPerDimension != null)
    && (maxResolutionSubsamplingPerDimension.length > 0)) {
   bitPosition =
     IndexUtils.getBitPositionOnSortKeyFromSubsamplingArray(
       index.getIndexStrategy(),
       maxResolutionSubsamplingPerDimension);
  }
 }
}

代码示例来源:origin: locationtech/geowave

protected static boolean hasAtLeastSpatial(final Index index) {
 if ((index == null)
   || (index.getIndexStrategy() == null)
   || (index.getIndexStrategy().getOrderedDimensionDefinitions() == null)) {
  return false;
 }
 boolean hasLatitude = false;
 boolean hasLongitude = false;
 for (final NumericDimensionDefinition dimension : index.getIndexStrategy().getOrderedDimensionDefinitions()) {
  if (dimension instanceof LatitudeDefinition) {
   hasLatitude = true;
  }
  if (dimension instanceof LatitudeDefinition) {
   hasLongitude = true;
  }
 }
 return hasLatitude && hasLongitude;
}

代码示例来源:origin: locationtech/geowave

@Override
 protected QueryRanges getRanges(
   final int maxRangeDecomposition,
   final double[] targetResolutionPerDimensionForHierarchicalIndex) {
  return DataStoreUtils.constraintsToQueryRanges(
    constraints,
    index.getIndexStrategy(),
    targetResolutionPerDimensionForHierarchicalIndex,
    maxRangeDecomposition,
    indexMetaData);
 }
}

代码示例来源:origin: locationtech/geowave

@Override
public List<MultiDimensionalNumericData> getIndexConstraints(final Index primaryIndex) {
 return constraints.getIndexConstraints(primaryIndex.getIndexStrategy());
}

代码示例来源:origin: locationtech/geowave

@Override
public List<MultiDimensionalCoordinateRangesArray> getCoordinateRanges() {
 if ((constraints == null) || constraints.isEmpty()) {
  return new ArrayList<>();
 } else {
  final NumericIndexStrategy indexStrategy = index.getIndexStrategy();
  final List<MultiDimensionalCoordinateRangesArray> ranges = new ArrayList<>();
  for (final MultiDimensionalNumericData nd : constraints) {
   ranges.add(
     new MultiDimensionalCoordinateRangesArray(
       indexStrategy.getCoordinateRangesPerDimension(nd, indexMetaData)));
  }
  return ranges;
 }
}

代码示例来源:origin: locationtech/geowave

private static List<MultiDimensionalNumericData> indexConstraintsFromGeometry(
  final Geometry geom,
  final Index index) {
 return GeometryUtils.basicConstraintsFromGeometry(geom).getIndexConstraints(
   index.getIndexStrategy());
}

代码示例来源:origin: locationtech/geowave

private void addIndexFilter(final ReaderParams<T> params, final FilterList filterList) {
 final List<MultiDimensionalCoordinateRangesArray> coords = params.getCoordinateRanges();
 if ((coords != null) && !coords.isEmpty()) {
  final HBaseNumericIndexStrategyFilter numericIndexFilter =
    new HBaseNumericIndexStrategyFilter(
      params.getIndex().getIndexStrategy(),
      coords.toArray(new MultiDimensionalCoordinateRangesArray[] {}));
  filterList.addFilter(numericIndexFilter);
 }
}

代码示例来源:origin: locationtech/geowave

0,
new CoordinateRangeQueryFilter(
  index.getIndexStrategy(),
  coords.toArray(new MultiDimensionalCoordinateRangesArray[] {})));

代码示例来源:origin: locationtech/geowave

public Pair<byte[], byte[]> getPartitionAndSortKey(final Index index) {
 final int partitionKeyLength = index.getIndexStrategy().getPartitionKeyLength();
 final int indexIdLength = StringUtils.stringToBinary(index.getName()).length;
 if (dataId.getBytes().length < (indexIdLength + partitionKeyLength)) {
  return null;
 } else {
  final byte[] partitionKey =
    Arrays.copyOfRange(dataId.getBytes(), indexIdLength, indexIdLength + partitionKeyLength);
  final byte[] sortKey =
    Arrays.copyOfRange(
      dataId.getBytes(),
      indexIdLength + partitionKeyLength,
      dataId.getBytes().length);
  return ImmutablePair.of(partitionKey, sortKey);
 }
}

代码示例来源:origin: locationtech/geowave

private void addSkipFilter(final RangeReaderParams<T> params, final FilterList filterList) {
 // Add skipping filter if requested
 if (params.getMaxResolutionSubsamplingPerDimension() != null) {
  if (params.getMaxResolutionSubsamplingPerDimension().length != params.getIndex().getIndexStrategy().getOrderedDimensionDefinitions().length) {
   LOGGER.warn(
     "Unable to subsample for table '"
       + params.getIndex().getName()
       + "'. Subsample dimensions = "
       + params.getMaxResolutionSubsamplingPerDimension().length
       + " when indexed dimensions = "
       + params.getIndex().getIndexStrategy().getOrderedDimensionDefinitions().length);
  } else {
   final int cardinalityToSubsample =
     IndexUtils.getBitPositionFromSubsamplingArray(
       params.getIndex().getIndexStrategy(),
       params.getMaxResolutionSubsamplingPerDimension());
   final FixedCardinalitySkippingFilter skippingFilter =
     new FixedCardinalitySkippingFilter(cardinalityToSubsample);
   filterList.addFilter(skippingFilter);
  }
 }
}

代码示例来源:origin: locationtech/geowave

public boolean createIndex(final Index index) throws IOException {
 createTable(
   index.getIndexStrategy().getPredefinedSplits(),
   new GeoWaveColumnFamily[0],
   StringColumnFamilyFactory.getSingletonInstance(),
   options.isServerSideLibraryEnabled(),
   getTableName(index.getName()));
 return true;
}

代码示例来源:origin: locationtech/geowave

public HBaseReader(
  final RecordReaderParams recordReaderParams,
  final HBaseOperations operations) {
 this.readerParams = null;
 this.recordReaderParams = recordReaderParams;
 this.operations = operations;
 this.partitionKeyLength =
   recordReaderParams.getIndex().getIndexStrategy().getPartitionKeyLength();
 this.wholeRowEncoding = recordReaderParams.isMixedVisibility();
 this.clientSideRowMerging = recordReaderParams.isClientsideRowMerging();
 this.rowTransformer =
   (GeoWaveRowIteratorTransformer<T>) GeoWaveRowIteratorTransformer.NO_OP_TRANSFORMER;
 this.scanProvider =
   createScanProvider(
     (RangeReaderParams<T>) recordReaderParams,
     operations,
     this.clientSideRowMerging);
 initRecordScanner();
}

代码示例来源:origin: locationtech/geowave

private RowWriter internalCreateWriter(
  final Index index,
  final InternalDataAdapter<?> adapter,
  final Function<BufferedMutator, RowWriter> writerSupplier) {
 final TableName tableName = getTableName(index.getName());
 try {
  final GeoWaveColumnFamily[] columnFamilies = new GeoWaveColumnFamily[1];
  columnFamilies[0] =
    new StringColumnFamily(ByteArrayUtils.shortToString(adapter.getAdapterId()));
  createTable(
    index.getIndexStrategy().getPredefinedSplits(),
    columnFamilies,
    StringColumnFamilyFactory.getSingletonInstance(),
    options.isServerSideLibraryEnabled(),
    tableName);
  verifyColumnFamilies(
    columnFamilies,
    StringColumnFamilyFactory.getSingletonInstance(),
    true,
    tableName,
    true);
  return writerSupplier.apply(getBufferedMutator(tableName));
 } catch (final TableNotFoundException e) {
  LOGGER.error("Table does not exist", e);
 } catch (final IOException e) {
  LOGGER.error("Error creating table: " + index.getName(), e);
 }
 return null;
}

代码示例来源:origin: locationtech/geowave

protected String checkIndex(
   final PropertyManagement runTimeProperties,
   final ParameterEnum indexIdEnum,
   final String defaultIdxName) throws Exception {

  final String indexName = runTimeProperties.getPropertyAsString(indexIdEnum, defaultIdxName);

  final IndexStore indexStore = getIndexStore(runTimeProperties);

  Index index = indexStore.getIndex(indexName);
  if (index == null) {
   final Index defaultSpatialIndex =
     new SpatialDimensionalityTypeProvider().createIndex(new SpatialOptions());
   index =
     new CustomNameIndex(
       defaultSpatialIndex.getIndexStrategy(),
       defaultSpatialIndex.getIndexModel(),
       indexName);
   indexStore.addIndex(index);
  }
  return indexName;
 }
}

代码示例来源:origin: locationtech/geowave

public HBaseReader(final ReaderParams<T> readerParams, final HBaseOperations operations) {
 this.readerParams = readerParams;
 this.recordReaderParams = null;
 this.operations = operations;
 this.partitionKeyLength = readerParams.getIndex().getIndexStrategy().getPartitionKeyLength();
 this.wholeRowEncoding =
   readerParams.isMixedVisibility() && !readerParams.isServersideAggregation();
 this.clientSideRowMerging = readerParams.isClientsideRowMerging();
 this.rowTransformer = readerParams.getRowTransformer();
 this.scanProvider = createScanProvider(readerParams, operations, this.clientSideRowMerging);
 if (readerParams.isServersideAggregation()) {
  this.scanner = null;
  scanIt = (Iterator) operations.aggregateServerSide(readerParams);
 } else {
  initScanner();
 }
}

代码示例来源:origin: locationtech/geowave

indexName)) {
((HBaseOperations) baseOperations).createTable(
  index.getIndexStrategy().getPredefinedSplits(),
  index.getName(),
  false,

相关文章