Java Code Examples for org.apache.hadoop.yarn.api.records.QueueInfo#getDefaultNodeLabelExpression()

The following examples show how to use org.apache.hadoop.yarn.api.records.QueueInfo#getDefaultNodeLabelExpression() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SchedulerUtils.java    From hadoop with Apache License 2.0 6 votes vote down vote up
private static void normalizeNodeLabelExpressionInRequest(
    ResourceRequest resReq, QueueInfo queueInfo) {

  String labelExp = resReq.getNodeLabelExpression();

  // if queue has default label expression, and RR doesn't have, use the
  // default label expression of queue
  if (labelExp == null && queueInfo != null && ResourceRequest.ANY
      .equals(resReq.getResourceName())) {
    labelExp = queueInfo.getDefaultNodeLabelExpression();
  }

  // If labelExp still equals to null, set it to be NO_LABEL
  if (labelExp == null) {
    labelExp = RMNodeLabelsManager.NO_LABEL;
  }
  resReq.setNodeLabelExpression(labelExp);
}
 
Example 2
Source File: SchedulerUtils.java    From big-c with Apache License 2.0 6 votes vote down vote up
private static void normalizeNodeLabelExpressionInRequest(
    ResourceRequest resReq, QueueInfo queueInfo) {

  String labelExp = resReq.getNodeLabelExpression();

  // if queue has default label expression, and RR doesn't have, use the
  // default label expression of queue
  if (labelExp == null && queueInfo != null && ResourceRequest.ANY
      .equals(resReq.getResourceName())) {
    labelExp = queueInfo.getDefaultNodeLabelExpression();
  }

  // If labelExp still equals to null, set it to be NO_LABEL
  if (labelExp == null) {
    labelExp = RMNodeLabelsManager.NO_LABEL;
  }
  resReq.setNodeLabelExpression(labelExp);
}
 
Example 3
Source File: QueueCLI.java    From hadoop with Apache License 2.0 5 votes vote down vote up
private void printQueueInfo(PrintWriter writer, QueueInfo queueInfo) {
  writer.print("Queue Name : ");
  writer.println(queueInfo.getQueueName());

  writer.print("\tState : ");
  writer.println(queueInfo.getQueueState());
  DecimalFormat df = new DecimalFormat("#.0");
  writer.print("\tCapacity : ");
  writer.println(df.format(queueInfo.getCapacity() * 100) + "%");
  writer.print("\tCurrent Capacity : ");
  writer.println(df.format(queueInfo.getCurrentCapacity() * 100) + "%");
  writer.print("\tMaximum Capacity : ");
  writer.println(df.format(queueInfo.getMaximumCapacity() * 100) + "%");
  writer.print("\tDefault Node Label expression : ");
  if (null != queueInfo.getDefaultNodeLabelExpression()) {
    writer.println(queueInfo.getDefaultNodeLabelExpression());
  } else {
    writer.println();
  }

  Set<String> nodeLabels = queueInfo.getAccessibleNodeLabels();
  StringBuilder labelList = new StringBuilder();
  writer.print("\tAccessible Node Labels : ");
  for (String nodeLabel : nodeLabels) {
    if (labelList.length() > 0) {
      labelList.append(',');
    }
    labelList.append(nodeLabel);
  }
  writer.println(labelList.toString());
}
 
Example 4
Source File: QueueCLI.java    From big-c with Apache License 2.0 5 votes vote down vote up
private void printQueueInfo(PrintWriter writer, QueueInfo queueInfo) {
  writer.print("Queue Name : ");
  writer.println(queueInfo.getQueueName());

  writer.print("\tState : ");
  writer.println(queueInfo.getQueueState());
  DecimalFormat df = new DecimalFormat("#.0");
  writer.print("\tCapacity : ");
  writer.println(df.format(queueInfo.getCapacity() * 100) + "%");
  writer.print("\tCurrent Capacity : ");
  writer.println(df.format(queueInfo.getCurrentCapacity() * 100) + "%");
  writer.print("\tMaximum Capacity : ");
  writer.println(df.format(queueInfo.getMaximumCapacity() * 100) + "%");
  writer.print("\tDefault Node Label expression : ");
  if (null != queueInfo.getDefaultNodeLabelExpression()) {
    writer.println(queueInfo.getDefaultNodeLabelExpression());
  } else {
    writer.println();
  }

  Set<String> nodeLabels = queueInfo.getAccessibleNodeLabels();
  StringBuilder labelList = new StringBuilder();
  writer.print("\tAccessible Node Labels : ");
  for (String nodeLabel : nodeLabels) {
    if (labelList.length() > 0) {
      labelList.append(',');
    }
    labelList.append(nodeLabel);
  }
  writer.println(labelList.toString());
}