Java Code Examples for org.apache.accumulo.core.data.Key#isDeleted()

The following examples show how to use org.apache.accumulo.core.data.Key#isDeleted() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: QueryFilterIterator.java    From geowave with Apache License 2.0 6 votes vote down vote up
protected static void findTopEnhanced(
    final SortedKeyValueIterator<Key, Value> source,
    final Filter filter) {
  Key key;
  if (source.hasTop()) {
    key = source.getTopKey();
  } else {
    return;
  }
  while (!key.isDeleted() && !filter.accept(key, source.getTopValue())) {
    try {
      source.next();
      if (source.hasTop()) {
        key = source.getTopKey();
      } else {
        return;
      }
    } catch (final IOException e) {
      throw new RuntimeException(e);
    }
  }
}
 
Example 2
Source File: LiveContextWriter.java    From datawave with Apache License 2.0 5 votes vote down vote up
/**
 * Turn a key, value into a mutation
 * 
 * @param key
 * @param value
 * @return the mutation
 */
protected Mutation getMutation(Key key, Value value) {
    Mutation m = new Mutation(key.getRow());
    if (key.isDeleted()) {
        m.putDelete(key.getColumnFamily(), key.getColumnQualifier(), new ColumnVisibility(key.getColumnVisibility()), key.getTimestamp());
    } else {
        m.put(key.getColumnFamily(), key.getColumnQualifier(), new ColumnVisibility(key.getColumnVisibility()), key.getTimestamp(), value);
    }
    return m;
}
 
Example 3
Source File: EvaluatingIterator.java    From accumulo-recipes with Apache License 2.0 5 votes vote down vote up
@Override
public Key getReturnKey(Key k) {
    // If we were using column visibility, then we would get the merged visibility here and use it in the key.
    // Remove the COLQ from the key and use the combined visibility
    Key r = new Key(k.getRowData().getBackingArray(), k.getColumnFamilyData().getBackingArray(), EMPTY_BYTE, k.getColumnVisibility().getBytes(),
        k.getTimestamp(), k.isDeleted(), false);
    return r;
}