本文整理了Java中scala.collection.immutable.HashMap.<init>()
方法的一些代码示例,展示了HashMap.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HashMap.<init>()
方法的具体详情如下:
包路径:scala.collection.immutable.HashMap
类名称:HashMap
方法名:<init>
暂无
代码示例来源:origin: linkedin/kafka-monitor
private static void reassignPartitions(KafkaZkClient zkClient, Collection<Broker> brokers, String topic, int partitionCount, int replicationFactor) {
scala.collection.mutable.ArrayBuffer<BrokerMetadata> brokersMetadata = new scala.collection.mutable.ArrayBuffer<>(brokers.size());
for (Broker broker : brokers) {
brokersMetadata.$plus$eq(new BrokerMetadata(broker.id(), broker.rack()));
}
scala.collection.Map<Object, Seq<Object>> assignedReplicas =
AdminUtils.assignReplicasToBrokers(brokersMetadata, partitionCount, replicationFactor, 0, 0);
scala.collection.immutable.Map<TopicPartition, Seq<Object>> newAssignment = new scala.collection.immutable.HashMap<>();
scala.collection.Iterator<scala.Tuple2<Object, scala.collection.Seq<Object>>> it = assignedReplicas.iterator();
while (it.hasNext()) {
scala.Tuple2<Object, scala.collection.Seq<Object>> scalaTuple = it.next();
TopicPartition tp = new TopicPartition(topic, (Integer) scalaTuple._1);
newAssignment = newAssignment.$plus(new scala.Tuple2<>(tp, scalaTuple._2));
}
scala.collection.immutable.Set<String> topicList = new scala.collection.immutable.Set.Set1<>(topic);
scala.collection.Map<Object, scala.collection.Seq<Object>> currentAssignment = zkClient.getPartitionAssignmentForTopics(topicList).apply(topic);
String currentAssignmentJson = formatAsReassignmentJson(topic, currentAssignment);
String newAssignmentJson = formatAsReassignmentJson(topic, assignedReplicas);
LOG.info("Reassign partitions for topic " + topic);
LOG.info("Current partition replica assignment " + currentAssignmentJson);
LOG.info("New partition replica assignment " + newAssignmentJson);
zkClient.createPartitionReassignment(newAssignment);
}
代码示例来源:origin: com.typesafe.play/play_2.12
/**
* @return an empty Scala Map.
* @param <A> input parameter type
* @param <B> return type.
*/
public static <A, B> scala.collection.immutable.Map<A, B> emptyMap() {
return new scala.collection.immutable.HashMap<A, B>();
}
代码示例来源:origin: com.typesafe.play/play_2.10
/**
* Creates an empty Scala Map.
*/
public static <A,B> scala.collection.immutable.Map<A,B> emptyMap() {
return new scala.collection.immutable.HashMap<A,B>();
}
代码示例来源:origin: com.typesafe.play/play_2.11
/**
* @return an empty Scala Map.
* @param <A> input parameter type
* @param <B> return type.
*/
public static <A, B> scala.collection.immutable.Map<A, B> emptyMap() {
return new scala.collection.immutable.HashMap<A, B>();
}
代码示例来源:origin: com.typesafe.play/play
/**
* @return an empty Scala Map.
* @param <A> input parameter type
* @param <B> return type.
*/
public static <A, B> scala.collection.immutable.Map<A, B> emptyMap() {
return new scala.collection.immutable.HashMap<A, B>();
}
代码示例来源:origin: com.sandinh/play-alone
/**
* Creates an empty Scala Map.
*/
public static <A,B> scala.collection.immutable.Map<A,B> emptyMap() {
return new scala.collection.immutable.HashMap<A,B>();
}
代码示例来源:origin: FINRAOS/DataGenerator
@Override
public ConfigBundle configBundle() {
return new ConfigBundle(
ConfigBundleName.apply(getClass().getName()),
new scala.collection.immutable.HashMap<>()
);
}
}
代码示例来源:origin: com.mangofactory.swagger/swagger-models
@Override
public com.google.common.base.Optional<Model> modelFor(ModelContext modelContext) {
checkArgument(modelContext.getType() instanceof Class, "Only classes are supported by native swagger implmentation");
@SuppressWarnings({ "ConstantConditions", "unchecked" })
Option<Model> sModel = parser.read((Class) modelContext.getType(), new scala.collection.immutable.HashMap());
return Optional.fromNullable(fromOption(sModel));
}
代码示例来源:origin: com.softwaremill.reactivekafka/reactive-kafka-core
public Consumer withParams(Map<String, String> params) {
this.consumerParams = new HashMap<String, String>().$plus$plus(JavaConverters.mapAsScalaMapConverter(params).asScala());
return this;
}
代码示例来源:origin: com.softwaremill.reactivekafka/reactive-kafka-core
public Producer withParams(Map<String, String> params) {
this.producerParams = new HashMap<String, String>().$plus$plus(JavaConverters.mapAsScalaMapConverter(params).asScala());
return this;
}
代码示例来源:origin: eirslett/thrift-zookeeper
public static void reportServerUpAndRunning(Server server, String clusterName) {
getForService(clusterName).join(server.localAddress(), new scala.collection.immutable.HashMap());
}
内容来源于网络,如有侵权,请联系作者删除!