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

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

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

Index.getIndexModel介绍

[英]The common index model allows for easily searching certain fields across all types within an index. For example, if geometry is a common index field, one could ubiquitously search all types within this index spatially. This could apply to any field type desired.
[中]通用索引模型允许轻松搜索索引中所有类型的特定字段。例如,如果几何体是一个公共索引字段,则可以在空间上搜索该索引中的所有类型。这可以应用于所需的任何字段类型。

代码示例

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

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

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

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);
}

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

private Geometry internalGetGeometry(final Index index) {
 final String indexCrsStr = getCrs(index.getIndexModel());
 CrsCache cache = crsCodeCache.get(indexCrsStr);
 if (cache != null) {
  return cache.geometry;
 }
 cache = transformToIndex(indexCrsStr, index);
 crsCodeCache.put(indexCrsStr, cache);
 return cache.geometry;
}

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

public static CoordinateReferenceSystem getIndexCrs(final Index[] indices) {
 CoordinateReferenceSystem indexCrs = null;
 for (final Index primaryindx : indices) {
  // for first iteration
  if (indexCrs == null) {
   indexCrs = getIndexCrs(primaryindx);
  } else {
   if (primaryindx.getIndexModel() instanceof CustomCrsIndexModel) {
    // check if indexes have different CRS
    if (!indexCrs.equals(((CustomCrsIndexModel) primaryindx.getIndexModel()).getCrs())) {
     LOGGER.error("Multiple indices with different CRS is not supported");
     throw new RuntimeException("Multiple indices with different CRS is not supported");
    } else {
     if (!indexCrs.equals(getDefaultCRS())) {
      LOGGER.error("Multiple indices with different CRS is not supported");
      throw new RuntimeException("Multiple indices with different CRS is not supported");
     }
    }
   }
  }
 }
 return indexCrs;
}

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

@Override
 public EntryVisibilityHandler<T> getVisibilityHandler(
   final CommonIndexModel indexModel,
   final DataTypeAdapter<T> adapter,
   final StatisticsId statisticsId) {
  return (adapter instanceof StatisticsProvider)
    ? ((StatisticsProvider) adapter).getVisibilityHandler(
      index != null ? index.getIndexModel() : null,
      adapter,
      statisticsId)
    : new EmptyStatisticVisibility<>();
 }
}

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

@SuppressWarnings({"rawtypes", "unchecked"})
public static <T> InsertionIds getInsertionIdsForEntry(
  final T entry,
  final InternalDataAdapter adapter,
  final Index index) {
 final AdapterPersistenceEncoding encoding = adapter.encode(entry, index.getIndexModel());
 return encoding.getInsertionIds(index);
}

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

public static boolean hasAtLeastSpatial(final Index index) {
 if ((index == null)
   || (index.getIndexModel() == null)
   || (index.getIndexModel().getDimensions() == null)) {
  return false;
 }
 boolean hasLatitude = false;
 boolean hasLongitude = false;
 for (final NumericDimensionField dimension : index.getIndexModel().getDimensions()) {
  if (dimension instanceof LatitudeField) {
   hasLatitude = true;
  }
  if (dimension instanceof LongitudeField) {
   hasLongitude = true;
  }
  if (dimension instanceof CustomCRSSpatialField) {
   if (((CustomCRSSpatialDimension) dimension.getBaseDefinition()).getAxis() == 0) {
    hasLongitude = true;
   } else {
    hasLatitude = true;
   }
  }
 }
 return hasLatitude && hasLongitude;
}

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

if (primaryindx.getIndexModel() instanceof CustomCrsIndexModel) {
 indexCrsCode = ((CustomCrsIndexModel) primaryindx.getIndexModel()).getCrsCode();
} else {
 indexCrsCode = GeometryUtils.DEFAULT_CRS_STR;
if (primaryindx.getIndexModel() instanceof CustomCrsIndexModel) {
   ((CustomCrsIndexModel) primaryindx.getIndexModel()).getCrsCode())) {
  LOGGER.error("Multiple indices with different CRS is not supported");
  throw new RuntimeException("Multiple indices with different CRS is not supported");

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

protected QueryFilter createFilter(final Index index, final BasicQuery basicQuery) {
 final CommonIndexModel indexModel = index.getIndexModel();
 final NumericDimensionField<?>[] dimensionFields = indexModel.getDimensions();
 NumericDimensionField<?>[] orderedConstrainedDimensionFields = dimensionFields;

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

indexCrs = GeometryUtils.getDefaultCRS();
} else {
 indexCrs = ((CustomCrsIndexModel) index.getIndexModel()).getCrs();

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

private void addDistFilter(final ReaderParams<T> params, final FilterList filterList) {
 final HBaseDistributableFilter hbdFilter = new HBaseDistributableFilter();
 if (wholeRowEncoding) {
  hbdFilter.setWholeRowFilter(true);
 }
 hbdFilter.setPartitionKeyLength(partitionKeyLength);
 final List<QueryFilter> distFilters = Lists.newArrayList();
 distFilters.add(params.getFilter());
 hbdFilter.init(
   distFilters,
   params.getIndex().getIndexModel(),
   params.getAdditionalAuthorizations());
 filterList.addFilter(hbdFilter);
}

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

getNumericData(index.getIndexModel().getDimensions());
final InsertionIds untrimmedResult = index.getIndexStrategy().getInsertionIds(boxRangeData);
for (final SinglePartitionInsertionIds insertionId : untrimmedResult.getPartitionKeys()) {

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

@Override
 public boolean apply(final MemoryStoreEntry input) {
  if ((readerParams.getFilter() != null) && options.isServerSideLibraryEnabled()) {
   final PersistentDataset<CommonIndexValue> commonData = new PersistentDataset<>();
   final List<FlattenedUnreadData> unreadData = new ArrayList<>();
   final List<String> commonIndexFieldNames =
     DataStoreUtils.getUniqueDimensionFields(readerParams.getIndex().getIndexModel());
   for (final GeoWaveValue v : input.getRow().getFieldValues()) {
    unreadData.add(
      DataStoreUtils.aggregateFieldData(
        input.getRow(),
        v,
        commonData,
        readerParams.getIndex().getIndexModel(),
        commonIndexFieldNames));
   }
   return readerParams.getFilter().accept(
     readerParams.getIndex().getIndexModel(),
     new DeferredReadCommonIndexedPersistenceEncoding(
       input.getRow().getAdapterId(),
       input.getRow().getDataId(),
       input.getRow().getPartitionKey(),
       input.getRow().getSortKey(),
       input.getRow().getNumberOfDuplicates(),
       commonData,
       unreadData.isEmpty() ? null : new UnreadFieldDataList(unreadData)));
  }
  return true;
 }
}), readerParams.getRowTransformer());

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

new RoundRobinKeyIndexStrategy(options.basicIndexOptions.getNumPartitions()),
    index.getIndexStrategy()),
  index.getIndexModel(),
  index.getName()
    + "_"
    new HashKeyIndexStrategy(options.basicIndexOptions.getNumPartitions()),
    index.getIndexStrategy()),
  index.getIndexModel(),
  index.getName()
    + "_"
new CustomNameIndex(
  retVal.getIndexStrategy(),
  retVal.getIndexModel(),
  options.getNameOverride());

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

final RowBuilder<T, Object> builder = newBuilder();
if (index != null) {
 final CommonIndexModel indexModel = index.getIndexModel();
 for (final NumericDimensionField<? extends CommonIndexValue> dimension : indexModel.getDimensions()) {
  final IndexFieldHandler<T, CommonIndexValue, Object> fieldHandler =

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

final String fieldName =
  dataAdapter.getFieldNameForPosition(
    isSecondaryIndex ? DataIndexUtils.DATA_ID_INDEX.getIndexModel() : indexModel,
    fieldInfo.getFieldPosition());
FieldReader<? extends CommonIndexValue> indexFieldReader = null;

相关文章