当前位置: 首页>>代码示例>>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;未经允许,请勿转载。