本文整理了Java中java.util.concurrent.ConcurrentSkipListMap.<init>()
方法的一些代码示例,展示了ConcurrentSkipListMap.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ConcurrentSkipListMap.<init>()
方法的具体详情如下:
包路径:java.util.concurrent.ConcurrentSkipListMap
类名称:ConcurrentSkipListMap
方法名:<init>
[英]Constructs a new, empty map, sorted according to the Comparable of the keys.
[中]构建一个新的空映射,根据关键点的可比性进行排序。
代码示例来源:origin: google/guava
@Override
protected SortedMap<String, String> create(Entry<String, String>[] entries) {
return populate(new ConcurrentSkipListMap<String, String>(), entries);
}
})
代码示例来源:origin: springside/springside4
/**
* 根据等号左边的类型,构造类型正确的ConcurrentSkipListMap.
*/
public static <K, V> ConcurrentSkipListMap<K, V> newConcurrentSortedMap() {
return new ConcurrentSkipListMap<K, V>();
}
代码示例来源:origin: vipshop/vjtools
/**
* 根据等号左边的类型,构造类型正确的ConcurrentSkipListMap.
*/
public static <K, V> ConcurrentSkipListMap<K, V> newConcurrentSortedMap() {
return new ConcurrentSkipListMap<K, V>();
}
代码示例来源:origin: apache/ignite
/**
* Constructs a new, empty set that orders its elements according to
* their {@linkplain Comparable natural ordering}.
*/
public GridConcurrentSkipListSet() {
m = new ConcurrentSkipListMap<>();
}
代码示例来源:origin: apache/incubator-druid
public PlainFactsHolder(boolean sortFacts, Comparator<IncrementalIndexRow> incrementalIndexRowComparator)
{
this.sortFacts = sortFacts;
if (sortFacts) {
this.facts = new ConcurrentSkipListMap<>();
} else {
this.facts = new ConcurrentHashMap<>();
}
this.incrementalIndexRowComparator = incrementalIndexRowComparator;
}
代码示例来源:origin: apache/incubator-druid
RollupFactsHolder(
boolean sortFacts,
Comparator<IncrementalIndexRow> incrementalIndexRowComparator,
List<DimensionDesc> dimensionDescsList
)
{
this.sortFacts = sortFacts;
if (sortFacts) {
this.facts = new ConcurrentSkipListMap<>(incrementalIndexRowComparator);
} else {
this.facts = new ConcurrentHashMap<>();
}
this.dimensionDescsList = dimensionDescsList;
}
代码示例来源:origin: google/guava
@Override
protected SortedMap<String, String> create(Entry<String, String>[] entries) {
return populate(
new ConcurrentSkipListMap<String, String>(arbitraryNullFriendlyComparator()),
entries);
}
})
代码示例来源:origin: google/guava
@Override
public <K extends Comparable<K>, V> SortedMap<K, V> create(Map<K, V> map) {
return new ConcurrentSkipListMap<>(map);
}
},
代码示例来源:origin: apache/pulsar
/**
* Construct a new RangeLruCache.
*
* @param weighter
* a custom weighter to compute the size of each stored value
*/
public RangeCache(Weighter<Value> weighter) {
this.size = new AtomicLong(0);
this.entries = new ConcurrentSkipListMap<>();
this.weighter = weighter;
}
代码示例来源:origin: thinkaurelius/titan
public InMemoryKeyColumnValueStore(final String name) {
Preconditions.checkArgument(StringUtils.isNotBlank(name));
this.name = name;
this.kcv = new ConcurrentSkipListMap<StaticBuffer, ColumnValueStore>();
}
代码示例来源:origin: apache/ignite
/** {@inheritDoc} */
@SuppressWarnings({"CloneCallsConstructors"})
@Override public GridConcurrentSkipListSet<E> clone() {
try {
GridConcurrentSkipListSet<E> clone = (GridConcurrentSkipListSet<E>)super.clone();
clone.m = new ConcurrentSkipListMap<>(m);
return clone;
}
catch (CloneNotSupportedException ignored) {
throw new Error("Clone should be supported on GridConcurrentSkipListSet class: " + this);
}
}
代码示例来源:origin: apache/storm
/**
* Intended to extract this to separate method since only pendingPrepare uses ConcurrentNavigableMap.
*/
private ConcurrentNavigableMap<byte[], byte[]> createPendingPrepareMap() {
return new ConcurrentSkipListMap<>(UnsignedBytes.lexicographicalComparator());
}
}
代码示例来源:origin: apache/storm
private ConcurrentNavigableMap<byte[], byte[]> createPendingPrepareMap() {
return new ConcurrentSkipListMap<>(UnsignedBytes.lexicographicalComparator());
}
}
代码示例来源:origin: apache/incubator-dubbo
result = new ConcurrentHashMap();
} else if (ConcurrentSkipListMap.class == cl) {
result = new ConcurrentSkipListMap();
} else {
try {
代码示例来源:origin: apache/incubator-dubbo
result = new ConcurrentHashMap();
} else if (ConcurrentSkipListMap.class == cl) {
result = new ConcurrentSkipListMap();
} else {
try {
代码示例来源:origin: google/guava
@Override
protected Multiset<String> create(String[] elements) {
Multiset<String> multiset =
new ConcurrentHashMultiset<>(new ConcurrentSkipListMap<String, AtomicInteger>());
Collections.addAll(multiset, elements);
return multiset;
}
代码示例来源:origin: apache/ignite
/**
* Constructs a new set containing the same elements and using the
* same ordering as the specified sorted set.
*
* @param s sorted set whose elements will comprise the new set
* @throws NullPointerException if the specified sorted set or any
* of its elements are null
*/
public GridConcurrentSkipListSet(SortedSet<E> s) {
m = new ConcurrentSkipListMap<>(s.comparator());
addAll(s);
}
代码示例来源:origin: google/guava
public void testAddAndRemove_ConcurrentSkipListMap() throws Exception {
testAddAndRemove(new ConcurrentSkipListMap<String, AtomicInteger>());
}
代码示例来源:origin: apache/hbase
@Override
public void updateRegionStats(ServerName serverName, byte[] regionName, RegionLoadStats stats) {
String name = serverName.getServerName() + "," + Bytes.toStringBinary(regionName);
ConcurrentMap<byte[], RegionStats> rsStats = computeIfAbsent(serverStats, serverName,
() -> new ConcurrentSkipListMap<>(Bytes.BYTES_COMPARATOR));
RegionStats regionStats =
computeIfAbsent(rsStats, regionName, () -> new RegionStats(this.registry, name));
regionStats.update(stats);
}
代码示例来源:origin: apache/hbase
@Before
public void setup() throws IOException, KeeperException {
setRootDirAndCleanIt(HTU, this.name.getMethodName());
NavigableMap<ServerName, SortedSet<byte []>> regionsToRegionServers =
new ConcurrentSkipListMap<ServerName, SortedSet<byte []>>();
this.masterServices =
new MockMasterServices(HTU.getConfiguration(), regionsToRegionServers);
this.masterServices.start(10, null);
this.janitor = new CatalogJanitor(masterServices);
}
内容来源于网络,如有侵权,请联系作者删除!