scala.collection.JavaConverters.setAsJavaSetConverter()方法的使用及代码示例

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

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

JavaConverters.setAsJavaSetConverter介绍

暂无

代码示例

代码示例来源:origin: com.typesafe.play/play_2.10

/**
 * Retrieves the set of keys available in this configuration.
 *
 * @return the set of keys available in this configuration
 */
public Set<String> keys() {
  return JavaConverters.setAsJavaSetConverter(conf.keys()).asJava();
}

代码示例来源:origin: com.typesafe.play/play_2.10

/**
 * Retrieves the set of direct sub-keys available in this configuration.
 *
 * @return the set of direct sub-keys available in this configuration
 */
public Set<String> subKeys() {
  return JavaConverters.setAsJavaSetConverter(conf.subKeys()).asJava();
}

代码示例来源:origin: uber/marmaray

public static <T> java.util.Set<T> toJavaSet(@NonNull final Set<T> scalaSet) {
  return JavaConverters.setAsJavaSetConverter(scalaSet).asJava();
}

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

/**
 * Returns those partitions for the task for which we have not received end-of-stream from the consumer.
 * @param task
 * @return a Set of SSPs such that all SSPs are not at end of stream.
 */
private Set<SystemStreamPartition> getWorkingSSPSet(TaskInstance task) {
 Set<SystemStreamPartition> allPartitions = new HashSet<>(JavaConverters.setAsJavaSetConverter(task.systemStreamPartitions()).asJava());
 // filter only those SSPs that are not at end of stream.
 Set<SystemStreamPartition> workingSSPSet = allPartitions.stream()
   .filter(ssp -> !consumerMultiplexer.isEndOfStream(ssp))
   .collect(Collectors.toSet());
 return workingSSPSet;
}

代码示例来源:origin: org.apache.samza/samza-core

/**
 * Returns those partitions for the task for which we have not received end-of-stream from the consumer.
 * @param task
 * @return a Set of SSPs such that all SSPs are not at end of stream.
 */
private Set<SystemStreamPartition> getWorkingSSPSet(TaskInstance task) {
 Set<SystemStreamPartition> allPartitions = new HashSet<>(JavaConverters.setAsJavaSetConverter(task.systemStreamPartitions()).asJava());
 // filter only those SSPs that are not at end of stream.
 Set<SystemStreamPartition> workingSSPSet = allPartitions.stream()
   .filter(ssp -> !consumerMultiplexer.isEndOfStream(ssp))
   .collect(Collectors.toSet());
 return workingSSPSet;
}

代码示例来源:origin: org.apache.samza/samza-core_2.11

/**
 * Returns mapping of the SystemStreamPartition to the AsyncTaskWorkers to efficiently route the envelopes
 */
private static Map<SystemStreamPartition, List<AsyncTaskWorker>> getSspToAsyncTaskWorkerMap(
  Map<TaskName, TaskInstance> taskInstances, Map<TaskName, AsyncTaskWorker> taskWorkers) {
 Map<SystemStreamPartition, List<AsyncTaskWorker>> sspToWorkerMap = new HashMap<>();
 for (TaskInstance task : taskInstances.values()) {
  Set<SystemStreamPartition> ssps = JavaConverters.setAsJavaSetConverter(task.systemStreamPartitions()).asJava();
  for (SystemStreamPartition ssp : ssps) {
   sspToWorkerMap.putIfAbsent(ssp, new ArrayList<>());
   sspToWorkerMap.get(ssp).add(taskWorkers.get(task.taskName()));
  }
 }
 return sspToWorkerMap;
}

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

/**
 * Returns mapping of the SystemStreamPartition to the AsyncTaskWorkers to efficiently route the envelopes
 */
private static Map<SystemStreamPartition, List<AsyncTaskWorker>> getSspToAsyncTaskWorkerMap(
  Map<TaskName, TaskInstance> taskInstances, Map<TaskName, AsyncTaskWorker> taskWorkers) {
 Map<SystemStreamPartition, List<AsyncTaskWorker>> sspToWorkerMap = new HashMap<>();
 for (TaskInstance task : taskInstances.values()) {
  Set<SystemStreamPartition> ssps = JavaConverters.setAsJavaSetConverter(task.systemStreamPartitions()).asJava();
  for (SystemStreamPartition ssp : ssps) {
   sspToWorkerMap.putIfAbsent(ssp, new ArrayList<>());
   sspToWorkerMap.get(ssp).add(taskWorkers.get(task.taskName()));
  }
 }
 return sspToWorkerMap;
}

代码示例来源:origin: org.apache.samza/samza-core_2.11

/**
 * Returns those partitions for the task for which we have not received end-of-stream from the consumer.
 * @param task
 * @return a Set of SSPs such that all SSPs are not at end of stream.
 */
private Set<SystemStreamPartition> getWorkingSSPSet(TaskInstance task) {
 Set<SystemStreamPartition> allPartitions = new HashSet<>(JavaConverters.setAsJavaSetConverter(task.systemStreamPartitions()).asJava());
 // filter only those SSPs that are not at end of stream.
 Set<SystemStreamPartition> workingSSPSet = allPartitions.stream()
   .filter(ssp -> !consumerMultiplexer.isEndOfStream(ssp))
   .collect(Collectors.toSet());
 return workingSSPSet;
}

代码示例来源:origin: org.apache.samza/samza-core_2.12

/**
 * Returns those partitions for the task for which we have not received end-of-stream from the consumer.
 * @param task
 * @return a Set of SSPs such that all SSPs are not at end of stream.
 */
private Set<SystemStreamPartition> getWorkingSSPSet(TaskInstance task) {
 Set<SystemStreamPartition> allPartitions = new HashSet<>(JavaConverters.setAsJavaSetConverter(task.systemStreamPartitions()).asJava());
 // filter only those SSPs that are not at end of stream.
 Set<SystemStreamPartition> workingSSPSet = allPartitions.stream()
   .filter(ssp -> !consumerMultiplexer.isEndOfStream(ssp))
   .collect(Collectors.toSet());
 return workingSSPSet;
}

代码示例来源:origin: org.apache.samza/samza-core_2.10

/**
 * Returns those partitions for the task for which we have not received end-of-stream from the consumer.
 * @param task
 * @return a Set of SSPs such that all SSPs are not at end of stream.
 */
private Set<SystemStreamPartition> getWorkingSSPSet(TaskInstance task) {
 Set<SystemStreamPartition> allPartitions = new HashSet<>(JavaConverters.setAsJavaSetConverter(task.systemStreamPartitions()).asJava());
 // filter only those SSPs that are not at end of stream.
 Set<SystemStreamPartition> workingSSPSet = allPartitions.stream()
   .filter(ssp -> !consumerMultiplexer.isEndOfStream(ssp))
   .collect(Collectors.toSet());
 return workingSSPSet;
}

代码示例来源:origin: org.apache.samza/samza-core

/**
 * Returns mapping of the SystemStreamPartition to the AsyncTaskWorkers to efficiently route the envelopes
 */
private static Map<SystemStreamPartition, List<AsyncTaskWorker>> getSspToAsyncTaskWorkerMap(
  Map<TaskName, TaskInstance> taskInstances, Map<TaskName, AsyncTaskWorker> taskWorkers) {
 Map<SystemStreamPartition, List<AsyncTaskWorker>> sspToWorkerMap = new HashMap<>();
 for (TaskInstance task : taskInstances.values()) {
  Set<SystemStreamPartition> ssps = JavaConverters.setAsJavaSetConverter(task.systemStreamPartitions()).asJava();
  for (SystemStreamPartition ssp : ssps) {
   sspToWorkerMap.putIfAbsent(ssp, new ArrayList<>());
   sspToWorkerMap.get(ssp).add(taskWorkers.get(task.taskName()));
  }
 }
 return sspToWorkerMap;
}

代码示例来源:origin: org.apache.samza/samza-core_2.12

/**
 * Returns mapping of the SystemStreamPartition to the AsyncTaskWorkers to efficiently route the envelopes
 */
private static Map<SystemStreamPartition, List<AsyncTaskWorker>> getSspToAsyncTaskWorkerMap(
  Map<TaskName, TaskInstance> taskInstances, Map<TaskName, AsyncTaskWorker> taskWorkers) {
 Map<SystemStreamPartition, List<AsyncTaskWorker>> sspToWorkerMap = new HashMap<>();
 for (TaskInstance task : taskInstances.values()) {
  Set<SystemStreamPartition> ssps = JavaConverters.setAsJavaSetConverter(task.systemStreamPartitions()).asJava();
  for (SystemStreamPartition ssp : ssps) {
   sspToWorkerMap.putIfAbsent(ssp, new ArrayList<>());
   sspToWorkerMap.get(ssp).add(taskWorkers.get(task.taskName()));
  }
 }
 return sspToWorkerMap;
}

代码示例来源:origin: org.apache.samza/samza-core_2.10

/**
 * Returns mapping of the SystemStreamPartition to the AsyncTaskWorkers to efficiently route the envelopes
 */
private static Map<SystemStreamPartition, List<AsyncTaskWorker>> getSspToAsyncTaskWorkerMap(
  Map<TaskName, TaskInstance> taskInstances, Map<TaskName, AsyncTaskWorker> taskWorkers) {
 Map<SystemStreamPartition, List<AsyncTaskWorker>> sspToWorkerMap = new HashMap<>();
 for (TaskInstance task : taskInstances.values()) {
  Set<SystemStreamPartition> ssps = JavaConverters.setAsJavaSetConverter(task.systemStreamPartitions()).asJava();
  for (SystemStreamPartition ssp : ssps) {
   sspToWorkerMap.putIfAbsent(ssp, new ArrayList<>());
   sspToWorkerMap.get(ssp).add(taskWorkers.get(task.taskName()));
  }
 }
 return sspToWorkerMap;
}

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

/**
 * Get the SystemStreams for the configured input and broadcast streams.
 *
 * @return the set of SystemStreams for both standard inputs and broadcast stream inputs.
 */
public Set<SystemStream> getAllInputStreams() {
 Set<SystemStream> allInputSS = new HashSet<>();
 TaskConfig taskConfig = TaskConfig.Config2Task(this);
 allInputSS.addAll((Set<? extends SystemStream>) JavaConverters.setAsJavaSetConverter(taskConfig.getInputStreams()).asJava());
 allInputSS.addAll(getBroadcastSystemStreams());
 return Collections.unmodifiableSet(allInputSS);
}

代码示例来源:origin: org.apache.samza/samza-core

/**
 * Get the SystemStreams for the configured input and broadcast streams.
 *
 * @return the set of SystemStreams for both standard inputs and broadcast stream inputs.
 */
public Set<SystemStream> getAllInputStreams() {
 Set<SystemStream> allInputSS = new HashSet<>();
 TaskConfig taskConfig = TaskConfig.Config2Task(this);
 allInputSS.addAll((Set<? extends SystemStream>) JavaConverters.setAsJavaSetConverter(taskConfig.getInputStreams()).asJava());
 allInputSS.addAll(getBroadcastSystemStreams());
 return Collections.unmodifiableSet(allInputSS);
}

代码示例来源:origin: org.apache.samza/samza-core_2.10

/**
 * Get the SystemStreams for the configured input and broadcast streams.
 *
 * @return the set of SystemStreams for both standard inputs and broadcast stream inputs.
 */
public Set<SystemStream> getAllInputStreams() {
 Set<SystemStream> allInputSS = new HashSet<>();
 TaskConfig taskConfig = TaskConfig.Config2Task(this);
 allInputSS.addAll((Set<? extends SystemStream>) JavaConverters.setAsJavaSetConverter(taskConfig.getInputStreams()).asJava());
 allInputSS.addAll(getBroadcastSystemStreams());
 return Collections.unmodifiableSet(allInputSS);
}

代码示例来源:origin: org.apache.samza/samza-core_2.11

/**
 * Get the SystemStreams for the configured input and broadcast streams.
 *
 * @return the set of SystemStreams for both standard inputs and broadcast stream inputs.
 */
public Set<SystemStream> getAllInputStreams() {
 Set<SystemStream> allInputSS = new HashSet<>();
 TaskConfig taskConfig = TaskConfig.Config2Task(this);
 allInputSS.addAll((Set<? extends SystemStream>) JavaConverters.setAsJavaSetConverter(taskConfig.getInputStreams()).asJava());
 allInputSS.addAll(getBroadcastSystemStreams());
 return Collections.unmodifiableSet(allInputSS);
}

代码示例来源:origin: org.apache.samza/samza-core_2.12

/**
 * Get the SystemStreams for the configured input and broadcast streams.
 *
 * @return the set of SystemStreams for both standard inputs and broadcast stream inputs.
 */
public Set<SystemStream> getAllInputStreams() {
 Set<SystemStream> allInputSS = new HashSet<>();
 TaskConfig taskConfig = TaskConfig.Config2Task(this);
 allInputSS.addAll((Set<? extends SystemStream>) JavaConverters.setAsJavaSetConverter(taskConfig.getInputStreams()).asJava());
 allInputSS.addAll(getBroadcastSystemStreams());
 return Collections.unmodifiableSet(allInputSS);
}

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

JavaConverters.setAsJavaSetConverter(this.metadataCache.getAllSystemStreams(systemName))
  .asJava()
  .stream()

代码示例来源:origin: Netflix/iceberg

InSet inExpr = (InSet) expr;
Set<Object> literals = setAsJavaSetConverter(inExpr.hset()).asJava();
return convertIn(inExpr.child(), literals);

相关文章