Java Code Examples for org.apache.accumulo.core.iterators.IteratorEnvironment#isFullMajorCompaction()

The following examples show how to use org.apache.accumulo.core.iterators.IteratorEnvironment#isFullMajorCompaction() . 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: GarbageCollectionIterator.java    From fluo with Apache License 2.0 6 votes vote down vote up
@Override
public void init(SortedKeyValueIterator<Key, Value> source, Map<String, String> options,
    IteratorEnvironment env) throws IOException {

  if (env.getIteratorScope() == IteratorScope.scan) {
    throw new IllegalArgumentException();
  }
  this.source = source;
  isFullMajc = env.getIteratorScope() == IteratorScope.majc && env.isFullMajorCompaction();

  String oats = options.get(GC_TIMESTAMP_OPT);
  if (oats != null) {
    gcTimestamp = Long.valueOf(oats);
  } else {
    String zookeepers = options.get(ZOOKEEPER_CONNECT_OPT);
    if (zookeepers == null) {
      throw new IllegalArgumentException("A configuration item for GC iterator was not set");
    }
    gcTimestamp = ZookeeperUtil.getGcTimestamp(zookeepers);
  }
}
 
Example 2
Source File: RowIterator.java    From datawave with Apache License 2.0 5 votes vote down vote up
@Override
public void init(SortedKeyValueIterator<Key,Value> source, Map<String,String> options, IteratorEnvironment env) throws IOException {
    super.init(source, options, env);
    // MockAccumulo seems to throw in a null env, so this check is here
    if (env == null) {
        bypass = false;
    } else {
        IteratorScope scope = env.getIteratorScope();
        bypass = scope.equals(IteratorScope.minc) || (scope.equals(IteratorScope.majc) && !env.isFullMajorCompaction());
    }
    if (bypass)
        log.info(this.getClass().getSimpleName() + " only works for scans and full major compactions;"
                        + " Note that full major compactions only work if the entire row is contained in a single locality group.");
}
 
Example 3
Source File: NotificationIterator.java    From fluo with Apache License 2.0 5 votes vote down vote up
@Override
public void init(SortedKeyValueIterator<Key, Value> source, Map<String, String> options,
    IteratorEnvironment env) throws IOException {
  scanOrFullMajc = env.getIteratorScope() == IteratorScope.scan
      || (env.getIteratorScope() == IteratorScope.majc && env.isFullMajorCompaction());
  super.init(new PushbackIterator(source), options, env);
}
 
Example 4
Source File: ConfigurableAgeOffFilter.java    From datawave with Apache License 2.0 2 votes vote down vote up
/**
 * return true if this is a system initiated majc (a majc that is not a full major compaction)
 *
 * @param env
 */
private boolean isSystemInitiatedMajC(IteratorEnvironment env) {
    return (env != null && env.getIteratorScope().equals(IteratorUtil.IteratorScope.majc) && !env.isFullMajorCompaction());
}