本文整理汇总了Java中mil.nga.giat.geowave.core.index.ByteArrayId类的典型用法代码示例。如果您正苦于以下问题:Java ByteArrayId类的具体用法?Java ByteArrayId怎么用?Java ByteArrayId使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ByteArrayId类属于mil.nga.giat.geowave.core.index包,在下文中一共展示了ByteArrayId类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: map
import mil.nga.giat.geowave.core.index.ByteArrayId; //导入依赖的package包/类
@Override
protected void map(
final Key key,
final Value value,
final Context context )
throws IOException,
InterruptedException {
final List<SimpleFeature> sf = sfg.mapOSMtoSimpleFeature(
WholeRowIterator.decodeRow(
key,
value),
osmProvider);
if ((sf != null) && (sf.size() > 0)) {
for (final SimpleFeature feat : sf) {
final String name = feat.getType().getTypeName();
context.write(
new GeoWaveOutputKey(
new ByteArrayId(name),
indexId),
feat);
}
}
}
示例2: composeConstraints
import mil.nga.giat.geowave.core.index.ByteArrayId; //导入依赖的package包/类
/**
* Compose a query from the set of constraints. When the provided
* constraints do not fulfill the indexed dimensions, compose constraints
* from statistics.
*
* @param featureType
* @param timeDescriptors
* @param statsMap
* @param jtsBounds
* @param timeBoundsSet
* @return
*/
public static Constraints composeConstraints(
final SimpleFeatureType featureType,
final TimeDescriptors timeDescriptors,
final Map<ByteArrayId, DataStatistics<SimpleFeature>> statsMap,
final Geometry jtsBounds,
final TemporalConstraintsSet timeBoundsSet ) {
final Constraints timeConstraints = composeTimeConstraints(
featureType,
timeDescriptors,
statsMap,
timeBoundsSet);
final GeoConstraintsWrapper geoConstraints = composeGeometricConstraints(
featureType,
statsMap,
jtsBounds);
return timeConstraints.merge(geoConstraints.getConstraints());
}
示例3: testChooseSpatialWithoutStatsBlockDay
import mil.nga.giat.geowave.core.index.ByteArrayId; //导入依赖的package包/类
@Test
public void testChooseSpatialWithoutStatsBlockDay() {
final ChooseLocalityPreservingQueryStrategy strategy = new ChooseLocalityPreservingQueryStrategy();
final Iterator<Index<?, ?>> it = getIndices(
new HashMap<ByteArrayId, DataStatistics<SimpleFeature>>(),
new BasicQuery(
createConstraints(
BLOCK,
BLOCK,
DAY)),
strategy);
assertTrue(it.hasNext());
assertEquals(
indices.get(
3).getId(),
it.next().getId());
assertFalse(it.hasNext());
}
示例4: accept
import mil.nga.giat.geowave.core.index.ByteArrayId; //导入依赖的package包/类
@Override
public boolean accept(
final CommonIndexModel indexModel,
final IndexedPersistenceEncoding<?> persistenceEncoding ) {
final ByteArrayId value = (ByteArrayId) persistenceEncoding.getCommonData().getValue(
fieldId);
if (value != null) {
final double val = Lexicoders.DOUBLE.fromByteArray(value.getBytes());
if (inclusiveLow && inclusiveHigh)
return val >= lowerValue.doubleValue() && val <= upperValue.doubleValue();
else if (inclusiveLow)
return val >= lowerValue.doubleValue() && val < upperValue.doubleValue();
else if (inclusiveHigh)
return val > lowerValue.doubleValue() && val <= upperValue.doubleValue();
else
return val > lowerValue.doubleValue() && val < upperValue.doubleValue();
}
return false;
}
示例5: testLineRnge
import mil.nga.giat.geowave.core.index.ByteArrayId; //导入依赖的package包/类
@Test
public void testLineRnge() {
final GeoObjDataAdapter adapter = new GeoObjDataAdapter(
NATIVE_FIELD_RANGE_HANDLER_LIST,
COMMON_FIELD_RANGE_HANDLER_LIST);
final GeoObj entry = new GeoObj(
factory.createLineString(new Coordinate[] {
new Coordinate(
43.444,
28.232),
new Coordinate(
43.454,
28.242)
}),
start,
end,
"g1");
final List<ByteArrayId> ids = adapter.encode(
entry,
model).getInsertionIds(
index);
assertTrue(ids.size() < 100);
}
示例6: convertUnknownValues
import mil.nga.giat.geowave.core.index.ByteArrayId; //导入依赖的package包/类
@Override
public void convertUnknownValues(
final DataAdapter<?> adapter,
final CommonIndexModel model ) {
if (unreadData != null) {
final List<FlattenedFieldInfo> fields = unreadData.finishRead();
for (final FlattenedFieldInfo field : fields) {
final ByteArrayId fieldId = adapter.getFieldIdForPosition(
model,
field.getFieldPosition());
final FieldReader<Object> reader = adapter.getReader(fieldId);
final Object value = reader.readField(field.getValue());
adapterExtendedData.addValue(new PersistentValue<Object>(
fieldId,
value));
}
}
}
示例7: SingleItemClusterList
import mil.nga.giat.geowave.core.index.ByteArrayId; //导入依赖的package包/类
public SingleItemClusterList(
final ByteArrayId centerId,
final ClusterItem center,
final NeighborListFactory<ClusterItem> factory,
final Map<ByteArrayId, Cluster> index ) {
super(
center.getGeometry() instanceof Point || center.isCompressed() ? center.getGeometry() : null,
(int) center.getCount(),
centerId,
index);
final Geometry clusterGeo = center.getGeometry();
compressed = center.isCompressed();
if (compressed) {
getClusterPoints(
true).add(
clusterGeo.getCentroid().getCoordinate());
}
}
示例8: buildGeoWaveDataInstance
import mil.nga.giat.geowave.core.index.ByteArrayId; //导入依赖的package包/类
private static GeoWaveData<SimpleFeature> buildGeoWaveDataInstance(
final String id,
final Collection<ByteArrayId> primaryIndexIds,
final ByteArrayId key,
final SimpleFeatureBuilder builder,
final Map<String, String> additionalDataSet ) {
if (additionalDataSet != null) {
for (final Map.Entry<String, String> entry : additionalDataSet.entrySet()) {
builder.set(
entry.getKey(),
entry.getValue());
}
}
return new GeoWaveData<SimpleFeature>(
key,
primaryIndexIds,
builder.buildFeature(id));
}
示例9: addToBatch
import mil.nga.giat.geowave.core.index.ByteArrayId; //导入依赖的package包/类
@Override
protected void addToBatch(
final Closeable deleter,
final List<ByteArrayId> ids )
throws Exception {
final List<Range> rowRanges = new ArrayList<Range>();
for (final ByteArrayId id : ids) {
rowRanges.add(Range.exact(new Text(
id.getBytes())));
}
if (deleter instanceof ClosableBatchDeleter) {
final BatchDeleter batchDeleter = ((ClosableBatchDeleter) deleter).getDeleter();
batchDeleter.setRanges(rowRanges);
batchDeleter.delete();
}
else {
LOGGER.error("Deleter incompatible with data store type");
}
}
示例10: AccumuloConstraintsQuery
import mil.nga.giat.geowave.core.index.ByteArrayId; //导入依赖的package包/类
public AccumuloConstraintsQuery(
final List<ByteArrayId> adapterIds,
final PrimaryIndex index,
final Query query,
final DedupeFilter clientDedupeFilter,
final ScanCallback<?> scanCallback,
final Pair<DataAdapter<?>, Aggregation<?, ?, ?>> aggregation,
final Pair<List<String>, DataAdapter<?>> fieldIdsAdapterPair,
final IndexMetaData[] indexMetaData,
final DuplicateEntryCount duplicateCounts,
final DifferingFieldVisibilityEntryCount visibilityCounts,
final String[] authorizations ) {
this(
adapterIds,
index,
query != null ? query.getIndexConstraints(index) : null,
query != null ? query.createFilters(index) : null,
clientDedupeFilter,
scanCallback,
aggregation,
fieldIdsAdapterPair,
indexMetaData,
duplicateCounts,
visibilityCounts,
authorizations);
}
示例11: testChooseTemporalWithoutStatsHouseHour
import mil.nga.giat.geowave.core.index.ByteArrayId; //导入依赖的package包/类
@Test
public void testChooseTemporalWithoutStatsHouseHour() {
final ChooseLocalityPreservingQueryStrategy strategy = new ChooseLocalityPreservingQueryStrategy();
final Iterator<Index<?, ?>> it = getIndices(
new HashMap<ByteArrayId, DataStatistics<SimpleFeature>>(),
new BasicQuery(
createConstraints(
HOUSE,
HOUSE,
HOUR)),
strategy);
assertTrue(it.hasNext());
assertEquals(
indices.get(
1).getId(),
it.next().getId());
assertFalse(it.hasNext());
}
示例12: getVisibility
import mil.nga.giat.geowave.core.index.ByteArrayId; //导入依赖的package包/类
@Override
public byte[] getVisibility(
T rowValue,
ByteArrayId fieldId,
CommonIndexValue fieldValue ) {
SimpleFeature feature = (SimpleFeature) rowValue;
Object visibilityAttributeValue = feature.getAttribute(this.visibilityAttribute);
final byte[] result = visibilityAttributeValue != null ? translateVisibility(
visibilityAttributeValue,
fieldName) : null;
return result != null ? result : (defaultFieldVisiblityHandler == null ? new byte[0]
: defaultFieldVisiblityHandler.getVisibility(
rowValue,
fieldId,
fieldValue));
}
示例13: getCountInternal
import mil.nga.giat.geowave.core.index.ByteArrayId; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
@Override
protected int getCountInternal(
final Query query )
throws IOException {
final Map<ByteArrayId, DataStatistics<SimpleFeature>> stats = new GeoWaveEmptyTransaction(
components).getDataStatistics();
final DataStatistics<SimpleFeature> countStats = stats.get(CountDataStatistics.STATS_TYPE);
if ((countStats != null) && query.getFilter().equals(
Filter.INCLUDE)) {
return (int) ((CountDataStatistics) countStats).getCount();
}
else {
try (GeoWaveFeatureReader reader = new GeoWaveFeatureReader(
query,
new GeoWaveEmptyTransaction(
components),
components)) {
return (int) reader.getCount();
}
}
}
示例14: MergingEntryIterator
import mil.nga.giat.geowave.core.index.ByteArrayId; //导入依赖的package包/类
public MergingEntryIterator(
final AdapterStore adapterStore,
final PrimaryIndex index,
final Iterator<Result> scannerIt,
final QueryFilter clientFilter,
final ScanCallback<T> scanCallback,
final Map<ByteArrayId, RowMergingDataAdapter> mergingAdapters,
final Pair<List<String>, DataAdapter<?>> fieldIds,
final double[] maxResolutionSubsamplingPerDimension,
final boolean hasSkippingFilter ) {
super(
adapterStore,
index,
scannerIt,
clientFilter,
scanCallback,
fieldIds,
maxResolutionSubsamplingPerDimension,
true,
hasSkippingFilter);
this.mergingAdapters = mergingAdapters;
transforms = new HashMap<ByteArrayId, RowTransform>();
}
示例15: createStandardScanner
import mil.nga.giat.geowave.core.index.ByteArrayId; //导入依赖的package包/类
protected Scan createStandardScanner(
final Integer limit ) {
final Scan scanner = new Scan();
// Performance tuning per store options
scanner.setCaching(getScanCacheSize());
scanner.setCacheBlocks(isEnableBlockCache());
// Only return the most recent version
scanner.setMaxVersions(1);
if ((adapterIds != null) && !adapterIds.isEmpty()) {
for (final ByteArrayId adapterId : adapterIds) {
scanner.addFamily(adapterId.getBytes());
}
}
if ((limit != null) && (limit > 0) && (limit < scanner.getBatch())) {
scanner.setBatch(limit);
}
return scanner;
}