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); }
/** * Generates a Stream that traverses the keys of a scala.collection.immutable.HashMap. * <p> * Both sequential and parallel operations will be efficient. * * @param coll The immutable.HashMap to traverse * @return A Stream view of the collection which, by default, executes sequentially. */ public static <K> Stream<K> streamKeys(scala.collection.immutable.HashMap<K, ? super Object> coll) { return StreamSupport.stream(new StepsAnyImmHashMapKey<K, Object>(coll, 0, coll.size()), false); }
public Producer withParams(Map<String, String> params) { this.producerParams = new HashMap<String, String>().$plus$plus(JavaConverters.mapAsScalaMapConverter(params).asScala()); return this; }
scala.collection.immutable.HashMap<String, WrappedArray<Integer>> td = (scala.collection.immutable.HashMap<String, WrappedArray<Integer>>)row.get(2); Map<String, Set<Integer>> tagDict = new HashMap<String, Set<Integer>>(); Iterator<Tuple2<String, WrappedArray<Integer>>> iterator = td.iterator(); while (iterator.hasNext()) { Tuple2<String, WrappedArray<Integer>> tuple = iterator.next();
/** * Generates a Stream that traverses the values of a scala.collection.immutable.HashMap. * <p> * Both sequential and parallel operations will be efficient. * * @param coll The immutable.HashMap to traverse * @return A Stream view of the collection which, by default, executes sequentially. */ public static <V> Stream<V> streamValues(scala.collection.immutable.HashMap<? super Object, V> coll) { return StreamSupport.stream(new StepsAnyImmHashMapValue<Object, V>(coll, 0, coll.size()), false); }
public Consumer withParams(Map<String, String> params) { this.consumerParams = new HashMap<String, String>().$plus$plus(JavaConverters.mapAsScalaMapConverter(params).asScala()); return this; }
/** * @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>(); }
/** * Generates a Stream that traverses the values of a scala.collection.immutable.HashMap. * <p> * Both sequential and parallel operations will be efficient. * * @param coll The immutable.HashMap to traverse * @return A Stream view of the collection which, by default, executes sequentially. */ public static <V> Stream<V> streamValues(scala.collection.immutable.HashMap<? super Object, V> coll) { return StreamSupport.stream(new StepsAnyImmHashMapValue<Object, V>(coll, 0, coll.size()), false); }
/** * Creates an empty Scala Map. */ public static <A,B> scala.collection.immutable.Map<A,B> emptyMap() { return new scala.collection.immutable.HashMap<A,B>(); }
/** * Generates a Stream that traverses the values of a scala.collection.immutable.HashMap. * <p> * Both sequential and parallel operations will be efficient. * * @param coll The immutable.HashMap to traverse * @return A Stream view of the collection which, by default, executes sequentially. */ public static <V> Stream<V> streamValues(scala.collection.immutable.HashMap<? super Object, V> coll) { return StreamSupport.stream(new StepsAnyImmHashMapValue<Object, V>(coll, 0, coll.size()), false); }
/** * @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>(); }
/** * Generates a Stream that traverses the key-value pairs of a scala.collection.immutable.HashMap. * The key-value pairs are presented as instances of scala.Tuple2. * <p> * Both sequential and parallel operations will be efficient. * * @param coll The immutable.HashMap to traverse * @return A Stream view of the collection which, by default, executes sequentially. */ public static <K, V> Stream< scala.Tuple2<K, V> > stream(scala.collection.immutable.HashMap<K, V> coll) { return StreamSupport.stream(new StepsAnyImmHashMap<K, V>(coll, 0, coll.size()), false); }
/** * @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>(); }
/** * Generates a Stream that traverses the key-value pairs of a scala.collection.immutable.HashMap. * The key-value pairs are presented as instances of scala.Tuple2. * <p> * Both sequential and parallel operations will be efficient. * * @param coll The immutable.HashMap to traverse * @return A Stream view of the collection which, by default, executes sequentially. */ public static <K, V> Stream< scala.Tuple2<K, V> > stream(scala.collection.immutable.HashMap<K, V> coll) { return StreamSupport.stream(new StepsAnyImmHashMap<K, V>(coll, 0, coll.size()), false); }
/** * Creates an empty Scala Map. */ public static <A,B> scala.collection.immutable.Map<A,B> emptyMap() { return new scala.collection.immutable.HashMap<A,B>(); }
/** * Generates a Stream that traverses the keys of a scala.collection.immutable.HashMap. * <p> * Both sequential and parallel operations will be efficient. * * @param coll The immutable.HashMap to traverse * @return A Stream view of the collection which, by default, executes sequentially. */ public static <K> Stream<K> streamKeys(scala.collection.immutable.HashMap<K, ? super Object> coll) { return StreamSupport.stream(new StepsAnyImmHashMapKey<K, Object>(coll, 0, coll.size()), false); }
@Override public ConfigBundle configBundle() { return new ConfigBundle( ConfigBundleName.apply(getClass().getName()), new scala.collection.immutable.HashMap<>() ); } }
/** * Generates a Stream that traverses the keys of a scala.collection.immutable.HashMap. * <p> * Both sequential and parallel operations will be efficient. * * @param coll The immutable.HashMap to traverse * @return A Stream view of the collection which, by default, executes sequentially. */ public static <K> Stream<K> streamKeys(scala.collection.immutable.HashMap<K, ? super Object> coll) { return StreamSupport.stream(new StepsAnyImmHashMapKey<K, Object>(coll, 0, coll.size()), false); }
@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)); }
/** * Generates a Stream that traverses the key-value pairs of a scala.collection.immutable.HashMap. * The key-value pairs are presented as instances of scala.Tuple2. * <p> * Both sequential and parallel operations will be efficient. * * @param coll The immutable.HashMap to traverse * @return A Stream view of the collection which, by default, executes sequentially. */ public static <K, V> Stream< scala.Tuple2<K, V> > stream(scala.collection.immutable.HashMap<K, V> coll) { return StreamSupport.stream(new StepsAnyImmHashMap<K, V>(coll, 0, coll.size()), false); }