當前位置: 首頁>>代碼示例>>Java>>正文


Java ConcurrentNavigableMap.get方法代碼示例

本文整理匯總了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) {}
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:11,代碼來源:ConcurrentSkipListSubMapTest.java

示例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) {}
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:11,代碼來源:ConcurrentSkipListSubMapTest.java

示例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);
      }
    }
  }
}
 
開發者ID:fengchen8086,項目名稱:ditb,代碼行數:41,代碼來源:ServerManager.java


注:本文中的java.util.concurrent.ConcurrentNavigableMap.get方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。