@GET @Path(LIVE_CONTAINERS + "/{containerId}") @Produces({APPLICATION_JSON}) public ContainerInformation getLiveContainer( @PathParam("containerId") String containerId) { markGet(SLIDER_SUBPATH_APPLICATION, LIVE_CONTAINERS); try { RoleInstance id = state.getLiveInstanceByContainerID(containerId); return id.serialize(); } catch (NoSuchNodeException e) { throw new NotFoundException("Unknown container: " + containerId); } catch (Exception e) { throw buildException(LIVE_CONTAINERS + "/"+ containerId, e); } }
@GET @Path(LIVE_CONTAINERS + "/{containerId}") @Produces({APPLICATION_JSON}) public ContainerInformation getLiveContainer( @PathParam("containerId") String containerId) { markGet(SLIDER_SUBPATH_APPLICATION, LIVE_CONTAINERS); try { RoleInstance id = state.getLiveInstanceByContainerID(containerId); return id.serialize(); } catch (NoSuchNodeException e) { throw new NotFoundException("Unknown container: " + containerId); } catch (Exception e) { throw buildException(LIVE_CONTAINERS + "/"+ containerId, e); } }
@Override public Messages.ContainerInformationProto getLiveContainer(Messages.GetLiveContainerRequestProto request) throws IOException { String containerId = request.getContainerId(); RoleInstance id = state.getLiveInstanceByContainerID(containerId); ContainerInformation containerInformation = id.serialize(); return marshall(containerInformation); }
@Override public Messages.ContainerInformationProto getLiveContainer(Messages.GetLiveContainerRequestProto request) throws IOException { String containerId = request.getContainerId(); RoleInstance id = state.getLiveInstanceByContainerID(containerId); ContainerInformation containerInformation = id.serialize(); return marshall(containerInformation); }
@Override //SliderClusterProtocol public Messages.GetNodeResponseProto getNode(Messages.GetNodeRequestProto request) throws IOException, YarnException { onRpcCall("getnode"); RoleInstance instance = state.getLiveInstanceByContainerID( request.getUuid()); return Messages.GetNodeResponseProto.newBuilder() .setClusterNode(instance.toProtobuf()) .build(); }
@Override //SliderClusterProtocol public Messages.GetNodeResponseProto getNode(Messages.GetNodeRequestProto request) throws IOException, YarnException { onRpcCall("getnode"); RoleInstance instance = state.getLiveInstanceByContainerID( request.getUuid()); return Messages.GetNodeResponseProto.newBuilder() .setClusterNode(instance.toProtobuf()) .build(); }
@Override public Messages.KillContainerResponseProto killContainer(Messages.KillContainerRequestProto request) throws IOException, YarnException { onRpcCall("killcontainer"); String containerID = request.getId(); log.info("Kill Container {}", containerID); //throws NoSuchNodeException if it is missing RoleInstance instance = state.getLiveInstanceByContainerID(containerID); queue(new ActionKillContainer(instance.getId(), 0, TimeUnit.MILLISECONDS, amOperations)); Messages.KillContainerResponseProto.Builder builder = Messages.KillContainerResponseProto.newBuilder(); builder.setSuccess(true); return builder.build(); }
@Override public Messages.KillContainerResponseProto killContainer(Messages.KillContainerRequestProto request) throws IOException, YarnException { onRpcCall("killcontainer"); String containerID = request.getId(); log.info("Kill Container {}", containerID); //throws NoSuchNodeException if it is missing RoleInstance instance = state.getLiveInstanceByContainerID(containerID); queue(new ActionKillContainer(instance.getId(), 0, TimeUnit.MILLISECONDS, amOperations)); Messages.KillContainerResponseProto.Builder builder = Messages.KillContainerResponseProto.newBuilder(); builder.setSuccess(true); return builder.build(); }