private void writeFields(Object ... keyValuePairs) throws IOException {
      if (keyValuePairs.length % 2 != 0) {
        throw new IllegalArgumentException("Expected pairs, got: " + keyValuePairs.length);
      }

      if (keyValuePairs.length < 2) {
        return;
      }

      out.write('[');
      out.write(getKeyValueText(0, keyValuePairs).getBytes(StandardCharsets.UTF_8));
      for (int i = 2; i < keyValuePairs.length; i += 2) {
        out.write(',');
        out.write(getKeyValueText(i, keyValuePairs).getBytes(StandardCharsets.UTF_8));
      }
      out.write(']');
    }
Class to print text records for resource plans in the following format.

<rp_name>[status=<STATUS>,parallelism=<parallelism>,defaultPool=<defaultPool>]
    <queue_name>[allocFraction=<fraction>,schedulingPolicy=<policy>,parallelism=<parallelism>]
      > <trigger_name>: if(<triggerExpression>){<actionExpression>}
ql/src/java/org/apache/hadoop/hive/ql/ddl/workloadmanagement/resourceplan/show/formatter/TextShowResourcePlanFormatter.java