@Override public void write(OutputStream os, NodeAttributesManager mgr) throws IOException { ((NodesToAttributesMappingRequestPBImpl) NodesToAttributesMappingRequest .newInstance(AttributeMappingOperationType.REMOVE, attributes, false)) .getProto().writeDelimitedTo(os); }
@Override public void write(OutputStream os, NodeAttributesManager mgr) throws IOException { ((NodesToAttributesMappingRequestPBImpl) NodesToAttributesMappingRequest .newInstance(AttributeMappingOperationType.REPLACE, attributes, false)) .getProto().writeDelimitedTo(os); }
@Override public void write(OutputStream os, NodeAttributesManager mgr) throws IOException { ((NodesToAttributesMappingRequestPBImpl) NodesToAttributesMappingRequest .newInstance(AttributeMappingOperationType.ADD, attributes, false)) .getProto().writeDelimitedTo(os); }
@Override public void write(OutputStream os, NodeAttributesManager mgr) throws IOException { ((NodesToAttributesMappingRequestPBImpl) NodesToAttributesMappingRequest .newInstance(AttributeMappingOperationType.REPLACE, mgr.getNodeToAttributes( ImmutableSet.of(NodeAttribute.PREFIX_CENTRALIZED)), false)) .getProto().writeDelimitedTo(os); }
public int handleCommand(CommandLine cliParser) throws IOException, YarnException { String operation = null; if (cliParser.hasOption(ADD)) { operation = ADD; } else if (cliParser.hasOption(REMOVE)) { operation = REMOVE; } else if (cliParser.hasOption(REPLACE)) { operation = REPLACE; } if (operation != null) { List<NodeToAttributes> buildNodeLabelsListFromStr = buildNodeLabelsListFromStr(cliParser.getOptionValue(operation), !operation.equals(REPLACE), operation); NodesToAttributesMappingRequest request = NodesToAttributesMappingRequest.newInstance( AttributeMappingOperationType.valueOf(operation.toUpperCase()), buildNodeLabelsListFromStr, cliParser.hasOption(FAILUNKNOWNNODES)); ResourceManagerAdministrationProtocol adminProtocol = createAdminProtocol(); adminProtocol.mapAttributesToNodes(request); } else { // Handle case for only failOnUnknownNodes passed throw new IllegalArgumentException( getOptions().getOption(FAILUNKNOWNNODES).getDescription()); } return 0; }
.newInstance(AttributeMappingOperationType.ADD, ImmutableList.of(NodeToAttributes.newInstance("host1", ImmutableList.of(NodeAttribute.newInstance( .newInstance(AttributeMappingOperationType.REMOVE, ImmutableList.of(NodeToAttributes.newInstance("host4", ImmutableList.of(NodeAttribute.newInstance( .newInstance(AttributeMappingOperationType.ADD, ImmutableList.of(NodeToAttributes.newInstance("host5", ImmutableList.of(NodeAttribute.newInstance( .newInstance(AttributeMappingOperationType.ADD, ImmutableList.of( NodeToAttributes.newInstance("host4:8889", ImmutableList.of(NodeAttribute.newInstance( .newInstance(AttributeMappingOperationType.REPLACE, ImmutableList.of(NodeToAttributes.newInstance("host5", ImmutableList.of(NodeAttribute.newInstance( .newInstance(AttributeMappingOperationType.ADD, ImmutableList.of(NodeToAttributes.newInstance("host5", ImmutableList.of(NodeAttribute.newInstance(