本文整理汇总了Java中java.util.concurrent.ConcurrentNavigableMap.get方法的典型用法代码示例。如果您正苦于以下问题:Java ConcurrentNavigableMap.get方法的具体用法?Java ConcurrentNavigableMap.get怎么用?Java ConcurrentNavigableMap.get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.util.concurrent.ConcurrentNavigableMap
的用法示例。
在下文中一共展示了ConcurrentNavigableMap.get方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testGet_NullPointerException
import java.util.concurrent.ConcurrentNavigableMap; //导入方法依赖的package包/类
/**
* get(null) of nonempty map throws NPE
*/
public void testGet_NullPointerException() {
try {
ConcurrentNavigableMap c = map5();
c.get(null);
shouldThrow();
} catch (NullPointerException success) {}
}
示例2: testDescendingGet_NullPointerException
import java.util.concurrent.ConcurrentNavigableMap; //导入方法依赖的package包/类
/**
* get(null) of empty map throws NPE
*/
public void testDescendingGet_NullPointerException() {
try {
ConcurrentNavigableMap c = dmap5();
c.get(null);
shouldThrow();
} catch (NullPointerException success) {}
}
示例3: updateLastFlushedSequenceIds
import java.util.concurrent.ConcurrentNavigableMap; //导入方法依赖的package包/类
/**
* Updates last flushed sequence Ids for the regions on server sn
* @param sn
* @param hsl
*/
private void updateLastFlushedSequenceIds(ServerName sn, ServerLoad hsl) {
Map<byte[], RegionLoad> regionsLoad = hsl.getRegionsLoad();
for (Entry<byte[], RegionLoad> entry : regionsLoad.entrySet()) {
byte[] encodedRegionName = Bytes.toBytes(HRegionInfo.encodeRegionName(entry.getKey()));
Long existingValue = flushedSequenceIdByRegion.get(encodedRegionName);
long l = entry.getValue().getCompleteSequenceId();
// Don't let smaller sequence ids override greater sequence ids.
if (LOG.isTraceEnabled()) {
LOG.trace(Bytes.toString(encodedRegionName) + ", existingValue=" + existingValue +
", completeSequenceId=" + l);
}
if (existingValue == null || (l != HConstants.NO_SEQNUM && l > existingValue)) {
flushedSequenceIdByRegion.put(encodedRegionName, l);
} else if (l != HConstants.NO_SEQNUM && l < existingValue) {
LOG.warn("RegionServer " + sn + " indicates a last flushed sequence id ("
+ l + ") that is less than the previous last flushed sequence id ("
+ existingValue + ") for region " + Bytes.toString(entry.getKey()) + " Ignoring.");
}
ConcurrentNavigableMap<byte[], Long> storeFlushedSequenceId =
getOrCreateStoreFlushedSequenceId(encodedRegionName);
for (StoreSequenceId storeSeqId : entry.getValue().getStoreCompleteSequenceId()) {
byte[] family = storeSeqId.getFamilyName().toByteArray();
existingValue = storeFlushedSequenceId.get(family);
l = storeSeqId.getSequenceId();
if (LOG.isTraceEnabled()) {
LOG.trace(Bytes.toString(encodedRegionName) + ", family=" + Bytes.toString(family) +
", existingValue=" + existingValue + ", completeSequenceId=" + l);
}
// Don't let smaller sequence ids override greater sequence ids.
if (existingValue == null || (l != HConstants.NO_SEQNUM && l > existingValue.longValue())) {
storeFlushedSequenceId.put(family, l);
}
}
}
}