scala.collection.Iterator.toSeq()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(266)

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

Iterator.toSeq介绍

暂无

代码示例

代码示例来源:origin: linkedin/cruise-control

JavaConverters.asScalaIteratorConverter(newAssignedReplica.iterator()).asScala().toSeq());

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

/**
 * Sets the schema using all the table columns before any column pruning has been done
 */
private void setSchema() {
  try (Connection conn = DriverManager.getConnection("jdbc:phoenix:" + zkUrl)) {
    List<ColumnInfo> columnInfos = PhoenixRuntime.generateColumnInfo(conn, tableName, null);
    Seq<ColumnInfo> columnInfoSeq = JavaConverters.asScalaIteratorConverter(columnInfos.iterator()).asScala().toSeq();
    schema = SparkSchemaUtil.phoenixSchemaToCatalystSchema(columnInfoSeq, dateAsTimestamp);
  }
  catch (SQLException e) {
    throw new RuntimeException(e);
  }
}

代码示例来源:origin: gnuhpc/Kafka-zk-restapi

private List<TopicAndPartition> getTopicPartitions(String t) {
 List<TopicAndPartition> tpList = new ArrayList<>();
 List<String> l = Arrays.asList(t);
 java.util.Map<String, Seq<Object>> tpMap =
   JavaConverters.mapAsJavaMapConverter(
       zkUtils.getPartitionsForTopics(
         JavaConverters.asScalaIteratorConverter(l.iterator()).asScala().toSeq()))
     .asJava();
 if (tpMap != null) {
  ArrayList<Object> partitionLists =
    new ArrayList<>(JavaConverters.seqAsJavaListConverter(tpMap.get(t)).asJava());
  tpList =
    partitionLists.stream().map(p -> new TopicAndPartition(t, (Integer) p)).collect(toList());
 }
 return tpList;
}

代码示例来源:origin: openzipkin/zipkin-finagle

@Override public void incrementMessagesDropped(Throwable cause) {
 if (cause instanceof FinagleSender.WrappedException) cause = cause.getCause();
 Seq<Traversable<String>> paths = Throwables.mkString(cause).inits().toSeq();
 for (Iterator<Traversable<String>> i = paths.iterator(); i.hasNext();) {
  messagesDropped.counter(i.next().toSeq()).incr();
 }
}

代码示例来源:origin: io.zipkin.finagle2/zipkin-finagle

@Override public void incrementMessagesDropped(Throwable cause) {
 if (cause instanceof FinagleSender.WrappedException) cause = cause.getCause();
 Seq<Traversable<String>> paths = Throwables.mkString(cause).inits().toSeq();
 for (Iterator<Traversable<String>> i = paths.iterator(); i.hasNext();) {
  messagesDropped.counter(i.next().toSeq()).incr();
 }
}

代码示例来源:origin: io.zipkin.finagle/zipkin-finagle

@Override public void incrementMessagesDropped(Throwable cause) {
 Seq<Traversable<String>> paths = Throwables.mkString(cause).inits().toSeq();
 for (Iterator<Traversable<String>> i = paths.iterator(); i.hasNext();) {
  messagesDropped.counter(i.next().toSeq()).incr();
 }
}

相关文章