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

x33g5p2x  于2022-01-17 转载在 其他  
字(4.1k)|赞(0)|评价(0)|浏览(184)

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

ConcurrentHashMap.replaceAll介绍

暂无

代码示例

代码示例来源:origin: wildfly/wildfly

public void replaceAll(final BiFunction<? super K, ? super V, ? extends V> function) {
  backingMap.replaceAll(function);
}

代码示例来源:origin: ben-manes/caffeine

@Override
public void replaceAll(BiFunction<? super K, ? super V, ? extends V> function) {
 requireNonNull(function);
 // ensures that the removal notification is processed after the removal has completed
 @SuppressWarnings({"unchecked", "rawtypes"})
 K[] notificationKey = (K[]) new Object[1];
 @SuppressWarnings({"unchecked", "rawtypes"})
 V[] notificationValue = (V[]) new Object[1];
 data.replaceAll((key, value) -> {
  if (notificationKey[0] != null) {
   notifyRemoval(notificationKey[0], notificationValue[0], RemovalCause.REPLACED);
   notificationValue[0] = null;
   notificationKey[0] = null;
  }
  V newValue = requireNonNull(function.apply(key, value));
  if (newValue != value) {
   writer.write(key, newValue);
  }
  if (hasRemovalListener() && (newValue != value)) {
   notificationKey[0] = key;
   notificationValue[0] = value;
  }
  return newValue;
 });
 if (notificationKey[0] != null) {
  notifyRemoval(notificationKey[0], notificationValue[0], RemovalCause.REPLACED);
 }
}

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

partitionGroups.get(groupId).replaceAll((partition, sequence) -> getNotSetMarker());

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

partitionGroups.get(groupId).replaceAll((partition, sequence) -> getNotSetMarker());

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

partitionGroups.get(groupId).replaceAll((partition, sequence) -> getNotSetMarker());

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

killTaskGroupForPartitions(ImmutableSet.of(partition), "DataSourceMetadata is updated while reset");
  activelyReadingTaskGroups.remove(groupId);
  partitionGroups.get(groupId).replaceAll((partitionId, sequence) -> getNotSetMarker());
 });
} else {

代码示例来源:origin: com.github.ben-manes.caffeine/caffeine

@Override
public void replaceAll(BiFunction<? super K, ? super V, ? extends V> function) {
 requireNonNull(function);
 // ensures that the removal notification is processed after the removal has completed
 @SuppressWarnings({"unchecked", "rawtypes"})
 K[] notificationKey = (K[]) new Object[1];
 @SuppressWarnings({"unchecked", "rawtypes"})
 V[] notificationValue = (V[]) new Object[1];
 data.replaceAll((key, value) -> {
  if (notificationKey[0] != null) {
   notifyRemoval(notificationKey[0], notificationValue[0], RemovalCause.REPLACED);
   notificationValue[0] = null;
   notificationKey[0] = null;
  }
  V newValue = requireNonNull(function.apply(key, value));
  if (newValue != value) {
   writer.write(key, newValue);
  }
  if (hasRemovalListener() && (newValue != value)) {
   notificationKey[0] = key;
   notificationValue[0] = value;
  }
  return newValue;
 });
 if (notificationKey[0] != null) {
  notifyRemoval(notificationKey[0], notificationValue[0], RemovalCause.REPLACED);
 }
}

代码示例来源:origin: org.jboss.eap/wildfly-client-all

public void replaceAll(final BiFunction<? super K, ? super V, ? extends V> function) {
  backingMap.replaceAll(function);
}

代码示例来源:origin: org.wildfly/wildfly-naming-client

public void replaceAll(final BiFunction<? super K, ? super V, ? extends V> function) {
  backingMap.replaceAll(function);
}

代码示例来源:origin: the8472/mldht

void decayThrottle() {
  unsolicitedThrottle.replaceAll((addr, i) -> {
    return i - 1;
  });
  unsolicitedThrottle.values().removeIf(e -> e <= 0);
  
}

代码示例来源:origin: io.druid.extensions/druid-kafka-indexing-service

partitionGroups.get(groupId).replaceAll((partition, offset) -> NOT_SET);

代码示例来源:origin: io.druid.extensions/druid-kafka-indexing-service

partitionGroups.get(groupId).replaceAll((partition, offset) -> NOT_SET);

代码示例来源:origin: io.druid.extensions/druid-kafka-indexing-service

partitionGroups.get(groupId).replaceAll((partition, offset) -> NOT_SET);

代码示例来源:origin: io.druid.extensions/druid-kafka-indexing-service

killTaskGroupForPartitions(ImmutableSet.of(partition));
  taskGroups.remove(groupId);
  partitionGroups.get(groupId).replaceAll((partitionId, offset) -> NOT_SET);
 });
} else {

相关文章

微信公众号

最新文章

更多