org.locationtech.geowave.core.store.api.Index类的使用及代码示例

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

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

Index介绍

[英]An index represents how to efficiently store and retrieve data. The common index model allows for easily searching certain fields across all types within an index. The numeric index strategy maps real-world values to insertion keys and query ranges for efficient range scans within a key-value store.
[中]索引表示如何高效地存储和检索数据。通用索引模型允许轻松搜索索引中所有类型的特定字段。数字索引策略将真实值映射到插入键和查询范围,以便在键值存储中进行有效的范围扫描。

代码示例

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

public AdapterToIndexMapping(final short adapterId, final Index[] indices) {
 super();
 this.adapterId = adapterId;
 indexNames = new String[indices.length];
 for (int i = 0; i < indices.length; i++) {
  indexNames[i] = indices[i].getName();
 }
}

代码示例来源: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

@Override
public List<MultiDimensionalNumericData> getIndexConstraints(final Index index) {
 final String indexCrsStr = getCrs(index.getIndexModel());
 CrsCache cache = crsCodeCache.get(indexCrsStr);
 if (cache != null) {
  List<MultiDimensionalNumericData> indexConstraints =
    cache.constraintsPerIndexId.get(index.getName());
  if (indexConstraints == null) {
   if (crsMatches(crsCode, indexCrsStr) || (queryGeometry == null)) {
    indexConstraints = super.getIndexConstraints(index);
   } else {
    indexConstraints = indexConstraintsFromGeometry(cache.geometry, index);
   }
   cache.constraintsPerIndexId.put(index.getName(), indexConstraints);
  }
  return indexConstraints;
 }
 cache = transformToIndex(indexCrsStr, index);
 crsCodeCache.put(indexCrsStr, cache);
 return cache.constraintsPerIndexId.get(index.getName());
}

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

new CompoundIndexStrategy(
      new RoundRobinKeyIndexStrategy(options.basicIndexOptions.getNumPartitions()),
      index.getIndexStrategy()),
    index.getIndexModel(),
    index.getName()
      + "_"
      + PartitionStrategy.ROUND_ROBIN.name()
    new CompoundIndexStrategy(
      new HashKeyIndexStrategy(options.basicIndexOptions.getNumPartitions()),
      index.getIndexStrategy()),
    index.getIndexModel(),
    index.getName()
      + "_"
      + PartitionStrategy.HASH.name()
retVal =
  new CustomNameIndex(
    retVal.getIndexStrategy(),
    retVal.getIndexModel(),
    options.getNameOverride());

代码示例来源: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

protected byte[] getFieldBitmask() {
 if ((fieldIdsAdapterPair != null) && (fieldIdsAdapterPair.getLeft() != null)) {
  return BitmaskUtils.generateFieldSubsetBitmask(
    dataIndexRetrieval != null ? DataIndexUtils.DATA_ID_INDEX.getIndexModel()
      : index.getIndexModel(),
    fieldIdsAdapterPair.getLeft(),
    fieldIdsAdapterPair.getRight());
 }
 return null;
}

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

getNumericData(index.getIndexModel().getDimensions());
final InsertionIds untrimmedResult = index.getIndexStrategy().getInsertionIds(boxRangeData);
for (final SinglePartitionInsertionIds insertionId : untrimmedResult.getPartitionKeys()) {
 final byte[] partitionKey = insertionId.getPartitionKey();
     && checkCoverage(
       boxRangeData,
       index.getIndexStrategy().getRangeForId(partitionKey, sortKey))) {
    LOGGER.error(
      "Index strategy produced an unmatching tile during encoding and storing an entry");
     index.getIndexStrategy().getRangeForId(partitionKey, sortKey).getDataPerDimension(),
     index)) {
    it.remove();

代码示例来源: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

public static boolean hasTime(final Index index) {
  if ((index == null)
    || (index.getIndexModel() == null)
    || (index.getIndexModel().getDimensions() == null)) {
   return false;
  }
  for (final NumericDimensionField dimension : index.getIndexModel().getDimensions()) {
   if (dimension instanceof TimeField) {
    return true;
   }
  }
  return false;
 }
}

代码示例来源: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 String getIndexName() {
 return index.getName();
}

代码示例来源: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

final List<MultiDimensionalNumericData> constraints = super.getIndexConstraints(index);
 final Map<String, List<MultiDimensionalNumericData>> constraintsPerIndexId = new HashMap<>();
 constraintsPerIndexId.put(index.getName(), constraints);
 return new CrsCache(queryGeometry, constraintsPerIndexId);
} else {
  indexCrs = GeometryUtils.getDefaultCRS();
 } else {
  indexCrs = ((CustomCrsIndexModel) index.getIndexModel()).getCrs();
  final Map<String, List<MultiDimensionalNumericData>> constraintsPerIndexId =
    new HashMap<>();
  constraintsPerIndexId.put(index.getName(), indexConstraints);
  return new CrsCache(indexCrsQueryGeometry, constraintsPerIndexId);
 } catch (final FactoryException e) {
constraintsPerIndexId.put(index.getName(), constraints);
return new CrsCache(queryGeometry, constraintsPerIndexId);

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

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

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

public static CoordinateReferenceSystem getIndexCrs(final Index index) {
 CoordinateReferenceSystem indexCrs = null;
 if (index.getIndexModel() instanceof CustomCrsIndexModel) {
  indexCrs = ((CustomCrsIndexModel) index.getIndexModel()).getCrs();
 } else {
  indexCrs = getDefaultCRS();
 }
 return indexCrs;
}

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

@Override
 public Object transform(final Object obj) {
  indexCache.put(((Index) obj).getName(), (Index) obj);
  return obj;
 }
}));

代码示例来源: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

if (!indexNames.isEmpty()) {
 if (indexNames.contains(index.getName())) {
  currentSelectionsList.add(index);
final NumericDimensionField[] dims = index.getIndexModel().getDimensions();
boolean hasLat = false;
boolean hasLong = false;

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

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

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

public DataStatisticsBuilder(
  final Index index,
  final DataTypeAdapter<T> adapter,
  final DataStoreStatisticsProvider<T> statisticsProvider,
  final StatisticsId statisticsId) {
 this.statisticsProvider = statisticsProvider;
 this.statisticsId = statisticsId;
 this.visibilityHandler =
   statisticsProvider.getVisibilityHandler(index.getIndexModel(), adapter, statisticsId);
}

相关文章