Java Code Examples for java.util.concurrent.ConcurrentNavigableMap#get()

The following examples show how to use java.util.concurrent.ConcurrentNavigableMap#get() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ConcurrentSkipListSubMapTest.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * get(null) of nonempty map throws NPE
 */
public void testGet_NullPointerException() {
    try {
        ConcurrentNavigableMap c = map5();
        c.get(null);
        shouldThrow();
    } catch (NullPointerException success) {}
}
 
Example 2
Source File: ConcurrentSkipListSubMapTest.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * get(null) of empty map throws NPE
 */
public void testDescendingGet_NullPointerException() {
    try {
        ConcurrentNavigableMap c = dmap5();
        c.get(null);
        shouldThrow();
    } catch (NullPointerException success) {}
}
 
Example 3
Source File: BTreeMapTest5.java    From scava with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * get(null) of nonempty map throws NPE
 */
public void testGet_NullPointerException() {
    try {
        ConcurrentNavigableMap c = map5();
        c.get(null);
        shouldThrow();
    } catch (NullPointerException success) {}
}
 
Example 4
Source File: ConcurrentSkipListSubMapJUnitTest.java    From gemfirexd-oss with Apache License 2.0 5 votes vote down vote up
/**
 * get(null) of nonempty map throws NPE
 */
public void testGet_NullPointerException() {
    try {
        ConcurrentNavigableMap c = map5();
        c.get(null);
        shouldThrow();
    } catch (NullPointerException success) {}
}
 
Example 5
Source File: ConcurrentSkipListSubMapJUnitTest.java    From gemfirexd-oss with Apache License 2.0 5 votes vote down vote up
/**
 * get(null) of empty map throws NPE
 */
public void testDescendingGet_NullPointerException() {
    try {
        ConcurrentNavigableMap c = dmap5();
        c.get(null);
        shouldThrow();
    } catch (NullPointerException success) {}
}
 
Example 6
Source File: ConcurrentSkipListSubMapJUnitTest.java    From gemfirexd-oss with Apache License 2.0 5 votes vote down vote up
/**
 * get(null) of nonempty map throws NPE
 */
public void testGet_NullPointerException() {
    try {
        ConcurrentNavigableMap c = map5();
        c.get(null);
        shouldThrow();
    } catch (NullPointerException success) {}
}
 
Example 7
Source File: ConcurrentSkipListSubMapJUnitTest.java    From gemfirexd-oss with Apache License 2.0 5 votes vote down vote up
/**
 * get(null) of empty map throws NPE
 */
public void testDescendingGet_NullPointerException() {
    try {
        ConcurrentNavigableMap c = dmap5();
        c.get(null);
        shouldThrow();
    } catch (NullPointerException success) {}
}
 
Example 8
Source File: RoleMatcher.java    From anno4j with Apache License 2.0 5 votes vote down vote up
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);
}
 
Example 9
Source File: RoleMatcher.java    From anno4j with Apache License 2.0 5 votes vote down vote up
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);
}
 
Example 10
Source File: DeltaStoreBasedWaveletState.java    From swellrt with Apache License 2.0 5 votes vote down vote up
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;
}
 
Example 11
Source File: ConcurrentSkipListSubMapTest.java    From j2objc with Apache License 2.0 5 votes vote down vote up
/**
 * get(null) of nonempty map throws NPE
 */
public void testGet_NullPointerException() {
    try {
        ConcurrentNavigableMap c = map5();
        c.get(null);
        shouldThrow();
    } catch (NullPointerException success) {}
}
 
Example 12
Source File: ConcurrentSkipListSubMapTest.java    From j2objc with Apache License 2.0 5 votes vote down vote up
/**
 * get(null) of empty map throws NPE
 */
public void testDescendingGet_NullPointerException() {
    try {
        ConcurrentNavigableMap c = dmap5();
        c.get(null);
        shouldThrow();
    } catch (NullPointerException success) {}
}
 
Example 13
Source File: ServerManager.java    From hbase with Apache License 2.0 5 votes vote down vote up
/**
 * 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);
      }
    }
  }
}
 
Example 14
Source File: DeltaStoreBasedWaveletState.java    From incubator-retired-wave with Apache License 2.0 5 votes vote down vote up
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;
}
 
Example 15
Source File: SeaCloudsApplicationDataStorage.java    From SeaCloudsPlatform with Apache License 2.0 4 votes vote down vote up
public SeaCloudsApplicationData getSeaCloudsApplicationDataById(String id) {
    ConcurrentNavigableMap<String, SeaCloudsApplicationData> treeMap = dataStore.getTreeMap(SEACLOUDS_APPLICATION_DATA_COLLECTION_TAG);
    SeaCloudsApplicationData seaCloudsApplicationData = treeMap.get(id);
    return seaCloudsApplicationData;
}