Package com.netflix.priam.utils

Examples of com.netflix.priam.utils.JMXNodeTool


    @GET
    @Path("/drain")
    public Response cassDrain() throws IOException, ExecutionException, InterruptedException
    {
        JMXNodeTool nodetool = null;
    try {
      nodetool = JMXNodeTool.instance(config);
    } catch (JMXConnectionException e) {
      return Response.status(503).entity("JMXConnectionException")
          .build();
    }
        logger.debug("node tool drain being called");
        nodetool.drain();
        return Response.ok(REST_SUCCESS, MediaType.APPLICATION_JSON).build();
    }
View Full Code Here


    {
        logger.debug("node tool refresh is being called");
        if (StringUtils.isBlank(keyspaces))
            return Response.status(400).entity("Missing keyspace in request").build();
       
        JMXNodeTool nodetool = null;
    try {
      nodetool = JMXNodeTool.instance(config);
    } catch (JMXConnectionException e) {
      return Response.status(503).entity("JMXConnectionException")
          .build();
    }
        nodetool.refresh(Lists.newArrayList(keyspaces.split(",")));
        return Response.ok(REST_SUCCESS, MediaType.APPLICATION_JSON).build();
    }
View Full Code Here

    @GET
    @Path("/info")
    public Response cassInfo() throws IOException, InterruptedException, JSONException
    {
        JMXNodeTool nodetool = null;
    try {
      nodetool = JMXNodeTool.instance(config);
    } catch (JMXConnectionException e) {
      return Response.status(503).entity("JMXConnectionException")
          .build();
    }
        logger.debug("node tool info being called");
        return Response.ok(nodetool.info(), MediaType.APPLICATION_JSON).build();
    }
View Full Code Here

    @GET
    @Path("/ring/{id}")
    public Response cassRing(@PathParam("id") String keyspace) throws IOException, InterruptedException, JSONException
    {
        JMXNodeTool nodetool = null;
    try {
      nodetool = JMXNodeTool.instance(config);
    } catch (JMXConnectionException e) {
      return Response.status(503).entity("JMXConnectionException")
          .build();
    }
        logger.debug("node tool ring being called");
        return Response.ok(nodetool.ring(keyspace), MediaType.APPLICATION_JSON).build();
    }
View Full Code Here

    @GET
    @Path("/flush")
    public Response cassFlush() throws IOException, InterruptedException, ExecutionException
    {
        JMXNodeTool nodetool = null;
    try {
      nodetool = JMXNodeTool.instance(config);
    } catch (JMXConnectionException e) {
      return Response.status(503).entity("JMXConnectionException")
          .build();
    }
        logger.debug("node tool flush being called");
        nodetool.flush();
        return Response.ok().build();
    }
View Full Code Here

    {
        new RetryableCallable<Void>()
        {
            public Void retriableCall() throws Exception
            {
                JMXNodeTool nodetool = JMXNodeTool.instance(config);
                nodetool.takeSnapshot(snapshotName, null, new String[0]);
                return null;
            }
        }.call();
    }
View Full Code Here

    {
        new RetryableCallable<Void>()
        {
            public Void retriableCall() throws Exception
            {
                JMXNodeTool nodetool = JMXNodeTool.instance(config);
                nodetool.clearSnapshot(snapshotTag);
                return null;
            }
        }.call();
    }
View Full Code Here

    @GET
    @Path("/compact")
    public Response cassCompact() throws IOException, ExecutionException, InterruptedException
    {
        JMXNodeTool nodetool = null;
    try {
      nodetool = JMXNodeTool.instance(config);
    } catch (JMXConnectionException e) {
      return Response.status(503).entity("JMXConnectionException")
          .build();
    }
        logger.debug("node tool compact being called");
        nodetool.compact();
        return Response.ok().build();
    }
View Full Code Here

    @GET
    @Path("/cleanup")
    public Response cassCleanup() throws IOException, ExecutionException, InterruptedException
    {
        JMXNodeTool nodetool = null;
    try {
      nodetool = JMXNodeTool.instance(config);
    } catch (JMXConnectionException e) {
      return Response.status(503).entity("JMXConnectionException")
          .build();
    }
        logger.debug("node tool cleanup being called");
        nodetool.cleanup();
        return Response.ok().build();
    }
View Full Code Here

    @GET
    @Path("/repair")
    public Response cassRepair(@QueryParam("sequential") boolean isSequential, @QueryParam("localDC") boolean localDCOnly, @DefaultValue("false") @QueryParam("primaryRange") boolean primaryRange) throws IOException, ExecutionException, InterruptedException
    {
        JMXNodeTool nodetool = null;
    try {
      nodetool = JMXNodeTool.instance(config);
    } catch (JMXConnectionException e) {
      return Response.status(503).entity("JMXConnectionException")
          .build();
    }
        logger.debug("node tool repair being called");
        nodetool.repair(isSequential, localDCOnly, primaryRange);
        return Response.ok(REST_SUCCESS, MediaType.APPLICATION_JSON).build();
    }
View Full Code Here

TOP

Related Classes of com.netflix.priam.utils.JMXNodeTool

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.