本文整理匯總了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);
}
}
}
}