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

Examples of org.springframework.yarn.boot.actuate.endpoint.mvc.domain.ContainerClusterResource


        .build().toString();
  }

  private String doClusterInfo(YarnClient client, ApplicationId applicationId, String clusterId, boolean verbose) {
    YarnContainerClusterOperations operations = buildClusterOperations(client, applicationId);
    ContainerClusterResource response = operations.clusterInfo(clusterId);

    List<ClustersInfoReportData> data = new ArrayList<ClustersInfoReportData>();

    Integer pany = response.getGridProjection().getProjectionData().getAny();
    Map<String, Integer> phosts = response.getGridProjection().getProjectionData().getHosts();
    Map<String, Integer> pracks = response.getGridProjection().getProjectionData().getRacks();
    Integer sany = response.getGridProjection().getSatisfyState().getAllocateData().getAny();
    Map<String, Integer> shosts = response.getGridProjection().getSatisfyState().getAllocateData().getHosts();
    Map<String, Integer> sracks = response.getGridProjection().getSatisfyState().getAllocateData().getRacks();

    data.add(new ClustersInfoReportData(response.getContainerClusterState().getClusterState().toString(), response.getGridProjection().getMembers().size(), pany, phosts, pracks, sany, shosts, sracks));
    if (verbose) {
      return ContainerClusterReport.clusterInfoReportBuilder()
          .add(ClusterInfoField.STATE)
          .add(ClusterInfoField.MEMBERS)
          .add(ClusterInfoField.PROJECTIONANY)
View Full Code Here


  public HttpEntity<ContainerClusterResource> clusterInfo(@PathVariable("clusterId") String clusterId) {
    ContainerCluster cluster = delegate.getClusters().get(clusterId);
    if (cluster == null) {
      throw new NoSuchClusterException("No such cluster: " + clusterId);
    }
    ContainerClusterResource response = new ContainerClusterResource(cluster);
    return new ResponseEntity<ContainerClusterResource>(response, HttpStatus.OK);
  }
View Full Code Here

      andExpect(jsonPath("$.projectionData", nullValue())).
      andExpect(jsonPath("$.action", is(ModifyAction.START.toString().toLowerCase()))).
      andRespond(withSuccess(responseBody, MediaType.APPLICATION_JSON));
    ContainerClusterModifyRequest request = new ContainerClusterModifyRequest();
    request.setAction("start");
    ContainerClusterResource response = operations.clusterStart("cluster1", request);
    assertThat(response, notNullValue());
  }
View Full Code Here

      andExpect(jsonPath("$.projectionData", nullValue())).
      andExpect(jsonPath("$.action", is(ModifyAction.STOP.toString().toLowerCase()))).
      andRespond(withSuccess(responseBody, MediaType.APPLICATION_JSON));
    ContainerClusterModifyRequest request = new ContainerClusterModifyRequest();
    request.setAction("stop");
    ContainerClusterResource response = operations.clusterStop("cluster1", request);
    assertThat(response, notNullValue());
  }
View Full Code Here

    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.domain.ContainerClusterResource

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.