com.google.common.collect.Multimaps#filterKeys ( )源码实例Demo

下面列出了com.google.common.collect.Multimaps#filterKeys ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: datawave   文件: TermOffsetPopulator.java
/**
 * Finds all the content functions and returns a map indexed by function name to the function.
 */
public static Multimap<String,Function> getContentFunctions(JexlNode query) {
    FunctionReferenceVisitor visitor = new FunctionReferenceVisitor();
    query.jjtAccept(visitor, null);
    
    Multimap<String,Function> functionsInNamespace = Multimaps.index(visitor.functions().get(ContentFunctions.CONTENT_FUNCTION_NAMESPACE), Function::name);
    
    return Multimaps.filterKeys(functionsInNamespace, TermOffsetPopulator::isContentFunctionTerm);
}
 
源代码2 项目: codebuff   文件: ServiceManager.java
void awaitHealthy(long timeout, TimeUnit unit) throws TimeoutException {
      monitor.enter();
      try {
        if (!monitor.waitForUninterruptibly(awaitHealthGuard, timeout, unit)) {
          throw new TimeoutException(
            "Timeout waiting for the services to become healthy. The "
+ "following services have not started: " + Multimaps.filterKeys(servicesByState, in(ImmutableSet.of(NEW, STARTING))));
        }
        checkHealthy();
      } finally {
        monitor.leave();
      }
    }
 
源代码3 项目: codebuff   文件: ServiceManager.java
void awaitStopped(long timeout, TimeUnit unit) throws TimeoutException {
      monitor.enter();
      try {
        if (!monitor.waitForUninterruptibly(stoppedGuard, timeout, unit)) {
          throw new TimeoutException(
            "Timeout waiting for the services to stop. The following "
+ "services have not stopped: " + Multimaps.filterKeys(servicesByState, not(in(EnumSet.of(TERMINATED, FAILED)))));
        }
      } finally {
        monitor.leave();
      }
    }
 
源代码4 项目: codebuff   文件: ServiceManager.java
@GuardedBy("monitor")
void checkHealthy() {
  if (states.count(RUNNING) != numberOfServices) {
    IllegalStateException exception = new IllegalStateException("Expected to be healthy after starting. The following services are not running: " + Multimaps.filterKeys(servicesByState, not(equalTo(RUNNING))));
    throw exception;
  }
}
 
源代码5 项目: codebuff   文件: ServiceManager.java
void awaitHealthy(long timeout, TimeUnit unit) throws TimeoutException {
      monitor.enter();
      try {
        if (!monitor.waitForUninterruptibly(awaitHealthGuard, timeout, unit)) {
          throw new TimeoutException(
            "Timeout waiting for the services to become healthy. The "
+ "following services have not started: " + Multimaps.filterKeys(servicesByState, in(ImmutableSet.of(NEW, STARTING))));
        }
        checkHealthy();
      } finally {
        monitor.leave();
      }
    }
 
源代码6 项目: codebuff   文件: ServiceManager.java
void awaitStopped(long timeout, TimeUnit unit) throws TimeoutException {
      monitor.enter();
      try {
        if (!monitor.waitForUninterruptibly(stoppedGuard, timeout, unit)) {
          throw new TimeoutException(
            "Timeout waiting for the services to stop. The following "
+ "services have not stopped: " + Multimaps.filterKeys(servicesByState, not(in(EnumSet.of(TERMINATED, FAILED)))));
        }
      } finally {
        monitor.leave();
      }
    }
 
源代码7 项目: codebuff   文件: ServiceManager.java
@GuardedBy("monitor")
void checkHealthy() {
  if (states.count(RUNNING) != numberOfServices) {
    IllegalStateException exception = new IllegalStateException("Expected to be healthy after starting. The following services are not running: " + Multimaps.filterKeys(servicesByState, not(equalTo(RUNNING))));
    throw exception;
  }
}
 
源代码8 项目: codebuff   文件: ServiceManager.java
void awaitHealthy(long timeout, TimeUnit unit) throws TimeoutException {
  monitor.enter();
  try {
    if (!monitor.waitForUninterruptibly(awaitHealthGuard, timeout, unit)) {
      throw new TimeoutException("Timeout waiting for the services to become healthy. The "
      + "following services have not started: " + Multimaps.filterKeys(servicesByState, in(ImmutableSet.of(NEW, STARTING))));
    }
    checkHealthy();
  } finally {
    monitor.leave();
  }
}
 
源代码9 项目: codebuff   文件: ServiceManager.java
void awaitStopped(long timeout, TimeUnit unit) throws TimeoutException {
  monitor.enter();
  try {
    if (!monitor.waitForUninterruptibly(stoppedGuard, timeout, unit)) {
      throw new TimeoutException("Timeout waiting for the services to stop. The following "
      + "services have not stopped: " + Multimaps.filterKeys(servicesByState, not(in(EnumSet.of(TERMINATED, FAILED)))));
    }
  } finally {
    monitor.leave();
  }
}
 
源代码10 项目: codebuff   文件: ServiceManager.java
@GuardedBy("monitor")
void checkHealthy() {
  if (states.count(RUNNING) != numberOfServices) {
    IllegalStateException exception = new IllegalStateException("Expected to be healthy after starting. The following services are not running: " + Multimaps.filterKeys(servicesByState, not(equalTo(RUNNING))));
    throw exception;
  }
}
 
源代码11 项目: codebuff   文件: ServiceManager.java
void awaitHealthy(long timeout, TimeUnit unit) throws TimeoutException {
  monitor.enter();
  try {
    if (!monitor.waitForUninterruptibly(awaitHealthGuard, timeout, unit)) {
      throw new TimeoutException(
        "Timeout waiting for the services to become healthy. The "
        + "following services have not started: " + Multimaps.filterKeys(servicesByState, in(ImmutableSet.of(NEW, STARTING))));
    }
    checkHealthy();
  } finally {
    monitor.leave();
  }
}
 
源代码12 项目: codebuff   文件: ServiceManager.java
void awaitStopped(long timeout, TimeUnit unit) throws TimeoutException {
  monitor.enter();
  try {
    if (!monitor.waitForUninterruptibly(stoppedGuard, timeout, unit)) {
      throw new TimeoutException(
        "Timeout waiting for the services to stop. The following "
        + "services have not stopped: " + Multimaps.filterKeys(servicesByState, not(in(EnumSet.of(TERMINATED, FAILED)))));
    }
  } finally {
    monitor.leave();
  }
}
 
源代码13 项目: codebuff   文件: ServiceManager.java
@GuardedBy("monitor")
void checkHealthy() {
  if (states.count(RUNNING) != numberOfServices) {
    IllegalStateException exception = new IllegalStateException("Expected to be healthy after starting. The following services are not running: " + Multimaps.filterKeys(servicesByState, not(equalTo(RUNNING))));
    throw exception;
  }
}
 
源代码14 项目: codebuff   文件: ServiceManager.java
void awaitHealthy(long timeout, TimeUnit unit) throws TimeoutException {
  monitor.enter();
  try {
    if (!monitor.waitForUninterruptibly(awaitHealthGuard, timeout, unit)) {
      throw new TimeoutException(
          "Timeout waiting for the services to become healthy. The "
              + "following services have not started: "
              + Multimaps.filterKeys(servicesByState, in(ImmutableSet.of(NEW, STARTING))));
    }
    checkHealthy();
  } finally {
    monitor.leave();
  }
}
 
源代码15 项目: codebuff   文件: ServiceManager.java
void awaitStopped(long timeout, TimeUnit unit) throws TimeoutException {
  monitor.enter();
  try {
    if (!monitor.waitForUninterruptibly(stoppedGuard, timeout, unit)) {
      throw new TimeoutException(
          "Timeout waiting for the services to stop. The following "
              + "services have not stopped: "
              + Multimaps.filterKeys(servicesByState, not(in(EnumSet.of(TERMINATED, FAILED)))));
    }
  } finally {
    monitor.leave();
  }
}
 
源代码16 项目: codebuff   文件: ServiceManager.java
@GuardedBy("monitor")
void checkHealthy() {
  if (states.count(RUNNING) != numberOfServices) {
    IllegalStateException exception =
        new IllegalStateException(
            "Expected to be healthy after starting. The following services are not running: "
                + Multimaps.filterKeys(servicesByState, not(equalTo(RUNNING))));
    throw exception;
  }
}
 
源代码17 项目: tac-kbp-eal   文件: EventArgScoringAlignment.java
public EventArgScoringAlignment<EquivClassType> copyFiltered(
    final Predicate<EquivClassType> filter) {
  return new EventArgScoringAlignment<EquivClassType>(docID(), argumentOutput, answerKey,
      Iterables.filter(truePositiveECs, filter),
      Iterables.filter(falsePositiveECs, filter),
      Iterables.filter(falseNegativeECs, filter),
      Iterables.filter(unassessed, filter),
      Multimaps.filterKeys(ecsToAnswerKey, filter),
      Multimaps.filterKeys(ecsToSystem, filter));
}
 
源代码18 项目: james-project   文件: RecordingMetricFactory.java
public Multimap<String, Duration> executionTimesForPrefixName(String prefixName) {
    synchronized (executionTimes) {
        return Multimaps.filterKeys(executionTimes, key -> key.startsWith(prefixName));
    }
}
 
源代码19 项目: datawave   文件: TermFrequencyList.java
/**
 * Return only offsets for a limited set of fields
 * 
 * @param fields
 * @return
 */
public TreeMultimap<Zone,TermWeightPosition> fetchOffsets(Set<Zone> fields) {
    checkNotNull(fields);
    
    return (TreeMultimap<Zone,TermWeightPosition>) Multimaps.filterKeys(this.offsetsPerField, new FieldFilterPredicate(fields));
}