本文整理了Java中java.util.concurrent.ConcurrentSkipListMap.floorEntry()
方法的一些代码示例,展示了ConcurrentSkipListMap.floorEntry()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ConcurrentSkipListMap.floorEntry()
方法的具体详情如下:
包路径:java.util.concurrent.ConcurrentSkipListMap
类名称:ConcurrentSkipListMap
方法名:floorEntry
[英]Returns a key-value mapping associated with the greatest key less than or equal to the given key, or null if there is no such key. The returned entry does not support the Entry.setValue method.
[中]返回与小于或等于给定键的最大键关联的键值映射,如果没有这样的键,则返回null。返回的条目不支持该条目。设置值方法。
代码示例来源:origin: neo4j/neo4j
private static void doCheckAccess( long pointer, int size )
{
long boundary = pointer + size;
Allocation allocation = lastUsedAllocation.get();
if ( allocation != null )
{
if ( compareUnsigned( allocation.pointer, pointer ) <= 0 &&
compareUnsigned( allocation.boundary, boundary ) > 0 &&
allocation.freeCounter == freeCounter.get() )
{
return;
}
}
Map.Entry<Long,Allocation> fentry = allocations.floorEntry( boundary );
if ( fentry == null || compareUnsigned( fentry.getValue().boundary, boundary ) < 0 )
{
Map.Entry<Long,Allocation> centry = allocations.ceilingEntry( pointer );
throwBadAccess( pointer, size, fentry, centry );
}
//noinspection ConstantConditions
lastUsedAllocation.set( fentry.getValue() );
}
代码示例来源:origin: apache/hbase
@Test
public void testFloorEntry() throws Exception {
for ( int i =0 ; i < 100; i ++) {
Long key = ThreadLocalRandom.current().nextLong();
assertEquals(csm.floorEntry(key), m.floorEntry(key));
}
}
代码示例来源:origin: pbailis/ramp-sigmod2014-code
public DataItem getHighestNotGreaterThan(String key, long timestamp) {
assert(isEiger);
ConcurrentSkipListMap<Long, DataItem> skipListMap = eigerMap.get(key);
if(skipListMap == null)
return DataItem.getNullItem();
Map.Entry<Long, DataItem> ret = skipListMap.floorEntry(timestamp);
if(ret == null)
return DataItem.getNullItem();
return ret.getValue();
}
代码示例来源:origin: the8472/mldht
public List<KBucketEntry> get(Key target, int targetSize)
{
ArrayList<KBucketEntry> closestSet = new ArrayList<>(2 * targetSize);
Map.Entry<Key, CacheBucket> ceil = cache.ceilingEntry(target);
Map.Entry<Key, CacheBucket> floor = cache.floorEntry(target);
do
{
if(floor != null)
{
closestSet.addAll(floor.getValue().entries);
floor = cache.lowerEntry(floor.getKey());
}
if(ceil != null)
{
closestSet.addAll(ceil.getValue().entries);
ceil = cache.higherEntry(ceil.getKey());
}
} while (closestSet.size() / 2 < targetSize && (floor != null || ceil != null));
return closestSet;
}
代码示例来源:origin: cinchapi/concourse
@Override
public java.util.Map.Entry<K, V> floorEntry(K key) {
long[] stamps = grabAllSegmentWriteLocks();
try {
sort();
return sorted.floorEntry(key);
}
finally {
releaseSegmentLocks(stamps);
}
}
代码示例来源:origin: org.neo4j/neo4j-unsafe
private static void doCheckAccess( long pointer, int size )
{
long boundary = pointer + size;
Allocation allocation = lastUsedAllocation.get();
if ( allocation != null )
{
if ( compareUnsigned( allocation.pointer, pointer ) <= 0 &&
compareUnsigned( allocation.boundary, boundary ) > 0 &&
allocation.freeCounter == freeCounter.get() )
{
return;
}
}
Map.Entry<Long,Allocation> fentry = allocations.floorEntry( boundary );
if ( fentry == null || compareUnsigned( fentry.getValue().boundary, boundary ) < 0 )
{
Map.Entry<Long,Allocation> centry = allocations.ceilingEntry( pointer );
throwBadAccess( pointer, size, fentry, centry );
}
//noinspection ConstantConditions
lastUsedAllocation.set( fentry.getValue() );
}
代码示例来源:origin: com.thesett/wam_debugger
Map.Entry<Integer, Integer> entry = addressToRow.floorEntry(start);
int firstRow = (entry == null) ? 0 : (entry.getValue() + 1);
代码示例来源:origin: the8472/mldht
public void onTimeout(RPCCall c) {
Key nodeId = c.getExpectedID();
if(nodeId == null)
return;
Entry<Key, CacheBucket> targetEntry = cache.floorEntry(nodeId);
if(targetEntry == null || !targetEntry.getValue().prefix.isPrefixOf(nodeId))
return;
for(Iterator<KBucketEntry> it = targetEntry.getValue().entries.iterator();it.hasNext();)
{
KBucketEntry e = it.next();
// remove an entry if the id matches
// ignore the removal if we have heard from the node after the request has been issued, it might be a spurious failure
if(e.getID().equals(nodeId) && (e.getLastSeen() < c.getSentTime() || c.getSentTime() == -1))
it.remove();
}
}
代码示例来源:origin: org.apache.hbase/hbase-common
@Test
public void testFloorEntry() throws Exception {
for ( int i =0 ; i < 100; i ++) {
Long key = ThreadLocalRandom.current().nextLong();
assertEquals(csm.floorEntry(key), m.floorEntry(key));
}
}
代码示例来源:origin: com.aliyun.hbase/alihbase-common
@Test
public void testFloorEntry() throws Exception {
for ( int i =0 ; i < 100; i ++) {
Long key = ThreadLocalRandom.current().nextLong();
assertEquals(csm.floorEntry(key), m.floorEntry(key));
}
}
代码示例来源:origin: addthis/hydra
try {
while (true) {
Map.Entry<K, Page<K, V>> cacheEntry = getCache().floorEntry(externalKey);
K cacheKey = cacheEntry.getKey();
Page<K, V> cachePage = cacheEntry.getValue();
代码示例来源:origin: org.kududb/kudu-client
Map.Entry<byte[], RemoteTablet> tabletPair = tablets.floorEntry(partitionKey);
代码示例来源:origin: indeedeng/lsmtree
@Override
protected Entry<K, V> computeNext() {
final Map.Entry<K, Object> entry;
if (!initialized) {
initialized = true;
if (start == null) {
entry = map.lastEntry();
} else if (startInclusive) {
entry = map.floorEntry(start);
} else {
entry = map.lowerEntry(start);
}
} else {
entry = map.lowerEntry(key);
}
if (entry == null) {
return endOfData();
}
key = entry.getKey();
final Object value = entry.getValue();
if (value == deleted) return Entry.createDeleted(key);
return Entry.create(key, (V)value);
}
};
代码示例来源:origin: the8472/mldht
Entry<Key, CacheBucket> targetEntry = cache.floorEntry(target);
代码示例来源:origin: org.hbase/asynchbase
Map.Entry<byte[], RegionInfo> entry = regions_cache.floorEntry(region_name);
if (entry == null) {
代码示例来源:origin: addthis/hydra
Map.Entry<K, Page<K, V>> cacheEntry = getCache().floorEntry(key);
内容来源于网络,如有侵权,请联系作者删除!