本文整理了Java中java.util.concurrent.ConcurrentSkipListMap.tailMap()
方法的一些代码示例,展示了ConcurrentSkipListMap.tailMap()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ConcurrentSkipListMap.tailMap()
方法的具体详情如下:
包路径:java.util.concurrent.ConcurrentSkipListMap
类名称:ConcurrentSkipListMap
方法名:tailMap
暂无
代码示例来源:origin: robovm/robovm
/**
* @throws ClassCastException {@inheritDoc}
* @throws NullPointerException if {@code fromKey} is null
* @throws IllegalArgumentException {@inheritDoc}
*/
public ConcurrentNavigableMap<K,V> tailMap(K fromKey) {
return tailMap(fromKey, true);
}
代码示例来源:origin: apache/geode
public CloseableIterator<CachedDeserializable> valueIterator(Object start,
boolean startInclusive) {
return new ItrAdapter(map.tailMap(start, startInclusive).values().iterator());
}
代码示例来源:origin: apache/geode
@Override
public long sizeToEnd(Object start) {
byte[] startBytes = ByteComparator.MIN_BYTES;
return map.tailMap(new Pair(start, startBytes)).size();
}
代码示例来源:origin: apache/hbase
ArrayList<RegionStateNode> getTableRegionStateNodes(final TableName tableName) {
final ArrayList<RegionStateNode> regions = new ArrayList<RegionStateNode>();
for (RegionStateNode node: regionsMap.tailMap(tableName.getName()).values()) {
if (!node.getTable().equals(tableName)) break;
regions.add(node);
}
return regions;
}
代码示例来源:origin: lealone/Lealone
@Override
public StorageMapCursor<K, V> cursor(K from) {
return new MemoryMapCursor<>(
from == null ? skipListMap.entrySet().iterator() : skipListMap.tailMap(from).entrySet().iterator());
}
代码示例来源:origin: lealone/Lealone
Cursor(BufferedMap<K, V> bmap, IterationParameters<K> parameters) {
if (parameters.from == null)
bufferIterator = bmap.buffer.entrySet().iterator();
else
bufferIterator = bmap.buffer.tailMap(parameters.from).entrySet().iterator();
mapCursor = bmap.map.cursor(parameters);
keyType = bmap.map.getKeyType();
}
代码示例来源:origin: apache/hbase
ArrayList<RegionState> getTableRegionStates(final TableName tableName) {
final ArrayList<RegionState> regions = new ArrayList<RegionState>();
for (RegionStateNode node: regionsMap.tailMap(tableName.getName()).values()) {
if (!node.getTable().equals(tableName)) break;
regions.add(node.toRegionState());
}
return regions;
}
代码示例来源:origin: apache/hbase
ArrayList<RegionInfo> getTableRegionsInfo(final TableName tableName) {
final ArrayList<RegionInfo> regions = new ArrayList<RegionInfo>();
for (RegionStateNode node: regionsMap.tailMap(tableName.getName()).values()) {
if (!node.getTable().equals(tableName)) break;
regions.add(node.getRegionInfo());
}
return regions;
}
代码示例来源:origin: apache/geode
@Override
public CloseableIterator<CachedDeserializable> keyIterator(Object start, boolean startInclusive) {
byte[] startBytes = startInclusive ? ByteComparator.MIN_BYTES : ByteComparator.MAX_BYTES;
return new KeyItr(
map.tailMap(new Pair(start, startBytes), startInclusive).entrySet().iterator());
}
代码示例来源:origin: apache/geode
@Override
public CloseableIterator<IndexEntry> iterator(Object start, boolean startInclusive) {
byte[] startBytes = startInclusive ? ByteComparator.MIN_BYTES : ByteComparator.MAX_BYTES;
return new Itr(map.tailMap(new Pair(start, startBytes), startInclusive).entrySet().iterator());
}
代码示例来源:origin: googleapis/google-cloud-java
Map<String, Project> projectsToScan = projects;
if (pageToken != null) {
projectsToScan = projects.tailMap(pageToken);
代码示例来源:origin: apache/hbase
@Test
public void testTailMap() throws Exception {
Map<Long, Long> fromCsm = csm.tailMap(50L);
Map<Long, Long> fromM = m.tailMap(50L);
assertEquals(fromCsm, fromM);
for (Long value:m.keySet()) {
assertEquals(csm.tailMap(value), m.tailMap(value));
}
for ( long i = 0 ; i < 100; i++ ) {
long o = ThreadLocalRandom.current().nextLong(MAX_RAND);
assertEquals(csm.tailMap(o), m.tailMap(o));
}
}
代码示例来源:origin: io.dropwizard.metrics/metrics-core
private void trim() {
final long now = getTick();
final long windowStart = now - window;
final long windowEnd = now + CLEAR_BUFFER;
if (windowStart < windowEnd) {
measurements.headMap(windowStart).clear();
measurements.tailMap(windowEnd).clear();
} else {
measurements.subMap(windowEnd, windowStart).clear();
}
}
}
代码示例来源:origin: apache/hbase
public boolean isReplicaAvailableForRegion(final RegionInfo info) {
// if the region info itself is a replica return true.
if (!RegionReplicaUtil.isDefaultReplica(info)) {
return true;
}
// iterate the regionsMap for the given region name. If there are replicas it should
// list them in order.
for (RegionStateNode node : regionsMap.tailMap(info.getRegionName()).values()) {
if (!node.getTable().equals(info.getTable())
|| !ServerRegionReplicaUtil.isReplicasForSameRegion(info, node.getRegionInfo())) {
break;
} else if (!RegionReplicaUtil.isDefaultReplica(node.getRegionInfo())) {
// we have replicas
return true;
}
}
// we don have replicas
return false;
}
代码示例来源:origin: MobiVM/robovm
/**
* @throws ClassCastException {@inheritDoc}
* @throws NullPointerException if {@code fromKey} is null
* @throws IllegalArgumentException {@inheritDoc}
*/
public ConcurrentNavigableMap<K,V> tailMap(K fromKey) {
return tailMap(fromKey, true);
}
代码示例来源:origin: ibinti/bugvm
/**
* @throws ClassCastException {@inheritDoc}
* @throws NullPointerException if {@code fromKey} is null
* @throws IllegalArgumentException {@inheritDoc}
*/
public ConcurrentNavigableMap<K,V> tailMap(K fromKey) {
return tailMap(fromKey, true);
}
代码示例来源:origin: io.snappydata/gemfire-core
@Override
public CloseableIterator<IndexStoreEntry> iterator(Object start,
boolean startInclusive, Collection keysToRemove) {
return new MemoryIndexStoreIterator(this.valueToEntriesMap
.tailMap(start, startInclusive).entrySet().iterator(),
null, null, keysToRemove);
}
代码示例来源:origin: io.snappydata/gemfire-core
@Override
public CloseableIterator<IndexStoreEntry> descendingIterator(Object start,
boolean startInclusive, Collection keysToRemove) {
return new MemoryIndexStoreIterator(this.valueToEntriesMap
.tailMap(start, startInclusive).descendingMap().entrySet().iterator(),
null, null, keysToRemove);
}
代码示例来源:origin: cinchapi/concourse
@Override
public ConcurrentNavigableMap<K, V> tailMap(K fromKey, boolean inclusive) {
long[] stamps = grabAllSegmentWriteLocks();
try {
sort();
return sorted.tailMap(fromKey, inclusive);
}
finally {
releaseSegmentLocks(stamps);
}
}
代码示例来源:origin: io.dropwizard.metrics5/metrics-core
private void trim() {
final long now = getTick();
final long windowStart = now - window;
final long windowEnd = now + CLEAR_BUFFER;
if (windowStart < windowEnd) {
measurements.headMap(windowStart).clear();
measurements.tailMap(windowEnd).clear();
} else {
measurements.subMap(windowEnd, windowStart).clear();
}
}
}
内容来源于网络,如有侵权,请联系作者删除!