作者:广东抱米花_冰月 | 来源:互联网 | 2023-09-12 18:51
本文整理了Java中com.google.common.collect.HashMultiset.isEmpty()
方法的一些代码示例,展示了HashMultiset.isEmpty()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HashMultiset.isEmpty()
方法的具体详情如下:
包路径:com.google.common.collect.HashMultiset
类名称:HashMultiset
方法名:isEmpty
HashMultiset.isEmpty介绍
暂无
代码示例
代码示例来源:origin: ch.cern.hadoop/hadoop-hdfs
@Test
public void testMultiplePeersWithSameKey() throws Exception {
final int CAPACITY = 3;
PeerCache cache = new PeerCache(CAPACITY, 100000);
DatanodeID dnId = new DatanodeID("192.168.0.1",
"fakehostname", "fake_datanode_id",
100, 101, 102, 103);
HashMultiset peers = HashMultiset.create(CAPACITY);
for (int i = 0; i FakePeer peer = new FakePeer(dnId, false);
peers.add(peer);
cache.put(dnId, peer);
}
// Check that all of the peers ended up in the cache
assertEquals(CAPACITY, cache.size());
while (!peers.isEmpty()) {
Peer peer = cache.get(dnId, false);
assertTrue(peer != null);
assertTrue(!peer.isClosed());
peers.remove(peer);
}
assertEquals(0, cache.size());
cache.close();
}
代码示例来源:origin: org.apache.hadoop/hadoop-hdfs-client
@Test
public void testMultiplePeersWithSameKey() throws Exception {
final int CAPACITY = 3;
PeerCache cache = new PeerCache(CAPACITY, 100000);
DatanodeID dnId = new DatanodeID("192.168.0.1",
"fakehostname", "fake_datanode_id",
100, 101, 102, 103);
HashMultiset peers = HashMultiset.create(CAPACITY);
for (int i = 0; i FakePeer peer = new FakePeer(dnId, false);
peers.add(peer);
cache.put(dnId, peer);
}
// Check that all of the peers ended up in the cache
assertEquals(CAPACITY, cache.size());
while (!peers.isEmpty()) {
Peer peer = cache.get(dnId, false);
assertTrue(peer != null);
assertTrue(!peer.isClosed());
peers.remove(peer);
}
assertEquals(0, cache.size());
cache.close();
}
代码示例来源:origin: ch.cern.hadoop/hadoop-hdfs
assertTrue(peer == null);
while (!peers.isEmpty()) {
peer = cache.get(dnId, false);
assertTrue(peer != null);
代码示例来源:origin: org.apache.hadoop/hadoop-hdfs-client
assertTrue(peer == null);
while (!peers.isEmpty()) {
peer = cache.get(dnId, false);
assertTrue(peer != null);