Package org.springframework.yarn.boot.actuate.endpoint.mvc

Examples of org.springframework.yarn.boot.actuate.endpoint.mvc.ContainerClusterCreateRequest


  private String doClusterCreate(YarnClient client, ApplicationId applicationId, String clusterId, String clusterDef,
      String projectionType, Integer projectionDataAny, Map<String, Integer> hosts, Map<String, Integer> racks,
      Map<String, Object> extraProperties) {
    YarnContainerClusterOperations operations = buildClusterOperations(client, applicationId);

    ContainerClusterCreateRequest request = new ContainerClusterCreateRequest();
    request.setClusterId(clusterId);
    request.setClusterDef(clusterDef);
    request.setProjection(projectionType);
    request.setExtraProperties(extraProperties);

    ProjectionDataType projectionData = new ProjectionDataType();
    projectionData.setAny(projectionDataAny);
    projectionData.setHosts(hosts);
    projectionData.setRacks(racks);

    request.setProjectionData(projectionData);
    operations.clusterCreate(request);
    return "Cluster " + clusterId + " created.";
  }
View Full Code Here


  private String doClusterModify(YarnClient client, ApplicationId applicationId, String clusterId,
      Integer projectionDataAny, Map<String, Integer> hosts, Map<String, Integer> racks) {
    YarnContainerClusterOperations operations = buildClusterOperations(client, applicationId);

    ContainerClusterCreateRequest request = new ContainerClusterCreateRequest();
    request.setClusterId(clusterId);

    ProjectionDataType projectionData = new ProjectionDataType();
    projectionData.setAny(projectionDataAny);
    projectionData.setHosts(hosts);
    projectionData.setRacks(racks);

    request.setProjectionData(projectionData);

    operations.clusterModify(clusterId, request);
    return "Cluster " + clusterId + " modified.";
  }
View Full Code Here

        + "\"satisfyState\":null},\"containerClusterState\":null" + "}";

    mockServer.expect(requestTo("/" + YarnContainerClusterEndpoint.ENDPOINT_ID)).andExpect(method(HttpMethod.POST))
    .andRespond(withSuccess(responseBody, MediaType.APPLICATION_JSON));

    ContainerClusterCreateRequest request = new ContainerClusterCreateRequest();
    request.setClusterId("cluster1");
    request.setProjection("any");
    ProjectionDataType projectionData = new ProjectionDataType();
    projectionData.setAny(1);
    request.setProjectionData(projectionData);

    ContainerClusterResource response = operations.clusterCreate(request);
    assertThat(response, notNullValue());
  }
View Full Code Here

TOP

Related Classes of org.springframework.yarn.boot.actuate.endpoint.mvc.ContainerClusterCreateRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.