Package com.ngdata.sep.tools.monitoring.ReplicationStatus

Examples of com.ngdata.sep.tools.monitoring.ReplicationStatus.Status


            boolean noQueue = true;
            // Recovered queues disappear once finished, so definitely not finished as long as those are around
            if (replicationStatus.getRecoverdQueues().isEmpty()) {
                for (String peerId : replicationStatus.getPeers()) {
                    for (String server : replicationStatus.getServers(peerId)) {
                        Status status = replicationStatus.getStatus(peerId, server);
                        if (!(status.getHLogCount() == 1
                                /* sometimes it stays with two hlog files, with the second one 100% processed. */
                                || (status.getHLogCount() == 2 && Math.abs(status.getProgressOnCurrentHLog() - 1) < 0.000000001f))) {
                            noQueue = false;
                            break;
                        }
                    }
                }
            } else {
                log.debug("There are still recovered queues");
                noQueue = false;
            }

            // If no hlog files are queued (beyond the current one), wait until there is no replication activity
            // during MINIMAL_STABLE_STATUS_AGE, after which we assume replication is done
            // (there might also be no activity due to some other reason, e.g. that all peer servers are down and
            // hence that hbase can't replication anything, or that the processing of a batch of events takes longer
            // than the MINIMAL_STABLE_STATUS_AGE).
            if (noQueue) {
                log.debug("No hlog files queued, will check if replication status is stable");
                boolean statusStable = true;
                if (prevReplicationStatus != null) {
                    for (String peerId : replicationStatus.getPeers()) {
                        for (String server : replicationStatus.getServers(peerId)) {
                            Status status = replicationStatus.getStatus(peerId, server);
                            Status prevStatus = prevReplicationStatus.getStatus(peerId, server);
                            if (prevStatus == null) {
                                statusStable = false;
                                log.debug("No previous status for peer " + peerId + ", server " + server);
                                break;
                            }
View Full Code Here


                    Map<String, Status> statusByServer = statusByPeerAndServer.get(peer);
                    if (statusByServer == null) {
                        statusByServer = new TreeMap<String, Status>();
                        statusByPeerAndServer.put(peer, statusByServer);
                    }
                    Status status = statusByServer.get(server);
                    if (status == null) {
                        status = new Status();
                        statusByServer.put(server, status);
                    }

                    try {
                        Stat stat = new Stat();
View Full Code Here

    public void addStatusFromJmx(ReplicationStatus replicationStatus) throws Exception {
        JmxConnections jmxConnections = new JmxConnections();

        for (String peerId : replicationStatus.getPeersAndRecoveredQueues()) {
            for (String server : replicationStatus.getServers(peerId)) {
                Status status = replicationStatus.getStatus(peerId, server);
                String hostName = ServerName.parseHostname(server);

                MBeanServerConnection connection = jmxConnections.getConnector(hostName, HBASE_JMX_PORT).getMBeanServerConnection();

                ObjectName replSourceBean = new ObjectName("hadoop:service=Replication,name=ReplicationSource for " + URLEncoder.encode(peerId, "UTF8"));
View Full Code Here

TOP

Related Classes of com.ngdata.sep.tools.monitoring.ReplicationStatus.Status

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.