Package org.lilyproject.util.jmx

Examples of org.lilyproject.util.jmx.JmxLiaison


        delete = new Delete(Bytes.toBytes("i-am-quite-sure-this-row-does-not-exist-ha-ha-ha-2"));
        table.delete(delete);
        table.close();

        // Using JMX, query the size of the queue of hlogs to be processed for each replication source
        JmxLiaison jmxLiaison = new JmxLiaison();
        jmxLiaison.connect(mode == Mode.EMBED);
        ObjectName replicationSources = new ObjectName("hadoop:service=Replication,name=ReplicationSource for *");
        Set<ObjectName> mbeans = jmxLiaison.queryNames(replicationSources);
        long tryUntil = System.currentTimeMillis() + timeout;
        nextMBean: for (ObjectName mbean : mbeans) {
            int logQSize = Integer.MAX_VALUE;
            while (logQSize > 0 && System.currentTimeMillis() < tryUntil) {
                logQSize = (Integer)jmxLiaison.getAttribute(mbean, "sizeOfLogQueue");
                // logQSize == 0 means there is one active hlog that is polled by replication
                // and none that are queued for later processing
                // System.out.println("hlog q size is " + logQSize + " for " + mbean.toString() + " max wait left is " +
                //     (tryUntil - System.currentTimeMillis()));
                if (logQSize == 0) {
View Full Code Here


     * @param timeout
     * @return
     * @throws Exception
     */
    public boolean waitOnSepIdle(long timeout) throws Exception {
        JmxLiaison jmxLiaison = new JmxLiaison();
        jmxLiaison.connect(mode == HBaseProxy.Mode.EMBED);
        Map<String, Long> currentTimeStamp = getLastSepTimestamps(jmxLiaison);
        Map<String, Long> lastTimeStamp = null;
        int count = 0;
        long tryUntil = System.currentTimeMillis() + timeout;

View Full Code Here

     */
    public void waitOnReplicationPeerReady(String peerId) throws Exception {
        if (mode == Mode.EMBED) {
            mbean.waitOnReplicationPeerReady(peerId);
        } else {
            JmxLiaison jmxLiaison = new JmxLiaison();
            jmxLiaison.connect(false);
            jmxLiaison.invoke(new ObjectName("LilyHBaseProxy:name=ReplicationPeer"), "waitOnReplicationPeerReady",
                    peerId);
            jmxLiaison.disconnect();
        }
    }
View Full Code Here

     */
    public void waitOnReplicationPeerStopped(String peerId) throws Exception {
        if (mode == Mode.EMBED) {
            mbean.waitOnReplicationPeerStopped(peerId);
        } else {
            JmxLiaison jmxLiaison = new JmxLiaison();
            jmxLiaison.connect(false);
            jmxLiaison.invoke(new ObjectName("LilyHBaseProxy:name=ReplicationPeer"), "waitOnReplicationPeerStopped",
                    peerId);
            jmxLiaison.disconnect();
        }
    }
View Full Code Here

TOP

Related Classes of org.lilyproject.util.jmx.JmxLiaison

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.