java.util.concurrent.BlockingQueue.containsAll()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(4.2k)|赞(0)|评价(0)|浏览(116)

本文整理了Java中java.util.concurrent.BlockingQueue.containsAll()方法的一些代码示例,展示了BlockingQueue.containsAll()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BlockingQueue.containsAll()方法的具体详情如下:
包路径:java.util.concurrent.BlockingQueue
类名称:BlockingQueue
方法名:containsAll

BlockingQueue.containsAll介绍

暂无

代码示例

代码示例来源:origin: apache/hbase

@Override
public boolean containsAll(Collection<?> elements) {
 return underlyingQueue.containsAll(elements);
}

代码示例来源:origin: apache/zookeeper

/**
 * In the following test, we verify that committed requests are processed
 * even when queuedRequests never gets empty. We add 10 committed request
 * and use infinite queuedRequests. We verify that the committed request was
 * processed.
 */
@Test(timeout = 1000)
public void noStarvationOfNonLocalCommittedRequestsTest() throws Exception {
  final String path = "/noStarvationOfCommittedRequests";
  processor.queuedRequests = new MockRequestsQueue();
  Set<Request> nonLocalCommits = new HashSet<Request>();
  for (int i = 0; i < 10; i++) {
    Request nonLocalCommitReq = newRequest(
        new CreateRequest(path, new byte[0], Ids.OPEN_ACL_UNSAFE,
            CreateMode.PERSISTENT_SEQUENTIAL.toFlag()),
        OpCode.create, 51, i + 1);
    processor.committedRequests.add(nonLocalCommitReq);
    nonLocalCommits.add(nonLocalCommitReq);
  }
  for (int i = 0; i < 10; i++) {
    processor.initThreads(defaultSizeOfThreadPool);
    processor.stoppedMainLoop = true;
    processor.run();
  }
  Assert.assertTrue("commit request was not processed",
      processedRequests.containsAll(nonLocalCommits));
}

代码示例来源:origin: org.elasticsearch/elasticsearch

@Override
  public boolean containsAll(Collection<?> c) {
    return queue.containsAll(c);
  }
}

代码示例来源:origin: apache/zookeeper

processedRequests.peek() == writeReq);
Assert.assertTrue("Did not process following read request",
    processedRequests.containsAll(shouldBeProcessedAfterPending));
Assert.assertTrue("Did not process committed request",
    processor.committedRequests.isEmpty());

代码示例来源:origin: apache/zookeeper

Assert.assertTrue(processedRequests.containsAll(localRequests));

代码示例来源:origin: apache/zookeeper

Assert.assertTrue(processedRequests.containsAll(localRequests));

代码示例来源:origin: apache/zookeeper

processedRequests.containsAll(allReads));
Assert.assertTrue("Did not process the second write request",
    processedRequests.contains(secondCommittedReq));

代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch

@Override
  public boolean containsAll(Collection<?> c) {
    return queue.containsAll(c);
  }
}

代码示例来源:origin: apache/servicemix-bundles

@Override
  public boolean containsAll(Collection<?> c) {
    return queue.containsAll(c);
  }
}

代码示例来源:origin: smallnest/ZKRecipesByExample

@Override
public boolean containsAll(Collection<?> c) {
  return localInternalQueue.containsAll(c);
}

代码示例来源:origin: rsb/rsb

@Override
public boolean containsAll(
    @SuppressWarnings("PMD.ShortVariable") final Collection<?> c) {
  synchronized (this) {
    return this.queue.containsAll(c);
  }
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

@Override
  public boolean containsAll(Collection<?> c) {
    return queue.containsAll(c);
  }
}

代码示例来源:origin: mycila/pubsub

@Override
public boolean containsAll(Collection<?> c) {
  return delegate.containsAll(c);
}

代码示例来源:origin: org.deeplearning4j/deeplearning4j-nn

@Override
public boolean containsAll(Collection<?> c) {
  return backingQueue.containsAll(c);
}

代码示例来源:origin: harbby/presto-connectors

@Override
  public boolean containsAll(Collection<?> c) {
    return queue.containsAll(c);
  }
}

代码示例来源:origin: co.cask.hbase/hbase

@Override
public boolean containsAll(Collection<?> elements) {
 return underlyingQueue.containsAll(elements);
}

代码示例来源:origin: org.apache.hbase/hbase-thrift

@Override
public boolean containsAll(Collection<?> elements) {
 return underlyingQueue.containsAll(elements);
}

代码示例来源:origin: com.aliyun.hbase/alihbase-thrift

@Override
public boolean containsAll(Collection<?> elements) {
 return underlyingQueue.containsAll(elements);
}

代码示例来源:origin: com.github.kaitoy.sneo/sneo-core

public boolean containsAll(Collection<?> c) {
 if (isRunning()) {
  return q.containsAll(c);
 }
 else {
  return false;
 }
}

代码示例来源:origin: org.terracotta/product-upgradability-testing-utils

public boolean containsAll(Collection<?> c) {
 Lock l = lock.readLock();
 l.lock();
 try {
 return backing.containsAll(c);
 } finally {
  l.unlock();
 }
}

相关文章