Package com.taobao.metamorphosis.network

Examples of com.taobao.metamorphosis.network.StatsCommand


        sessionFactory.getRemotingClient().connect(serverUrl);
        sessionFactory.getRemotingClient().awaitReadyInterrupt(serverUrl);

        BooleanCommand resp =
                (BooleanCommand) sessionFactory.getRemotingClient().invokeToGroup(serverUrl, new StatsCommand(0, item));
        if (resp != null) {
            System.out.println(resp.getErrorMsg());
        }
        sessionFactory.shutdown();
    }
View Full Code Here


            String masterUrl = this.slaveZooKeeper.getMasterServerUrl();
            for (int i = 0; i < 3; i++) {
                try {
                    BooleanCommand resp =
                            (BooleanCommand) this.sessionFactory.getRemotingClient().invokeToGroup(masterUrl,
                                new StatsCommand(OpaqueGenerator.getNextOpaque(), "config"));
                    if (resp.getResponseStatus() == ResponseStatus.NO_ERROR) {
                        this.tryReloadConfig(resp);
                        break;
                    }
                    else {
View Full Code Here

    public StatsResult getStats(String item, long timeout) {
        StatsResult statsResult = new StatsResult(this.serverUrl);
        try {
            BooleanCommand resp =
                    (BooleanCommand) this.remotingClient.invokeToGroup(this.serverUrl,
                        new StatsCommand(OpaqueGenerator.getNextOpaque(), item), timeout, TimeUnit.MILLISECONDS);

            final String resultStr = resp.getErrorMsg();

            switch (resp.getCode()) {
            case HttpStatus.Success: {
View Full Code Here

                if (!group.equals(Constants.DEFAULT_GROUP)) {
                    URI uri = new URI(group);
                    InetSocketAddress sockAddr = new InetSocketAddress(uri.getHost(), uri.getPort());
                    if (target == null || target.equals(sockAddr)) {
                        BooleanCommand resp =
                                (BooleanCommand) this.remotingClient.invokeToGroup(group, new StatsCommand(
                                    OpaqueGenerator.getNextOpaque(), item), STATS_OPTIMEOUT, TimeUnit.MILLISECONDS);
                        if (resp.getResponseStatus() == ResponseStatus.NO_ERROR) {
                            String body = resp.getErrorMsg();
                            if (body != null) {
                                this.parseStatsValues(sockAddr, rt, group, body);
View Full Code Here

TOP

Related Classes of com.taobao.metamorphosis.network.StatsCommand

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.