java.util.concurrent.ConcurrentNavigableMap#get ( )源码实例Demo

下面列出了java.util.concurrent.ConcurrentNavigableMap#get ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

/**
 * get(null) of nonempty map throws NPE
 */
public void testGet_NullPointerException() {
    try {
        ConcurrentNavigableMap c = map5();
        c.get(null);
        shouldThrow();
    } catch (NullPointerException success) {}
}
 
/**
 * get(null) of empty map throws NPE
 */
public void testDescendingGet_NullPointerException() {
    try {
        ConcurrentNavigableMap c = dmap5();
        c.get(null);
        shouldThrow();
    } catch (NullPointerException success) {}
}
 
源代码3 项目: scava   文件: BTreeMapTest5.java
/**
 * get(null) of nonempty map throws NPE
 */
public void testGet_NullPointerException() {
    try {
        ConcurrentNavigableMap c = map5();
        c.get(null);
        shouldThrow();
    } catch (NullPointerException success) {}
}
 
/**
 * get(null) of nonempty map throws NPE
 */
public void testGet_NullPointerException() {
    try {
        ConcurrentNavigableMap c = map5();
        c.get(null);
        shouldThrow();
    } catch (NullPointerException success) {}
}
 
/**
 * get(null) of empty map throws NPE
 */
public void testDescendingGet_NullPointerException() {
    try {
        ConcurrentNavigableMap c = dmap5();
        c.get(null);
        shouldThrow();
    } catch (NullPointerException success) {}
}
 
/**
 * get(null) of nonempty map throws NPE
 */
public void testGet_NullPointerException() {
    try {
        ConcurrentNavigableMap c = map5();
        c.get(null);
        shouldThrow();
    } catch (NullPointerException success) {}
}
 
/**
 * get(null) of empty map throws NPE
 */
public void testDescendingGet_NullPointerException() {
    try {
        ConcurrentNavigableMap c = dmap5();
        c.get(null);
        shouldThrow();
    } catch (NullPointerException success) {}
}
 
源代码8 项目: anno4j   文件: RoleMatcher.java
private void addPathPrefix(
		ConcurrentNavigableMap<String, ConcurrentNavigableMap<String, Collection<Class<?>>>> map,
		String suffix, String prefix, Class<?> role) {
	ConcurrentNavigableMap<String, Collection<Class<?>>> m, o;
	m = map.get(suffix);
	if (m == null) {
		m = new ConcurrentSkipListMap<String, Collection<Class<?>>>();
		o = map.putIfAbsent(suffix, m);
		if (o != null) {
			m = o;
		}
	}
	add(m, prefix, role);
}
 
源代码9 项目: anno4j   文件: RoleMatcher.java
private void addPath(
		ConcurrentNavigableMap<String, ConcurrentMap<String, Collection<Class<?>>>> map,
		String suffix, String prefix, Class<?> role) {
	ConcurrentMap<String, Collection<Class<?>>> m, o;
	m = map.get(suffix);
	if (m == null) {
		m = new ConcurrentHashMap<String, Collection<Class<?>>>();
		o = map.putIfAbsent(suffix, m);
		if (o != null) {
			m = o;
		}
	}
	add(m, prefix, role);
}
 
源代码10 项目: swellrt   文件: DeltaStoreBasedWaveletState.java
private static WaveletDeltaRecord getDelta(WaveletDeltaRecordReader reader,
    ConcurrentNavigableMap<HashedVersion, WaveletDeltaRecord> cachedDeltas,
    HashedVersion version) throws IOException {

  WaveletDeltaRecord delta = null;

  // try cache first!
  if (cachedDeltas != null)
    delta = cachedDeltas.get(version);

  if (delta == null) delta = reader.getDelta(version.getVersion());

  return delta;
}
 
源代码11 项目: j2objc   文件: ConcurrentSkipListSubMapTest.java
/**
 * get(null) of nonempty map throws NPE
 */
public void testGet_NullPointerException() {
    try {
        ConcurrentNavigableMap c = map5();
        c.get(null);
        shouldThrow();
    } catch (NullPointerException success) {}
}
 
源代码12 项目: j2objc   文件: ConcurrentSkipListSubMapTest.java
/**
 * get(null) of empty map throws NPE
 */
public void testDescendingGet_NullPointerException() {
    try {
        ConcurrentNavigableMap c = dmap5();
        c.get(null);
        shouldThrow();
    } catch (NullPointerException success) {}
}
 
源代码13 项目: hbase   文件: ServerManager.java
/**
 * Updates last flushed sequence Ids for the regions on server sn
 * @param sn
 * @param hsl
 */
private void updateLastFlushedSequenceIds(ServerName sn, ServerMetrics hsl) {
  for (Entry<byte[], RegionMetrics> entry : hsl.getRegionMetrics().entrySet()) {
    byte[] encodedRegionName = Bytes.toBytes(RegionInfo.encodeRegionName(entry.getKey()));
    Long existingValue = flushedSequenceIdByRegion.get(encodedRegionName);
    long l = entry.getValue().getCompletedSequenceId();
    // 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 =
        computeIfAbsent(storeFlushedSequenceIdsByRegion, encodedRegionName,
          () -> new ConcurrentSkipListMap<>(Bytes.BYTES_COMPARATOR));
    for (Entry<byte[], Long> storeSeqId : entry.getValue().getStoreSequenceId().entrySet()) {
      byte[] family = storeSeqId.getKey();
      existingValue = storeFlushedSequenceId.get(family);
      l = storeSeqId.getValue();
      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);
      }
    }
  }
}
 
private static WaveletDeltaRecord getDelta(WaveletDeltaRecordReader reader,
    ConcurrentNavigableMap<HashedVersion, WaveletDeltaRecord> cachedDeltas,
    HashedVersion version) throws IOException {
  WaveletDeltaRecord delta = reader.getDelta(version.getVersion());
  if (delta == null && cachedDeltas != null) {
    delta = cachedDeltas.get(version);
  }
  return delta;
}
 
public SeaCloudsApplicationData getSeaCloudsApplicationDataById(String id) {
    ConcurrentNavigableMap<String, SeaCloudsApplicationData> treeMap = dataStore.getTreeMap(SEACLOUDS_APPLICATION_DATA_COLLECTION_TAG);
    SeaCloudsApplicationData seaCloudsApplicationData = treeMap.get(id);
    return seaCloudsApplicationData;
}