当前位置: 首页>>代码示例>>Java>>正文


Java ImmutablePair.getRight方法代码示例

本文整理汇总了Java中org.apache.commons.lang3.tuple.ImmutablePair.getRight方法的典型用法代码示例。如果您正苦于以下问题:Java ImmutablePair.getRight方法的具体用法?Java ImmutablePair.getRight怎么用?Java ImmutablePair.getRight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.commons.lang3.tuple.ImmutablePair的用法示例。


在下文中一共展示了ImmutablePair.getRight方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: findNodeByPodIP

import org.apache.commons.lang3.tuple.ImmutablePair; //导入方法依赖的package包/类
String findNodeByPodIP(String podIP) {
  for (ImmutablePair<Netmask, ImmutableMap<NetworkAddress, String>> entry : podSubnetToNode) {
    Netmask netmask = entry.getLeft();
    ImmutableMap<NetworkAddress, String> networkToNode = entry.getRight();
    // Computes the subnet that results from the netmask applied to the pod IP.
    SubnetInfo podSubnetToCheck;
    try {
      podSubnetToCheck = new SubnetUtils(podIP, netmask.getValue()).getInfo();
    } catch (IllegalArgumentException e) {
      log.warn(e);
      continue;
    }
    String networkAddress = podSubnetToCheck.getNetworkAddress();
    String nodeName = networkToNode.get(new NetworkAddress(networkAddress));
    if (nodeName != null) {  // The cluster node is in charge of this pod IP subnet.
      return nodeName;
    }
  }
  return "";
}
 
开发者ID:apache-spark-on-k8s,项目名称:kubernetes-HDFS,代码行数:21,代码来源:PodCIDRToNodeMapping.java

示例2: getCustomRuleEventSpec

import org.apache.commons.lang3.tuple.ImmutablePair; //导入方法依赖的package包/类
/**
 * Resolves event specification "&lt;name&gt; &lt;alias&gt; : &lt;mode&gt;". Uses default value when one not provided.
 *
 * @param eventSpecString event specification.
 * @return rule event specification, i.e. a triple of (name, alias, mode).
 */
protected RuleEventSpec getCustomRuleEventSpec(String eventSpecString) {
    if (eventSpecString == null) {
        throw new SpongeException("Event specification is null");
    }

    List<String> mainList =
            Arrays.stream(eventSpecString.split(":")).map(s -> s.trim()).filter(s -> !s.isEmpty()).collect(Collectors.toList());
    if (mainList.isEmpty()) {
        throw new SpongeException("Event specification is empty");
    } else if (mainList.size() > 2) {
        throw new SpongeException("Event specification has too many elements separated by ':'");
    }

    ImmutablePair<String, String> nameAlias = resolveEventNameAndAlias(mainList.get(0));
    EventMode eventMode = RuleAdapter.DEFAULT_MODE;
    if (mainList.size() == 2) {
        try {
            eventMode = EventMode.valueOf(mainList.get(1).toUpperCase());
        } catch (Exception e) {
            throw new SpongeException("Event mode is incorrect: " + mainList.get(1));
        }
    }

    return new GenericRuleEventSpec(nameAlias.getLeft(), nameAlias.getRight(), eventMode);
}
 
开发者ID:softelnet,项目名称:sponge,代码行数:32,代码来源:BaseKnowledgeBaseInterpreter.java

示例3: getContent

import org.apache.commons.lang3.tuple.ImmutablePair; //导入方法依赖的package包/类
public String getContent() {
  TableBuilder builder = new TableBuilder(OPERATOR_COLUMNS);

  for (ImmutablePair<OperatorProfile, Integer> ip : ops) {
    int minor = ip.getRight();
    OperatorProfile op = ip.getLeft();

    String path = new OperatorPathBuilder().setMajor(major).setMinor(minor).setOperator(op).build();
    builder.appendCell(path, null);
    builder.appendNanos(op.getSetupNanos(), null);
    builder.appendNanos(op.getProcessNanos(), null);
    builder.appendNanos(op.getWaitNanos(), null);

    long maxBatches = Long.MIN_VALUE;
    long maxRecords = Long.MIN_VALUE;
    for (StreamProfile sp : op.getInputProfileList()) {
      maxBatches = Math.max(sp.getBatches(), maxBatches);
      maxRecords = Math.max(sp.getRecords(), maxRecords);
    }

    builder.appendFormattedInteger(maxBatches, null);
    builder.appendFormattedInteger(maxRecords, null);
    builder.appendBytes(op.getPeakLocalMemoryAllocated(), null);
  }
  return builder.build();
}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:27,代码来源:OperatorWrapper.java

示例4: getContent

import org.apache.commons.lang3.tuple.ImmutablePair; //导入方法依赖的package包/类
public String getContent() {
  TableBuilder builder = new TableBuilder(OPERATOR_COLUMNS);

  for (ImmutablePair<OperatorProfile, Integer> ip : ops) {
    int minor = ip.getRight();
    OperatorProfile op = ip.getLeft();

    String path = new OperatorPathBuilder().setMajor(major).setMinor(minor).setOperator(op).build();
    builder.appendCell(path, null);
    builder.appendNanos(op.getSetupNanos());
    builder.appendNanos(op.getProcessNanos());
    builder.appendNanos(op.getWaitNanos());

    long maxBatches = Long.MIN_VALUE;
    long maxRecords = Long.MIN_VALUE;
    for (StreamProfile sp : op.getInputProfileList()) {
      maxBatches = Math.max(sp.getBatches(), maxBatches);
      maxRecords = Math.max(sp.getRecords(), maxRecords);
    }

    builder.appendFormattedInteger(maxBatches, null);
    builder.appendFormattedInteger(maxRecords, null);
    builder.appendBytes(op.getPeakLocalMemoryAllocated(), null);
  }
  return builder.build();
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:27,代码来源:OperatorWrapper.java

示例5: withinRange

import org.apache.commons.lang3.tuple.ImmutablePair; //导入方法依赖的package包/类
private boolean withinRange(final String name) {
  final int queryNumber = session.getQueryCount();
  final ImmutablePair<Integer, Integer> pair = shortLivedOptions.get(name);
  final int start = pair.getLeft();
  final int end = pair.getRight();
  return start <= queryNumber && queryNumber < end;
}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:8,代码来源:SessionOptionManager.java


注:本文中的org.apache.commons.lang3.tuple.ImmutablePair.getRight方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。