Examples of StorageServiceMBean


Examples of org.apache.cassandra.service.StorageServiceMBean

    // @throws IOException if unable to setup the JMX connection
    private static List<Node> retrieveRingData(String seedAddress, String remoteHost, int port) throws IOException
    {
        JMXServiceURL jmxUrl = new JMXServiceURL(String.format(fmtUrl, remoteHost, port));
        JMXConnector jmxc = JMXConnectorFactory.connect(jmxUrl, null);
        StorageServiceMBean ssProxy;
        MBeanServerConnection mbeanServerConn = jmxc.getMBeanServerConnection();

        try
        {
            ObjectName name = new ObjectName(ssObjName);
            ssProxy = JMX.newMBeanProxy(mbeanServerConn, name, StorageServiceMBean.class);
        } catch (MalformedObjectNameException e)
        {
            throw new RuntimeException(
                    "Invalid ObjectName? Please report this as a bug.", e);
        }

        Map<Range, List<String>> rangeMap = ssProxy.getRangeToEndPointMap();
        List<Range> ranges = new ArrayList<Range>(rangeMap.keySet());
        Collections.sort(ranges);
       
        List<Node> nodes = new ArrayList<Node>();
       
View Full Code Here

Examples of org.apache.cassandra.service.StorageServiceMBean

     * @throws CassandraServerManagementException
     *          for errors during accessing nodes
     */
    public NodeInformation[] getNodes() throws CassandraServerManagementException {

        StorageServiceMBean storageServiceMBean = cassandraMBeanLocator.locateStorageServiceMBean();
        Map<Token, String> tokenToEndpoint = storageServiceMBean.getTokenToEndpointMap();
        List<Token> sortedTokens = new ArrayList<Token>(tokenToEndpoint.keySet());
        Collections.sort(sortedTokens);

        Collection<String> liveNodes = storageServiceMBean.getLiveNodes();
        Collection<String> deadNodes = storageServiceMBean.getUnreachableNodes();
        Collection<String> joiningNodes = storageServiceMBean.getJoiningNodes();
        Collection<String> leavingNodes = storageServiceMBean.getLeavingNodes();
        Map<String, String> loadMap = storageServiceMBean.getLoadMap();

        List<NodeInformation> nodeInformations = new ArrayList<NodeInformation>();

        // Calculate per-token ownership of the ring
        Map<Token, Float> ownerships = storageServiceMBean.getOwnership();

        for (Token token : sortedTokens) {
            String primaryEndpoint = tokenToEndpoint.get(token);
            String status = liveNodes.contains(primaryEndpoint)
                    ? "Up"
View Full Code Here

Examples of org.apache.cassandra.service.StorageServiceMBean

        ssProxy = getSSProxy(jmxConn.getMbeanServerConn());
    }

    public StorageServiceMBean getSSProxy(MBeanServerConnection mbeanConn)
    {
        StorageServiceMBean proxy = null;
        try
        {
            ObjectName name = new ObjectName(ssObjName);
            proxy = JMX.newMBeanProxy(mbeanConn, name, StorageServiceMBean.class);
        }
View Full Code Here

Examples of org.apache.cassandra.service.StorageServiceMBean

        ssProxy = getSSProxy(jmxConn.getMbeanServerConn());
    }

    private StorageServiceMBean getSSProxy(MBeanServerConnection mbeanConn)
    {
        StorageServiceMBean proxy;
        try
        {
            ObjectName name = new ObjectName(ssObjName);
            proxy = JMX.newMBeanProxy(mbeanConn, name, StorageServiceMBean.class);
        }
View Full Code Here

Examples of org.apache.cassandra.service.StorageServiceMBean

    // @throws IOException if unable to setup the JMX connection
    private static List<Node> retrieveRingData(String seedAddress, String remoteHost, int port) throws IOException
    {
        JMXServiceURL jmxUrl = new JMXServiceURL(String.format(fmtUrl, remoteHost, port));
        JMXConnector jmxc = JMXConnectorFactory.connect(jmxUrl, null);
        StorageServiceMBean ssProxy;
        MBeanServerConnection mbeanServerConn = jmxc.getMBeanServerConnection();

        try
        {
            ObjectName name = new ObjectName(ssObjName);
            ssProxy = JMX.newMBeanProxy(mbeanServerConn, name, StorageServiceMBean.class);
        } catch (MalformedObjectNameException e)
        {
            throw new RuntimeException(
                    "Invalid ObjectName? Please report this as a bug.", e);
        }

        Map<Range, List<String>> rangeMap = ssProxy.getRangeToEndPointMap(null);
        List<Range> ranges = new ArrayList<Range>(rangeMap.keySet());
        Collections.sort(ranges);
       
        List<Node> nodes = new ArrayList<Node>();
       
View Full Code Here

Examples of org.apache.cassandra.service.StorageServiceMBean

        ssProxy = getSSProxy(jmxConn.getMbeanServerConn());
    }

    public StorageServiceMBean getSSProxy(MBeanServerConnection mbeanConn)
    {
        StorageServiceMBean proxy = null;
        try
        {
            ObjectName name = new ObjectName(ssObjName);
            proxy = JMX.newMBeanProxy(mbeanConn, name, StorageServiceMBean.class);
        }
View Full Code Here

Examples of org.apache.cassandra.service.StorageServiceMBean

    // @throws IOException if unable to setup the JMX connection
    private static List<Node> retrieveRingData(String seedAddress, String remoteHost, int port) throws IOException
    {
        JMXServiceURL jmxUrl = new JMXServiceURL(String.format(fmtUrl, remoteHost, port));
        JMXConnector jmxc = JMXConnectorFactory.connect(jmxUrl, null);
        StorageServiceMBean ssProxy;
        MBeanServerConnection mbeanServerConn = jmxc.getMBeanServerConnection();

        try
        {
            ObjectName name = new ObjectName(ssObjName);
            ssProxy = JMX.newMBeanProxy(mbeanServerConn, name, StorageServiceMBean.class);
        } catch (MalformedObjectNameException e)
        {
            throw new RuntimeException(
                    "Invalid ObjectName? Please report this as a bug.", e);
        }

        Map<Range, List<String>> rangeMap = ssProxy.getRangeToEndpointMap(null);
        List<Range> ranges = new ArrayList<Range>(rangeMap.keySet());
        Collections.sort(ranges);
       
        List<Node> nodes = new ArrayList<Node>();
       
View Full Code Here

Examples of org.apache.cassandra.service.StorageServiceMBean

        ssProxy = getSSProxy(jmxConn.getMbeanServerConn());
    }

    public StorageServiceMBean getSSProxy(MBeanServerConnection mbeanConn)
    {
        StorageServiceMBean proxy = null;
        try
        {
            ObjectName name = new ObjectName(ssObjName);
            proxy = JMX.newMBeanProxy(mbeanConn, name, StorageServiceMBean.class);
        }
View Full Code Here

Examples of org.apache.cassandra.service.StorageServiceMBean

        ssProxy = getSSProxy(jmxConn.getMbeanServerConn());
    }

    private StorageServiceMBean getSSProxy(MBeanServerConnection mbeanConn)
    {
        StorageServiceMBean proxy;
        try
        {
            ObjectName name = new ObjectName(ssObjName);
            proxy = JMX.newMBeanProxy(mbeanConn, name, StorageServiceMBean.class);
        }
View Full Code Here

Examples of org.apache.cassandra.service.StorageServiceMBean

        ssProxy = getSSProxy(jmxConn.getMbeanServerConn());
    }

    public StorageServiceMBean getSSProxy(MBeanServerConnection mbeanConn)
    {
        StorageServiceMBean proxy = null;
        try
        {
            ObjectName name = new ObjectName(ssObjName);
            proxy = JMX.newMBeanProxy(mbeanConn, name, StorageServiceMBean.class);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.