Examples of EmsAttribute


Examples of org.mc4j.ems.connection.bean.attribute.EmsAttribute

        for (MeasurementScheduleRequest request : metrics) {

            String metricName = request.getName();
            try {
                EmsAttribute atribute = detailComponent.getAttribute(metricName);

                Object value = atribute.refresh();

                if (value != null)
                    if (request.getDataType() == DataType.MEASUREMENT) {
                        Double number = ((Number) value).doubleValue();
                        report.addData(new MeasurementDataNumeric(request, number));
View Full Code Here

Examples of org.mc4j.ems.connection.bean.attribute.EmsAttribute

        return new OperationResult();
    }

    public PropertyList getKeySpaceDataFileLocations() {
        EmsBean emsBean = loadBean(KeyspaceService.STORAGE_SERVICE_BEAN);
        EmsAttribute attribute = emsBean.getAttribute("AllDataFileLocations");

        PropertyList list = new PropertyList("keyspaceFileLocations");
        String[] dirs = (String[]) attribute.getValue();
        for (String dir : dirs) {
            if (!dir.endsWith("/")) {
                dir = dir + "/";
            }
View Full Code Here

Examples of org.mc4j.ems.connection.bean.attribute.EmsAttribute

        return list;
    }

    public PropertySimple getCommitLogProperty() {
        EmsBean emsBean = loadBean(KeyspaceService.STORAGE_SERVICE_BEAN);
        EmsAttribute attribute = emsBean.getAttribute("CommitLogLocation");
        return new PropertySimple("CommitLogLocation", attribute.refresh());
    }
View Full Code Here

Examples of org.mc4j.ems.connection.bean.attribute.EmsAttribute

        operation.invoke(snapshotName, keySpaces);
    }

    public String[] getKeySpaceDataFileLocations() {
        EmsBean emsBean = loadBean(KeyspaceService.STORAGE_SERVICE_BEAN);
        EmsAttribute attribute = emsBean.getAttribute("AllDataFileLocations");
        return (String[]) attribute.getValue();
    }
View Full Code Here

Examples of org.mc4j.ems.connection.bean.attribute.EmsAttribute

    public List<Object> getKeyspaces() {
        List<Object> value = null;

        EmsBean emsBean = loadBean(STORAGE_SERVICE_BEAN);
        if (emsBean != null) {
            EmsAttribute attribute = emsBean.getAttribute("Keyspaces");
            if (attribute != null) {
                value = (List<Object>) attribute.refresh();
            }
        }
        if (value == null) {
            value = new ArrayList<Object>();
        }
View Full Code Here

Examples of org.mc4j.ems.connection.bean.attribute.EmsAttribute

                return DOWN;
            }

            AvailabilityType availability = UP;

            EmsAttribute nativeTransportEnabledAttr = emsBean.getAttribute("NativeTransportRunning");
            Boolean nativeTransportEnabled = (Boolean) nativeTransportEnabledAttr.getValue();

            if (!nativeTransportEnabled) {
                if (log.isWarnEnabled()) {
                    log.warn("Native transport is disabled for " + context.getResourceKey());
                }
                availability = DOWN;
            }

            EmsAttribute initializedAttr = emsBean.getAttribute("Initialized");
            Boolean initialized = (Boolean) initializedAttr.getValue();

            if (!initialized) {
                if (log.isWarnEnabled()) {
                    log.warn(context.getResourceKey() + " is not initialized");
                }
View Full Code Here

Examples of org.mc4j.ems.connection.bean.attribute.EmsAttribute

    @Override
    protected void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> requests, EmsBean bean) {
        super.getValues(report, requests, bean);

        EmsAttribute loadAttribute = bean.getAttribute(LOAD_NAME);
        Object loadValue = loadAttribute.refresh();

        EmsAttribute dataFileLocationAttribute = bean.getAttribute(DATA_FILE_LOCATIONS_NAME);
        Object dataFileLocationValue = dataFileLocationAttribute.refresh();

        double load = 0;
        if (loadValue != null && dataFileLocationValue != null && dataFileLocationValue instanceof String[]) {
            //Please visit for details: https://issues.apache.org/jira/browse/CASSANDRA-2749
            //The average usage of all partitions with the data will be reported.
            //Cassandra selects the partition with most free space for SStable flush and compaction.
            load = Double.parseDouble(loadValue.toString());
            load = load / 1024d; //transform in MB
        }

        for (MeasurementScheduleRequest request : requests) {
            if (OWNERSHIP_METRIC_NAME.equals(request.getName()) && host != null) {
                EmsAttribute attribute = bean.getAttribute(OWNERSHIP_METRIC_NAME);
                Object valueObject = attribute.refresh();
                if (valueObject instanceof Map<?, ?>) {
                    @SuppressWarnings("unchecked")
                    Map<InetAddress, Float> ownership = (Map<InetAddress, Float>) valueObject;
                    Float value = ownership.get(host);
                    if (value == null) {
View Full Code Here

Examples of org.mc4j.ems.connection.bean.attribute.EmsAttribute

            .getResourceConfigurationDefinition();

        for (PropertyDefinition propertyDefinition : resourceConfigurationDefinition.getPropertyDefinitions().values()) {
            if (propertyDefinition instanceof PropertyDefinitionList) {

                EmsAttribute attribute = getEmsBean().getAttribute(propertyDefinition.getName());

                if (attribute != null) {
                    Object result = attribute.refresh();

                    PropertyList propertyList = new PropertyList(propertyDefinition.getName());

                    if (result instanceof Map) {
                        PropertyDefinitionMap propertyDefinitionMap = (PropertyDefinitionMap) ((PropertyDefinitionList) propertyDefinition)
View Full Code Here

Examples of org.mc4j.ems.connection.bean.attribute.EmsAttribute

                EmsConnection conn = parentServer.getEmsConnection();
                EmsBean eBean = conn.getBean(bean);
                if (eBean != null) {
                    List<String> attrs = new ArrayList<String>();
                    eBean.refreshAttributes(attrs); // only refresh selecte attrs, as there might be non-serializable ones
                    EmsAttribute eAttr = eBean.getAttribute(attr);
                    if (metric.getDataType() == DataType.MEASUREMENT) {
                        Double val = ((Number) (eAttr.getValue())).doubleValue();

                        MeasurementDataNumeric ret = new MeasurementDataNumeric(metric, val);
                        report.addData(ret);
                    } else if (metric.getDataType() == DataType.TRAIT) {
                        MeasurementDataTrait ret = new MeasurementDataTrait(metric, String.valueOf(eAttr.getValue()));
                        report.addData(ret);
                    } else
                        log.warn("Unknown data type " + metric);
                } else if (log.isDebugEnabled())
                    log.debug("Bean " + bean + " not found ");
View Full Code Here

Examples of org.mc4j.ems.connection.bean.attribute.EmsAttribute

                    EmsBean eBean = getEmsConnection().getBean(m.group(1));

                    List<String> attributes = new ArrayList<String>(1);
                    attributes.add(m.group(2));
                    eBean.refreshAttributes(attributes);
                    EmsAttribute emsAtt = eBean.getAttribute(m.group(2));
                    Object value = emsAtt.getValue();
                    if ((request.getDataType() == DataType.MEASUREMENT) && (value instanceof Number)) {
                        report.addData(new MeasurementDataNumeric(request, ((Number) value).doubleValue()));
                    } else if (request.getDataType() == DataType.TRAIT) {
                        String displayValue = null;
                        if ((value != null) && value.getClass().isArray()) {
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.