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

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

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

ConcurrentSkipListMap.values介绍

[英]Lazily initialized values collection
[中]延迟初始化值集合

代码示例

代码示例来源:origin: apache/hbase

Collection<RegionStateNode> getRegionStateNodes() {
 return regionsMap.values();
}

代码示例来源:origin: apache/ignite

/**
 * @return Current nodes in topology.
 */
@SuppressWarnings("unchecked")
List<ClusterNode> topologySnapshot() {
  return new ArrayList<>((Collection)nodesByOrder.values());
}

代码示例来源:origin: apache/hbase

public List<RegionStateNode> getRegionsInTransition() {
 return new ArrayList<RegionStateNode>(regionInTransition.values());
}

代码示例来源:origin: Alluxio/alluxio

/**
 * Returns the children of the given inode, if the child list is cached. This method only
 * consults the cache, and never looks in the backing store.
 *
 * @param inodeId the directory to list
 * @return the children of the inode, or empty if the child list isn't cached
 */
public Optional<Collection<Long>> getCachedChildIds(Long inodeId) {
 ListingCacheEntry entry = mMap.get(inodeId);
 if (entry != null && entry.mChildren != null) {
  entry.mReferenced = true;
  return Optional.of(entry.mChildren.values());
 }
 return Optional.empty();
}

代码示例来源:origin: apache/hive

@Override
public void debugDumpShort(StringBuilder sb) {
 sb.append("\nCache state: ");
 for (TagState state : tagInfo.values()) {
  synchronized (state) {
   sb.append("\n").append(state.name).append(": ").append(state.bufferCount).append("/")
    .append(state.maxCount).append(", ").append(state.totalSize).append("/")
    .append(state.maxSize);
  }
 }
}

代码示例来源:origin: apache/hbase

public SortedSet<RegionState> getRegionsInTransitionOrderedByTimestamp() {
 final SortedSet<RegionState> rit = new TreeSet<RegionState>(REGION_STATE_STAMP_COMPARATOR);
 for (RegionStateNode node: regionInTransition.values()) {
  rit.add(node.toRegionState());
 }
 return rit;
}

代码示例来源:origin: qunarcorp/qmq

@Override
public void flush() {
  for (DelaySegment<T> segment : segments.values()) {
    segment.flush();
  }
}

代码示例来源:origin: qunarcorp/qmq

public void close() {
  for (final LogSegment segment : segments.values()) {
    segment.close();
  }
}

代码示例来源:origin: apache/hbase

public Map<RegionInfo, ServerName> getRegionAssignments() {
 final HashMap<RegionInfo, ServerName> assignments = new HashMap<RegionInfo, ServerName>();
 for (RegionStateNode node: regionsMap.values()) {
  assignments.put(node.getRegionInfo(), node.getRegionLocation());
 }
 return assignments;
}

代码示例来源:origin: twitter/distributedlog

private Future<List<Set<String>>> retrieveLogs() {
  Collection<SubNamespace> subNss = subNamespaces.values();
  List<Future<Set<String>>> logsList = Lists.newArrayListWithExpectedSize(subNss.size());
  for (SubNamespace subNs : subNss) {
    logsList.add(subNs.getLogs());
  }
  return Future.collect(logsList);
}

代码示例来源:origin: apache/hbase

public List<RegionInfo> getAssignedRegions() {
 final List<RegionInfo> result = new ArrayList<RegionInfo>();
 for (RegionStateNode node: regionsMap.values()) {
  if (!node.isInTransition()) {
   result.add(node.getRegionInfo());
  }
 }
 return result;
}

代码示例来源:origin: apache/hbase

public ArrayList<RegionState> getRegionStates() {
 final ArrayList<RegionState> regions = new ArrayList<RegionState>(regionsMap.size());
 for (RegionStateNode node: regionsMap.values()) {
  regions.add(node.toRegionState());
 }
 return regions;
}

代码示例来源:origin: apache/hbase

public List<RegionState> getRegionsStateInTransition() {
 final List<RegionState> rit = new ArrayList<RegionState>(regionInTransition.size());
 for (RegionStateNode node: regionInTransition.values()) {
  rit.add(node.toRegionState());
 }
 return rit;
}

代码示例来源:origin: apache/incubator-druid

@Override
public void stop()
{
 synchronized (lock) {
  if (stopped) {
   return;
  }
  stopped = true;
  for (SegmentHolder holder : segmentsToDrop.values()) {
   holder.requestFailed("Stopping load queue peon.");
  }
  for (SegmentHolder holder : segmentsToLoad.values()) {
   holder.requestFailed("Stopping load queue peon.");
  }
  segmentsToDrop.clear();
  segmentsToLoad.clear();
  queuedSize.set(0L);
  failedAssignCount.set(0);
 }
}

代码示例来源:origin: apache/hbase

public List<RegionState> getRegionFailedOpen() {
 if (regionFailedOpen.isEmpty()) return Collections.emptyList();
 ArrayList<RegionState> regions = new ArrayList<RegionState>(regionFailedOpen.size());
 for (RegionFailedOpen r: regionFailedOpen.values()) {
  regions.add(r.getRegionStateNode().toRegionState());
 }
 return regions;
}

代码示例来源:origin: apache/hbase

public RegionState getRegionState(final String encodedRegionName) {
 // TODO: Need a map <encodedName, ...> but it is just dispatch merge...
 for (RegionStateNode node: regionsMap.values()) {
  if (node.getRegionInfo().getEncodedName().equals(encodedRegionName)) {
   return node.toRegionState();
  }
 }
 return null;
}

代码示例来源:origin: apache/hbase

public Map<RegionState.State, List<RegionInfo>> getRegionByStateOfTable(TableName tableName) {
 final State[] states = State.values();
 final Map<RegionState.State, List<RegionInfo>> tableRegions =
   new HashMap<State, List<RegionInfo>>(states.length);
 for (int i = 0; i < states.length; ++i) {
  tableRegions.put(states[i], new ArrayList<RegionInfo>());
 }
 for (RegionStateNode node: regionsMap.values()) {
  if (node.getTable().equals(tableName)) {
   tableRegions.get(node.getState()).add(node.getRegionInfo());
  }
 }
 return tableRegions;
}

代码示例来源:origin: alibaba/jstorm

@Override
public Snapshot getSnapshot() {
  lockForRegularUsage();
  try {
    return new WeightedSnapshot(values.values());
  } finally {
    unlockForRegularUsage();
  }
}

代码示例来源:origin: qunarcorp/qmq

public void clean(LogCleaner.CleanHook hook) {
  long deleteUntil = resolveSegment(System.currentTimeMillis() - config.getDispatchLogKeepTime(), segmentScale);
  for (DelaySegment<Boolean> segment : segments.values()) {
    if (segment.getSegmentBaseOffset() < deleteUntil) {
      doClean(segment, hook);
    }
  }
}

代码示例来源:origin: apache/hbase

@Test
public void testValues() throws Exception {
 for (Long value:m.values()) {
  assertTrue(csm.values().contains(value));
  assertTrue(m.containsValue(value));
 }
}

相关文章

ConcurrentSkipListMap类方法