Examples of EmsConnection


Examples of org.mc4j.ems.connection.EmsConnection

        return emsConnection;
    }

    @Override
    public AvailabilityType getAvailability() {
        EmsConnection connection = getEmsConnection();
        if (connection == null) {
            return DOWN;
        }
        if (!hasApplicationMBeans()) {
            LOG.warn("Found no MBeans with query '" + beansQueryString + "'");
View Full Code Here

Examples of org.mc4j.ems.connection.EmsConnection

    private OperationResult decommission() {
        log.info("Decommissioning " + getResourceContext().getResourceKey());

        OperationResult result = new OperationResult();
        try {
            EmsConnection emsConnection = getEmsConnection();
            EmsBean storageService = emsConnection.getBean("org.apache.cassandra.db:type=StorageService");

            EmsAttribute operationModeAttr = storageService.getAttribute("OperationMode");
            String operationMode = (String) operationModeAttr.refresh();
            if (operationMode.equals("DECOMMISSIONED")) {
                log.info("The storage node " + getHost() + " is already decommissioned.");
View Full Code Here

Examples of org.mc4j.ems.connection.EmsConnection

                        "Failed. A copy of the file can be found at " + configEditor.getBackupFile() + ". See the " +
                        "agent logs for more details");
                }
            }

            EmsConnection emsConnection = getEmsConnection();
            EmsBean storageService = emsConnection.getBean("org.apache.cassandra.db:type=StorageService");
            EmsAttribute attribute = storageService.getAttribute("OperationMode");
            String operationMode = (String) attribute.refresh();

            if (!operationMode.equals("NORMAL")) {
                result.setErrorMessage("Bootstrapping " + getHost() + " failed. The StorageService is reporting " +
View Full Code Here

Examples of org.mc4j.ems.connection.EmsConnection

                            "Failed. A copy of the file can be found at " + configEditor.getBackupFile() + ". See the " +
                            "agent logs for more details");
                }
            }

            EmsConnection emsConnection = getEmsConnection();
            EmsBean storageService = emsConnection.getBean("org.apache.cassandra.db:type=StorageService");
            EmsAttribute attribute = storageService.getAttribute("OperationMode");
            String operationMode = (String) attribute.refresh();

            if (!operationMode.equals("NORMAL")) {
                result.setErrorMessage("Bootstrapping " + getHost() + " failed. The StorageService is reporting " +
View Full Code Here

Examples of org.mc4j.ems.connection.EmsConnection

            throw new InternodeAuthConfUpdateException("An error occurred while trying to update " + authFile, e);
        }
    }

    String getOperationMode() {
        EmsConnection emsConnection = getEmsConnection();
        EmsBean storageService = emsConnection.getBean("org.apache.cassandra.db:type=StorageService");
        EmsAttribute attribute = storageService.getAttribute("OperationMode");

        return (String) attribute.refresh();
    }
View Full Code Here

Examples of org.mc4j.ems.connection.EmsConnection

    private OperationResult performTopologyChangeMaintenance(Configuration params) {
        boolean runRepair = params.getSimple("runRepair").getBooleanValue();
        boolean updateSeedsList = params.getSimple("updateSeedsList").getBooleanValue();

        EmsConnection emsConnection = getEmsConnection();
        KeyspaceService keyspaceService = new KeyspaceService(emsConnection);
        boolean hasErrors = false;
        OperationResult result = new OperationResult();
        Configuration resultConfig = result.getComplexResults();
        PropertyList resultsList = new PropertyList("results");
View Full Code Here

Examples of org.mc4j.ems.connection.EmsConnection

        }
        return result;
    }

    private OperationResult prepareForUpgrade(Configuration parameters) throws Exception {
        EmsConnection emsConnection = getEmsConnection();
        EmsBean storageService = emsConnection.getBean("org.apache.cassandra.db:type=StorageService");
        Class<?>[] emptyParams = new Class<?>[0];

        if (log.isDebugEnabled()) {
            log.debug("Disabling native transport...");
        }
View Full Code Here

Examples of org.mc4j.ems.connection.EmsConnection

    }

    private void waitForTaskToComplete(int initialWaiting, int maxTries, int sleepMillis) throws InterruptedException {
        // initial waiting
        Thread.sleep(initialWaiting);
        EmsConnection emsConnection = getEmsConnection();
        EmsBean flushWriterBean = emsConnection.getBean("org.apache.cassandra.internal:type=FlushWriter");
        EmsAttribute attribute = flushWriterBean.getAttribute("PendingTasks");

        Long valueObject = (Long) attribute.refresh();
        // wait until org.apache.cassandra.internal:type=FlushWriter / PendingTasks == 0
        while (valueObject > 0 && maxTries-- > 0) {
View Full Code Here

Examples of org.mc4j.ems.connection.EmsConnection

            return AvailabilityType.DOWN;
        }
    }

    private File getServerHome() throws Exception {
        EmsConnection connection = loadConnection();
        EmsBean bean = connection.getBean("jboss.system:type=ServerConfig");
        File serverHomeViaJnp;
        EmsAttribute serverHomeDirAttrib = bean.getAttribute("ServerHomeDir");
        if (serverHomeDirAttrib != null) {
            serverHomeViaJnp = (File) serverHomeDirAttrib.refresh();
        } else {
View Full Code Here

Examples of org.mc4j.ems.connection.EmsConnection

                int delimIndex = name.lastIndexOf(':');
                String beanName = name.substring(0, delimIndex);
                String attributeName = name.substring(delimIndex + 1);
                try {
                    // Bean is cached by EMS, so no problem with getting the bean from the connection on each call
                    EmsConnection emsConnection = loadConnection();
                    EmsBean bean = emsConnection.getBean(beanName);
                    EmsAttribute attribute = bean.getAttribute(attributeName);

                    Object valueObject = attribute.refresh();
                    if (valueObject instanceof Number) {
                        Number value = (Number) valueObject;
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.