Package com.netflix.priam.utils

Examples of com.netflix.priam.utils.JMXNodeTool


    @GET
    @Path("/move")
    public Response moveToken(@QueryParam(REST_HEADER_TOKEN) String newToken) throws IOException, ExecutionException, InterruptedException, ConfigurationException
    {
        JMXNodeTool nodetool = null;
    try {
      nodetool = JMXNodeTool.instance(config);
    } catch (JMXConnectionException e) {
      return Response.status(503).entity("JMXConnectionException")
          .build();
    }
        nodetool.move(newToken);
        return Response.ok(REST_SUCCESS, MediaType.APPLICATION_JSON).build();
    }
View Full Code Here


    @GET
    @Path("/scrub")
    public Response scrub(@QueryParam(REST_HEADER_KEYSPACES) String keyspaces, @QueryParam(REST_HEADER_CFS) String cfnames) throws IOException, ExecutionException, InterruptedException,
            ConfigurationException
    {
        JMXNodeTool nodetool = null;
    try {
      nodetool = JMXNodeTool.instance(config);
    } catch (JMXConnectionException e) {
      return Response.status(503).entity("JMXConnectionException")
          .build();
    }
        String[] cfs = null;
        if (StringUtils.isNotBlank(cfnames))
            cfs = cfnames.split(",");
        if (cfs == null)
            nodetool.scrub(keyspaces);
        else
            nodetool.scrub(keyspaces, cfs);
        return Response.ok(REST_SUCCESS, MediaType.APPLICATION_JSON).build();
    }
View Full Code Here

    @GET
    @Path("/cfhistograms")
    public Response cfhistograms(@QueryParam(REST_HEADER_KEYSPACES) String keyspace, @QueryParam(REST_HEADER_CFS) String cfname) throws IOException, ExecutionException, InterruptedException,
            JSONException
    {
        JMXNodeTool nodetool = null;
    try {
      nodetool = JMXNodeTool.instance(config);
    } catch (JMXConnectionException e) {
      return Response.status(503).entity("JMXConnectionException")
          .build();
    }
        if (StringUtils.isBlank(keyspace) || StringUtils.isBlank(cfname))
            return Response.status(400).entity("Missing keyspace/cfname in request").build();

        ColumnFamilyStoreMBean store = nodetool.getCfsProxy(keyspace, cfname);

        // default is 90 offsets
        long[] offsets = new EstimatedHistogram().getBucketOffsets();

        long[] rrlh = store.getRecentReadLatencyHistogramMicros();
View Full Code Here

    @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

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.