use of org.apache.flink.shaded.jackson2.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;
}
}
use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore in project OpenAM by OpenRock.
the class PolicyCondition method getPolicyCondition.
/**
* Constructs a legacy policy {@link Condition} object based on the information contained in this adapter.
*
* @return the legacy policy condition.
* @throws EntitlementException if an error occurs constructing the condition.
*/
@JsonIgnore
public Condition getPolicyCondition() throws EntitlementException {
try {
Condition cond = Class.forName(className).asSubclass(Condition.class).newInstance();
cond.setProperties(properties);
return cond;
} catch (ClassNotFoundException cnfe) {
throw new EntitlementException(UNKNOWN_POLICY_CLASS, new String[] { className }, cnfe);
} catch (ClassCastException cce) {
throw new EntitlementException(POLICY_CLASS_CAST_EXCEPTION, new String[] { className, Condition.class.getName() }, cce);
} catch (InstantiationException ie) {
throw new EntitlementException(POLICY_CLASS_NOT_INSTANTIABLE, new String[] { className }, ie);
} catch (IllegalAccessException iae) {
throw new EntitlementException(POLICY_CLASS_NOT_ACCESSIBLE, new String[] { className }, iae);
} catch (PolicyException pe) {
throw new EntitlementException(INVALID_PROPERTY_VALUE_UNKNOWN_VALUE, new String[] { className }, pe);
}
}
use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore in project OpenAM by OpenRock.
the class PolicyResponseProvider method getResponseProvider.
/**
* Constructs a legacy response provider based on the information in this adapter.
*
* @return the legacy response provider
* @throws EntitlementException if an error occurs constructing the response provider.
*/
@JsonIgnore
public ResponseProvider getResponseProvider() throws EntitlementException {
try {
ResponseProvider rp = Class.forName(className).asSubclass(ResponseProvider.class).newInstance();
Map<String, Set<String>> properties = new HashMap<String, Set<String>>();
properties.put(propertyName, propertyValues);
rp.setProperties(properties);
return rp;
} catch (Exception ex) {
throw new EntitlementException(510, ex);
}
}
use of org.apache.flink.shaded.jackson2.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);
}
}
use of org.apache.flink.shaded.jackson2.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;
}
Aggregations