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;
}
}
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));
}
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;
}
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;
}
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);
}
}
Aggregations