Search in sources :

Example 1 with JsonIgnore

use of com.fasterxml.jackson.annotation.JsonIgnore in project druid by druid-io.

the class DataSchema method getParser.

@JsonIgnore
public InputRowParser getParser() {
    if (parser == null) {
        log.warn("No parser has been specified");
        return null;
    }
    final InputRowParser inputRowParser = jsonMapper.convertValue(this.parser, InputRowParser.class);
    final Set<String> dimensionExclusions = Sets.newHashSet();
    for (AggregatorFactory aggregator : aggregators) {
        dimensionExclusions.addAll(aggregator.requiredFields());
        dimensionExclusions.add(aggregator.getName());
    }
    if (inputRowParser.getParseSpec() != null) {
        final DimensionsSpec dimensionsSpec = inputRowParser.getParseSpec().getDimensionsSpec();
        final TimestampSpec timestampSpec = inputRowParser.getParseSpec().getTimestampSpec();
        // exclude timestamp from dimensions by default, unless explicitly included in the list of dimensions
        if (timestampSpec != null) {
            final String timestampColumn = timestampSpec.getTimestampColumn();
            if (!(dimensionsSpec.hasCustomDimensions() && dimensionsSpec.getDimensionNames().contains(timestampColumn))) {
                dimensionExclusions.add(timestampColumn);
            }
        }
        if (dimensionsSpec != null) {
            final Set<String> metSet = Sets.newHashSet();
            for (AggregatorFactory aggregator : aggregators) {
                metSet.add(aggregator.getName());
            }
            final Set<String> dimSet = Sets.newHashSet(dimensionsSpec.getDimensionNames());
            final Set<String> overlap = Sets.intersection(metSet, dimSet);
            if (!overlap.isEmpty()) {
                throw new IAE("Cannot have overlapping dimensions and metrics of the same name. Please change the name of the metric. Overlap: %s", overlap);
            }
            return inputRowParser.withParseSpec(inputRowParser.getParseSpec().withDimensionsSpec(dimensionsSpec.withDimensionExclusions(Sets.difference(dimensionExclusions, dimSet))));
        } else {
            return inputRowParser;
        }
    } else {
        log.warn("No parseSpec in parser has been specified.");
        return inputRowParser;
    }
}
Also used : TimestampSpec(io.druid.data.input.impl.TimestampSpec) DimensionsSpec(io.druid.data.input.impl.DimensionsSpec) InputRowParser(io.druid.data.input.impl.InputRowParser) AggregatorFactory(io.druid.query.aggregation.AggregatorFactory) IAE(io.druid.java.util.common.IAE) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Example 2 with JsonIgnore

use of com.fasterxml.jackson.annotation.JsonIgnore in project ambrose by twitter.

the class CascadingJob method setJobStats.

@JsonIgnore
public void setJobStats(HadoopStepStats stats) {
    Counters counters = new Counters();
    for (String groupName : stats.getCounterGroups()) {
        for (String counterName : stats.getCountersFor(groupName)) {
            Long counterValue = stats.getCounterValue(groupName, counterName);
            counters.findCounter(groupName, counterName).setValue(counterValue);
        }
    }
    setCounterGroupMap(CounterGroup.counterGroupsByName(counters));
}
Also used : Counters(org.apache.hadoop.mapred.Counters) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Example 3 with JsonIgnore

use of com.fasterxml.jackson.annotation.JsonIgnore in project Gaffer by gchq.

the class StoreProperties method getOperationDeclarations.

/**
     * Returns the operation definitions from the file specified in the properties.
     * This is an optional feature, so if the property does not exist then this function
     * will return an empty object.
     *
     * @return The Operation Definitions to load dynamically
     */
@JsonIgnore
public OperationDeclarations getOperationDeclarations() {
    OperationDeclarations declarations = null;
    final String declarationsPaths = get(StoreProperties.OPERATION_DECLARATIONS);
    if (null != declarationsPaths) {
        declarations = OperationDeclarations.fromPaths(declarationsPaths);
    }
    if (null == declarations) {
        declarations = new OperationDeclarations.Builder().build();
    }
    return declarations;
}
Also used : OperationDeclarations(uk.gov.gchq.gaffer.store.operationdeclaration.OperationDeclarations) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Example 4 with JsonIgnore

use of com.fasterxml.jackson.annotation.JsonIgnore in project pulsar by yahoo.

the class LoadReport method getBottleneckResourceType.

@JsonIgnore
public ResourceType getBottleneckResourceType() {
    ResourceType type = ResourceType.CPU;
    double maxUsage = systemResourceUsage.cpu.percentUsage();
    if (systemResourceUsage.memory.percentUsage() > maxUsage) {
        maxUsage = systemResourceUsage.memory.percentUsage();
        type = ResourceType.Memory;
    }
    if (systemResourceUsage.bandwidthIn.percentUsage() > maxUsage) {
        maxUsage = systemResourceUsage.bandwidthIn.percentUsage();
        type = ResourceType.BandwidthIn;
    }
    if (systemResourceUsage.bandwidthOut.percentUsage() > maxUsage) {
        maxUsage = systemResourceUsage.bandwidthOut.percentUsage();
        type = ResourceType.BandwidthOut;
    }
    return type;
}
Also used : ResourceType(com.yahoo.pulsar.common.policies.data.loadbalancer.SystemResourceUsage.ResourceType) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Example 5 with JsonIgnore

use of com.fasterxml.jackson.annotation.JsonIgnore in project OpenAM by OpenRock.

the class PolicySubject method getPolicySubject.

/**
     * Constructs a legacy policy subject based on the information in this adapter.
     *
     * @return the legacy policy subject
     * @throws EntitlementException if an error occurs constructing the subject.
     */
@JsonIgnore
public Subject getPolicySubject() throws EntitlementException {
    try {
        Subject subject = Class.forName(className).asSubclass(Subject.class).newInstance();
        subject.setValues(values);
        return subject;
    } catch (Exception ex) {
        throw new EntitlementException(508, ex);
    }
}
Also used : EntitlementException(com.sun.identity.entitlement.EntitlementException) EntitlementSubject(com.sun.identity.entitlement.EntitlementSubject) Subject(com.sun.identity.policy.interfaces.Subject) JSONException(org.json.JSONException) EntitlementException(com.sun.identity.entitlement.EntitlementException) SSOException(com.iplanet.sso.SSOException) PolicyException(com.sun.identity.policy.PolicyException) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Aggregations

JsonIgnore (com.fasterxml.jackson.annotation.JsonIgnore)15 EntitlementException (com.sun.identity.entitlement.EntitlementException)3 PolicyException (com.sun.identity.policy.PolicyException)3 SSOException (com.iplanet.sso.SSOException)2 File (java.io.File)2 PathFinder (ml.shifu.shifu.fs.PathFinder)2 Path (org.apache.hadoop.fs.Path)2 Counters (org.apache.hadoop.mapred.Counters)2 JSONException (org.json.JSONException)2 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)1 EntitlementSubject (com.sun.identity.entitlement.EntitlementSubject)1 Condition (com.sun.identity.policy.interfaces.Condition)1 ResponseProvider (com.sun.identity.policy.interfaces.ResponseProvider)1 Subject (com.sun.identity.policy.interfaces.Subject)1 ResourceType (com.yahoo.pulsar.common.policies.data.loadbalancer.SystemResourceUsage.ResourceType)1 DimensionsSpec (io.druid.data.input.impl.DimensionsSpec)1 InputRowParser (io.druid.data.input.impl.InputRowParser)1 TimestampSpec (io.druid.data.input.impl.TimestampSpec)1 IAE (io.druid.java.util.common.IAE)1 AggregatorFactory (io.druid.query.aggregation.AggregatorFactory)1