congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
DataIndexUtils
Code IndexAdd Tabnine to your IDE (free)

How to use
DataIndexUtils
in
org.locationtech.geowave.core.store.base.dataidx

Best Java code snippets using org.locationtech.geowave.core.store.base.dataidx.DataIndexUtils (Showing top 20 results out of 315)

origin: locationtech/geowave

public Iterator<GeoWaveRow> getRows(final byte[][] dataIds, final short adapterId) {
 final Map<byte[], byte[]> results =
   getCurrentSyncCollection().getAll(new HashSet<>(Arrays.asList(dataIds)));
 return Arrays.stream(dataIds).map(
   dataId -> DataIndexUtils.deserializeDataIndexRow(
     dataId,
     adapterId,
     results.get(dataId),
     visibilityEnabled)).iterator();
}
origin: locationtech/geowave

public synchronized void add(final byte[] dataId, final GeoWaveValue value) {
 put(dataId, DataIndexUtils.serializeDataIndexValue(value, visibilityEnabled));
}
origin: locationtech/geowave

 public boolean createIndex(final Index index) throws IOException {
  final String indexName = index.getName();
  return createTable(getQualifiedTableName(indexName), DataIndexUtils.isDataIndex(indexName));
 }
}
origin: locationtech/geowave

  new AdapterStoreWrapper(adapterStore, internalAdapterStore);
final DataIndexRetrieval dataIndexRetrieval =
  DataIndexUtils.getDataIndexRetrieval(
    operations,
    persistentAdapterStore,
origin: locationtech/geowave

public boolean adapterSupportsDataIndex() {
 return DataIndexUtils.adapterSupportsDataIndex(getDataAdapter());
}
origin: locationtech/geowave

public static GeoWaveRow deserializeDataIndexRow(
  final byte[] dataId,
  final short adapterId,
  final byte[] serializedValue,
  final boolean visibilityEnabled) {
 return new GeoWaveRowImpl(
   new GeoWaveKeyImpl(dataId, adapterId, new byte[0], new byte[0], 0),
   new GeoWaveValue[] {deserializeDataIndexValue(serializedValue, visibilityEnabled)});
}
origin: locationtech/geowave

  statisticsStore,
  sanitizedQueryOptions.getAuthorizations()),
DataIndexUtils.getDataIndexRetrieval(
  baseOperations,
  adapterStore,
origin: locationtech/geowave

if (secondaryIndex && DataIndexUtils.adapterSupportsDataIndex(adapter) && !dataIdIndex) {
 byte[] indexModelVisibility = new byte[0];
 if (visibilityEnabled) {
origin: locationtech/geowave

private BatchGetItemResult getResults(
  final Map<String, KeysAndAttributes> requestItems,
  final short adapterId,
  final Map<ByteArray, GeoWaveRow> resultMap) {
 final BatchGetItemRequest request = new BatchGetItemRequest(requestItems);
 final BatchGetItemResult result = client.batchGetItem(request);
 result.getResponses().values().forEach(results -> results.stream().forEach(objMap -> {
  final byte[] dataId = objMap.get(DynamoDBRow.GW_PARTITION_ID_KEY).getB().array();
  final AttributeValue valueAttr = objMap.get(DynamoDBRow.GW_VALUE_KEY);
  final byte[] value = valueAttr == null ? null : valueAttr.getB().array();
  resultMap.put(
    new ByteArray(dataId),
    DataIndexUtils.deserializeDataIndexRow(dataId, adapterId, value, false));
 }));
 return result;
}
origin: locationtech/geowave

public void add(final byte[] dataId, final GeoWaveValue value) {
 preAdd();
 getCurrentAsyncCollection().putAsync(
   dataId,
   DataIndexUtils.serializeDataIndexValue(value, visibilityEnabled));
}
origin: locationtech/geowave

 final String[] additionalAuthorizations,
 final int dataIndexBatchSize) {
if ((dataIndexBatchSize > 0) && !isDataIndex(index.getName())) {
origin: locationtech/geowave

differingVisibilityCounts,
visibilityCounts,
DataIndexUtils.getDataIndexRetrieval(
  baseOperations,
  adapterStore,
origin: locationtech/geowave

private <T> Writer<T> createWriter(final InternalDataAdapter<T> adapter, final Index... indices) {
 boolean secondaryIndex =
   baseOptions.isSecondaryIndexing() && DataIndexUtils.adapterSupportsDataIndex(adapter);
 final Writer<T>[] writers = new Writer[secondaryIndex ? indices.length + 1 : indices.length];
origin: locationtech/geowave

 public synchronized CloseableIterator<GeoWaveRow> dataIndexIterator(final byte[][] dataIds) {
  final RocksDB readDb = getReadDb();
  if (readDb == null) {
   return new CloseableIterator.Empty<>();
  }
  try {
   final List<byte[]> dataIdsList = Arrays.asList(dataIds);
   final Map<byte[], byte[]> dataIdxResults = readDb.multiGet(dataIdsList);
   return new CloseableIterator.Wrapper(
     dataIdsList.stream().map(
       dataId -> DataIndexUtils.deserializeDataIndexRow(
         dataId,
         adapterId,
         dataIdxResults.get(dataId),
         visibilityEnabled)).iterator());
  } catch (final RocksDBException e) {
   LOGGER.error("Unable to get values by data ID", e);
  }
  return new CloseableIterator.Empty<>();
 }
}
origin: locationtech/geowave

retVal[i].set(
  CassandraField.GW_VALUE_KEY.getBindMarkerName(),
  ByteBuffer.wrap(DataIndexUtils.serializeDataIndexValue(value, visibilityEnabled)),
  ByteBuffer.class);
i++;
origin: locationtech/geowave

private boolean createTable(final String indexName) {
 synchronized (CREATE_TABLE_MUTEX) {
  try {
   if (!indexExists(indexName)) {
    final String tableName = getCassandraSafeName(indexName);
    final Create create = getCreateTable(tableName);
    CassandraField[] fields = CassandraField.values();
    if (DataIndexUtils.isDataIndex(tableName)) {
     fields =
       Arrays.stream(fields).filter(f -> f.isDataIndexColumn()).toArray(
         i -> new CassandraField[i]);
    }
    for (final CassandraField f : fields) {
     f.addColumn(create);
    }
    executeCreateTable(create, tableName);
    return true;
   }
  } catch (final IOException e) {
   LOGGER.error("Unable to create table '" + indexName + "'", e);
  }
 }
 return false;
}
origin: locationtech/geowave

  statisticsStore,
  sanitizedQueryOptions.getAuthorizations()),
DataIndexUtils.getDataIndexRetrieval(
  baseOperations,
  adapterStore,
origin: locationtech/geowave

public Iterator<GeoWaveRow> getDataIndexResults(
  final byte[][] rows,
  final short adapterId,
  final String... additionalAuthorizations) {
 Result[] results = null;
 final byte[] family = StringUtils.stringToBinary(ByteArrayUtils.shortToString(adapterId));
 try (final Table table = conn.getTable(getTableName(DataIndexUtils.DATA_ID_INDEX.getName()))) {
  results = table.get(Arrays.stream(rows).map(r -> {
   final Get g = new Get(r);
   g.addFamily(family);
   if ((additionalAuthorizations != null) && (additionalAuthorizations.length > 0)) {
    g.setAuthorizations(new Authorizations(additionalAuthorizations));
   }
   return g;
  }).collect(Collectors.toList()));
 } catch (final IOException e) {
  LOGGER.error("Unable to close HBase table", e);
 }
 if (results != null) {
  return Arrays.stream(results).map(
    r -> DataIndexUtils.deserializeDataIndexRow(
      r.getRow(),
      adapterId,
      r.getValue(family, new byte[0]),
      false)).iterator();
 }
 return Collections.emptyIterator();
}
origin: locationtech/geowave

 private RowMutations rowToMutation(final GeoWaveRow row) {
  final RowMutations mutation = new RowMutations(row.getDataId());
  for (final GeoWaveValue value : row.getFieldValues()) {
   final Put put = new Put(row.getDataId());
   // visibility is in the visibility column so no need to serialize it with the value
   put.addColumn(
     StringUtils.stringToBinary(ByteArrayUtils.shortToString(row.getAdapterId())),
     new byte[0],
     DataIndexUtils.serializeDataIndexValue(value, false));
   if ((value.getVisibility() != null) && (value.getVisibility().length > 0)) {
    put.setCellVisibility(
      new CellVisibility(StringUtils.stringFromBinary(value.getVisibility())));
   }
   try {
    mutation.add(put);
   } catch (final IOException e) {
    LOGGER.error("Error creating HBase row mutation: " + e.getMessage());
   }
  }

  return mutation;
 }
}
origin: locationtech/geowave

@Override
public RowWriter createWriter(final Index index, final InternalDataAdapter<?> adapter) {
 final boolean isDataIndex = DataIndexUtils.isDataIndex(index.getName());
 final String qName = getQualifiedTableName(index.getName());
 final DynamoDBWriter writer = new DynamoDBWriter(client, qName, isDataIndex);
 createTable(qName, isDataIndex);
 return writer;
}
org.locationtech.geowave.core.store.base.dataidxDataIndexUtils

Most used methods

  • deserializeDataIndexRow
  • serializeDataIndexValue
  • isDataIndex
  • getDataIndexRetrieval
  • adapterSupportsDataIndex
  • deserializeDataIndexValue
  • getFieldValuesFromDataIdIndex
  • getRowReader

Popular in Java

  • Making http post requests using okhttp
  • putExtra (Intent)
  • addToBackStack (FragmentTransaction)
  • onCreateOptionsMenu (Activity)
  • String (java.lang)
  • Permission (java.security)
    Legacy security code; do not use.
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • JTextField (javax.swing)
  • PhpStorm for WordPress
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now