Ejemplo n.º 1
0
 @Override
 public Response checkNode(final String clusterName, final String hostName) {
   Preconditions.checkNotNull(clusterName);
   Preconditions.checkNotNull(hostName);
   if (hiveManager.getCluster(clusterName) == null) {
     return Response.status(Response.Status.INTERNAL_SERVER_ERROR)
         .entity(clusterName + " cluster not found.")
         .build();
   }
   UUID uuid = hiveManager.statusCheck(clusterName, hostName);
   OperationState state = waitUntilOperationFinish(uuid);
   return createResponse(uuid, state);
 }
Ejemplo n.º 2
0
  private HivePojo parsePojo(HiveConfig config) {
    HivePojo pojo = new HivePojo();
    try {
      Environment env = environmentManager.loadEnvironment(config.getEnvironmentId());

      pojo.setClusterName(config.getClusterName());
      pojo.setEnvironmentId(config.getEnvironmentId());
      pojo.setHadoopClusterName(config.getHadoopClusterName());
      pojo.setServer(new NodePojo(config.getServer(), env));
      UUID uuid = hiveManager.statusCheck(config.getClusterName(), pojo.getServer().getHostname());
      pojo.getServer().setStatus(checkStatus(tracker, uuid));

      Set<NodePojo> clients = new HashSet<>();
      for (String slave : config.getClients()) {
        clients.add(new NodePojo(slave, env));
      }
      pojo.setClients(clients);
    } catch (EnvironmentNotFoundException e) {
      e.printStackTrace();
    }

    return pojo;
  }