java.util.concurrent.ConcurrentSkipListMap.descendingKeySet()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(3.8k)|赞(0)|评价(0)|浏览(99)

本文整理了Java中java.util.concurrent.ConcurrentSkipListMap.descendingKeySet()方法的一些代码示例,展示了ConcurrentSkipListMap.descendingKeySet()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ConcurrentSkipListMap.descendingKeySet()方法的具体详情如下:
包路径:java.util.concurrent.ConcurrentSkipListMap
类名称:ConcurrentSkipListMap
方法名:descendingKeySet

ConcurrentSkipListMap.descendingKeySet介绍

暂无

代码示例

代码示例来源:origin: org.apache.jackrabbit/oak-store-document

@Override
public boolean containsKey(Object key) {
  for (int generation : read.descendingKeySet()) {
    CacheMap<K, V> m = read.get(generation);
    if (m != null) {
      if (m.containsKey(key)) {
        return true;
      }
    }
  }
  return false;
}

代码示例来源:origin: apache/jackrabbit-oak

@Override
public boolean containsKey(Object key) {
  for (int generation : read.descendingKeySet()) {
    CacheMap<K, V> m = read.get(generation);
    if (m != null) {
      if (m.containsKey(key)) {
        return true;
      }
    }
  }
  return false;
}

代码示例来源:origin: cinchapi/concourse

@Override
public NavigableSet<K> descendingKeySet() {
  long[] stamps = grabAllSegmentWriteLocks();
  try {
    sort();
    return sorted.descendingKeySet();
  }
  finally {
    releaseSegmentLocks(stamps);
  }
}

代码示例来源:origin: apache/jackrabbit-oak

ValueWithGenerationInfo<V> readValue(Object key) {
  for (int generation : read.descendingKeySet()) {
    CacheMap<K, V> m = read.get(generation);
    if (m != null) {
      V value = m.get(key);
      if (value != null) {
        return new ValueWithGenerationInfo<V>(value, m == write);
      }
    }
  }
  return null;
}

代码示例来源:origin: org.apache.jackrabbit/oak-store-document

ValueWithGenerationInfo<V> readValue(Object key) {
  for (int generation : read.descendingKeySet()) {
    CacheMap<K, V> m = read.get(generation);
    if (m != null) {
      V value = m.get(key);
      if (value != null) {
        return new ValueWithGenerationInfo<V>(value, m == write);
      }
    }
  }
  return null;
}

代码示例来源:origin: org.apache.apex/malhar-library

private Slice getFromMemory(Slice key)
{
 //search the cache for key
 BucketedValue bucketedValue = flash.get(key);
 if (bucketedValue != null) {
  return bucketedValue.getValue();
 }
 for (Long window : checkpointedData.descendingKeySet()) {
  //traverse the checkpointed data in reverse order
  bucketedValue = checkpointedData.get(window).get(key);
  if (bucketedValue != null) {
   return bucketedValue.getValue();
  }
 }
 for (Long window : committedData.descendingKeySet()) {
  //traverse the committed data in reverse order
  bucketedValue = committedData.get(window).get(key);
  if (bucketedValue != null) {
   return bucketedValue.getValue();
  }
 }
 bucketedValue = fileCache.get(key);
 if (bucketedValue != null) {
  return bucketedValue.getValue();
 }
 return null;
}

代码示例来源:origin: apache/jackrabbit-oak

/**
 * Gets the most recent unsaved last revision at <code>readRevision</code>
 * or earlier in this branch for the given <code>path</code>. Documents with
 * explicit updates are not tracked and this method may return {@code null}.
 *
 * @param path         the path of a node.
 * @param readRevision the read revision.
 * @return the most recent unsaved last revision or <code>null</code> if
 *         there is none in this branch.
 */
@Nullable
public Revision getUnsavedLastRevision(String path,
                    Revision readRevision) {
  readRevision = readRevision.asBranchRevision();
  for (Revision r : commits.descendingKeySet()) {
    if (readRevision.compareRevisionTime(r) < 0) {
      continue;
    }
    BranchCommit c = commits.get(r);
    if (c.isModified(path)) {
      return r;
    }
  }
  return null;
}

代码示例来源:origin: org.apache.jackrabbit/oak-store-document

/**
 * Gets the most recent unsaved last revision at <code>readRevision</code>
 * or earlier in this branch for the given <code>path</code>. Documents with
 * explicit updates are not tracked and this method may return {@code null}.
 *
 * @param path         the path of a node.
 * @param readRevision the read revision.
 * @return the most recent unsaved last revision or <code>null</code> if
 *         there is none in this branch.
 */
@Nullable
public Revision getUnsavedLastRevision(String path,
                    Revision readRevision) {
  readRevision = readRevision.asBranchRevision();
  for (Revision r : commits.descendingKeySet()) {
    if (readRevision.compareRevisionTime(r) < 0) {
      continue;
    }
    BranchCommit c = commits.get(r);
    if (c.isModified(path)) {
      return r;
    }
  }
  return null;
}

相关文章

微信公众号

最新文章

更多

ConcurrentSkipListMap类方法