Package org.mc4j.ems.connection.bean.operation

Examples of org.mc4j.ems.connection.bean.operation.EmsOperation$Impact


              Event event = new Event(getEventType(),
                ((String)notifHash.get(NOTIFICATION_TYPE)),
                timestamp,
                EventSeverity.WARN,
                ((String)notifHash.get(NOTIFICATION_MESSAGE)));
              EmsOperation clear = emsbean.getOperation(CLEAR_ALERT_OPERATION);
              clear.invoke();
              events.add(event);
            }
           }
         } catch (Exception e) {
           e.printStackTrace();
View Full Code Here


        Class[] emptyParams = new Class[0];

        if (log.isDebugEnabled()) {
            log.debug("Disabling thrift...");
        }
        EmsOperation operation = storageService.getOperation("stopRPCServer", emptyParams);
        operation.invoke((Object[]) emptyParams);

        if (log.isDebugEnabled()) {
            log.debug("Disabling gossip...");
        }
        operation = storageService.getOperation("stopGossiping", emptyParams);
        operation.invoke((Object[]) emptyParams);

        if (log.isDebugEnabled()) {
            log.debug("Initiating drain...");
        }
        operation = storageService.getOperation("drain", emptyParams);
        operation.invoke((Object[]) emptyParams);

        return stopNode();
    }
View Full Code Here

        OperationResult result = null;

        try {
            EmsBean detailComponent = getEmsConnection().getBean(beanName);

            EmsOperation operation = detailComponent.getOperation(name);

            Object obj = operation.invoke(new Object[] {});

            if (obj != null) {
                result = new OperationResult();
                result.getComplexResults().put(
                    new PropertySimple(OperationResult.SIMPLE_OPERATION_RESULT_NAME, String.valueOf(obj)));
View Full Code Here

        log.info("Taking snapshot of keyspace [" + keyspace + "]");
        log.info("Snapshot name set to [" + snapshotName + "]");
        long start = System.currentTimeMillis();
        EmsBean emsBean = loadBean(KeyspaceService.STORAGE_SERVICE_BEAN);
        if (columnFamilies == null || columnFamilies.length == 0) {
            EmsOperation operation = emsBean.getOperation("takeSnapshot", String.class, String[].class);
            operation.invoke(snapshotName, new String[]{keyspace});
        } else {
            EmsOperation operation = emsBean.getOperation("takeColumnFamilySnapshot", String.class, String.class,
                String.class);

            for (String columnFamily : columnFamilies) {
                if (log.isDebugEnabled()) {
                    log.debug("Taking snapshot of column family [" + columnFamily + "]");
                }
                operation.invoke(keyspace, columnFamily, snapshotName);
            }
        }

        long end = System.currentTimeMillis();
        log.info("Finished taking snapshot of keyspace [" + keyspace + "] in " + (end - start) + " ms");
View Full Code Here

        this.emsConnection = emsConnection;
    }

    public void repair(String keyspace, String... columnFamilies) {
        EmsBean emsBean = loadBean(STORAGE_SERVICE_BEAN);
        EmsOperation operation = emsBean.getOperation(REPAIR_OPERATION, String.class, boolean.class,
            boolean.class, String[].class);

        //  The isSequential param has to be false; otherwise, repair will fail as a result
        // of https://issues.apache.org/jira/browse/CASSANDRA-5512.
        boolean isSequential = false// perform sequential repair using snapshot

        boolean isLocal = true;        // local to data center

        operation.invoke(keyspace, isSequential, isLocal, columnFamilies);
    }
View Full Code Here

        operation.invoke(keyspace, isSequential, isLocal, columnFamilies);
    }

    public void repairPrimaryRange(String keyspace, String... columnFamilies) {
        EmsBean emsBean = loadBean(KeyspaceService.STORAGE_SERVICE_BEAN);
        EmsOperation operation = emsBean.getOperation(REPAIR_PRIMARY_RANGE, String.class, boolean.class, boolean.class,
            String[].class);

        //  The isSequential param has to be false; otherwise, repair will fail as a result
        // of https://issues.apache.org/jira/browse/CASSANDRA-5512.
        boolean isSequential = false// perform sequential repair using snapshot

        boolean isLocal = true;        // local to data center

        operation.invoke(keyspace, isSequential, isLocal, columnFamilies);
    }
View Full Code Here

        operation.invoke(keyspace, isSequential, isLocal, columnFamilies);
    }

    public void cleanup(String keyspace) {
        EmsBean emsBean = loadBean(STORAGE_SERVICE_BEAN);
        EmsOperation operation = emsBean.getOperation(CLEANUP_OPERATION, String.class, String[].class);

        operation.invoke(keyspace, new String[] {});
    }
View Full Code Here

        operation.invoke(keyspace, new String[] {});
    }

    public void compact(String keyspace, String... columnFamilies) {
        EmsBean emsBean = loadBean(STORAGE_SERVICE_BEAN);
        EmsOperation operation = emsBean.getOperation(COMPACT_OPERATION, String.class, String[].class);

        operation.invoke(keyspace, columnFamilies);
    }
View Full Code Here

        takeSnapshot(new String[]{keyspace}, snapshotName);
    }

    public void takeSnapshot(String[] keySpaces, String snapshotName) {
        EmsBean emsBean = loadBean(STORAGE_SERVICE_BEAN);
        EmsOperation operation = emsBean.getOperation(SNAPSHOT_OPERATION, String.class, String[].class);
        operation.invoke(snapshotName, keySpaces);
    }
View Full Code Here

        return super.invokeOperation(name, parameters);
    }

    private OperationResult takeSnapshot(Configuration parameters) {
        EmsBean emsBean = getEmsBean();
        EmsOperation operation = emsBean.getOperation("takeSnapshot", String.class, String[].class);
        String snapshotName = parameters.getSimpleValue("snapshotName");
        if (snapshotName == null || snapshotName.trim().isEmpty()) {
            snapshotName = System.currentTimeMillis() + "";
        }

        operation.invoke(snapshotName, new String[] {});

        return new OperationResult();
    }
View Full Code Here

TOP

Related Classes of org.mc4j.ems.connection.bean.operation.EmsOperation$Impact

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.