use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore in project Gaffer by gchq.
the class NamedOperationDetail method getOperationChainWithDefaultParams.
/**
* Gets the OperationChain after adding in default values for any parameters. If a parameter
* does not have a default, null is inserted.
*
* @return The {@link OperationChain}
* @throws IllegalArgumentException if substituting the parameters fails
*/
@JsonIgnore
public OperationChain getOperationChainWithDefaultParams() {
String opStringWithDefaults = operations;
if (null != parameters) {
for (final Map.Entry<String, ParameterDetail> parameterDetailPair : parameters.entrySet()) {
String paramKey = parameterDetailPair.getKey();
try {
opStringWithDefaults = opStringWithDefaults.replace(buildParamNameString(paramKey), new String(JSONSerialiser.serialise(parameterDetailPair.getValue().getDefaultValue(), CHARSET_NAME), CHARSET_NAME));
} catch (final SerialisationException | UnsupportedEncodingException e) {
throw new IllegalArgumentException(e.getMessage());
}
}
}
OperationChain opChain;
try {
opChain = JSONSerialiser.deserialise(opStringWithDefaults.getBytes(CHARSET_NAME), OperationChainDAO.class);
} catch (final Exception e) {
throw new IllegalArgumentException(e.getMessage());
}
return opChain;
}
use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore in project Gaffer by gchq.
the class NamedOperation method getOperations.
@Override
@JsonIgnore
public List<Operation> getOperations() {
final List<Operation> operations = new ArrayList<>();
if (null != parameters) {
for (final Map.Entry<String, Object> parameterDetailPair : parameters.entrySet()) {
Object paramValue = parameterDetailPair.getValue();
if (paramValue instanceof Operation) {
Operation operation = (Operation) paramValue;
operations.add(operation);
}
}
}
return operations;
}
use of org.apache.flink.shaded.jackson2.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 org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore in project Gaffer by gchq.
the class SchemaElementDefinition method createFullAggregator.
@JsonIgnore
private synchronized void createFullAggregator() {
if (null == fullAggregatorCache) {
// NB Need to check if fullAggregatorCache is null again as there may be two calls to createFullAggregator
// in sequence and we don't want to repeat the work of creating the aggregator
fullAggregatorCache = new ElementAggregator();
if (aggregate) {
if (null != aggregator) {
fullAggregatorCache.getComponents().addAll(aggregator.getComponents());
}
final Set<String> aggregatorProperties = getAggregatorProperties();
for (final Entry<String, String> entry : getPropertyMap().entrySet()) {
if (!aggregatorProperties.contains(entry.getKey())) {
addTypeAggregateFunction(fullAggregatorCache, entry.getKey(), entry.getValue());
}
}
}
fullAggregatorCache.lock();
}
}
use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore in project Gaffer by gchq.
the class SchemaElementDefinition method createIngestAggregator.
@JsonIgnore
private synchronized void createIngestAggregator() {
if (null == ingestAggregatorCache) {
// NB Need to check if ingestAggregatorCache is null again as there may be two calls to createIngestAggregator
// in sequence and we don't want to repeat the work of creating the aggregator
ingestAggregatorCache = new ElementAggregator();
if (aggregate) {
final Set<String> aggregatorProperties = getAggregatorProperties();
if (null != aggregator) {
for (final TupleAdaptedBinaryOperator<String, ?> component : aggregator.getComponents()) {
final String[] selection = component.getSelection();
if (selection.length == 1 && !groupBy.contains(selection[0]) && !selection[0].equals(schemaReference.getVisibilityProperty())) {
ingestAggregatorCache.getComponents().add(component);
} else if (!CollectionUtil.containsAny(groupBy, selection)) {
ingestAggregatorCache.getComponents().add(component);
}
}
}
for (final Entry<String, String> entry : getPropertyMap().entrySet()) {
if (!aggregatorProperties.contains(entry.getKey())) {
if (!groupBy.contains(entry.getKey()) && !entry.getKey().equals(schemaReference.getVisibilityProperty())) {
addTypeAggregateFunction(ingestAggregatorCache, entry.getKey(), entry.getValue());
}
}
}
}
ingestAggregatorCache.lock();
}
}
Aggregations