Search in sources :

Example 16 with JsonIgnore

use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore in project streamline by hortonworks.

the class BaseTopologyRule method getRule.

@JsonIgnore
public final Rule getRule() throws IOException {
    ObjectMapper mapper = new ObjectMapper();
    Rule rule = mapper.readValue(getParsedRuleStr(), Rule.class);
    if (rule.getId() == null) {
        rule.setId(getId());
    }
    return rule;
}
Also used : Rule(com.hortonworks.streamline.streams.layout.component.rule.Rule) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Example 17 with JsonIgnore

use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore in project streamline by hortonworks.

the class MLModel method getPrimaryKey.

@JsonIgnore
@Override
public PrimaryKey getPrimaryKey() {
    Map<Field, Object> fieldObjectMap = new HashMap<>();
    fieldObjectMap.put(new Schema.Field(ID, Type.LONG), this.id);
    return new PrimaryKey(fieldObjectMap);
}
Also used : Field(com.hortonworks.registries.common.Schema.Field) HashMap(java.util.HashMap) Schema(com.hortonworks.registries.common.Schema) PrimaryKey(com.hortonworks.registries.storage.PrimaryKey) Field(com.hortonworks.registries.common.Schema.Field) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Example 18 with JsonIgnore

use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore in project streamline by hortonworks.

the class TopologyComponent method setConfigData.

@JsonIgnore
public void setConfigData(String configData) throws Exception {
    if (!StringUtils.isEmpty(configData)) {
        ObjectMapper mapper = new ObjectMapper();
        config = mapper.readValue(configData, Config.class);
    }
}
Also used : Config(com.hortonworks.streamline.common.Config) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Example 19 with JsonIgnore

use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore in project streamline by hortonworks.

the class TopologyStream method setFieldsData.

// for internal storage, not part of JSON
@JsonIgnore
public void setFieldsData(String fieldsData) throws Exception {
    if (fieldsData == null || fieldsData.isEmpty()) {
        return;
    }
    ObjectMapper mapper = new ObjectMapper();
    fields = mapper.readValue(fieldsData, new TypeReference<List<Field>>() {
    });
}
Also used : Field(com.hortonworks.registries.common.Schema.Field) TypeReference(com.fasterxml.jackson.core.type.TypeReference) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Example 20 with JsonIgnore

use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore in project registry by hortonworks.

the class AbstractStorable method getSchema.

/**
 * Default implementation that will generate schema by reading all the field names in the class and use its
 * define type to convert to the Schema type.
 *
 * @return the schema
 */
@JsonIgnore
public Schema getSchema() {
    Map<String, Class> fieldNamesToTypes = ReflectionHelper.getFieldNamesToTypes(this.getClass());
    List<Schema.Field> fields = new ArrayList<>();
    for (Map.Entry<String, Class> entry : fieldNamesToTypes.entrySet()) {
        try {
            getField(entry.getKey(), entry.getValue()).ifPresent(field -> {
                fields.add(field);
                LOG.trace("getSchema: Adding {}", field);
            });
        } catch (NoSuchFieldException | NoSuchMethodException | InvocationTargetException | IllegalAccessException | ParserException e) {
            throw new StorageException(e);
        }
    }
    return Schema.of(fields);
}
Also used : ParserException(com.hortonworks.registries.common.exception.ParserException) ArrayList(java.util.ArrayList) InvocationTargetException(java.lang.reflect.InvocationTargetException) Field(java.lang.reflect.Field) HashMap(java.util.HashMap) Map(java.util.Map) StorageException(com.hortonworks.registries.storage.exception.StorageException) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Aggregations

JsonIgnore (com.fasterxml.jackson.annotation.JsonIgnore)111 lombok.val (lombok.val)14 ArrayList (java.util.ArrayList)11 HashMap (java.util.HashMap)8 Map (java.util.Map)8 HashSet (java.util.HashSet)7 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)5 Date (java.util.Date)5 Field (com.hortonworks.registries.common.Schema.Field)4 Set (java.util.Set)4 Schema (com.hortonworks.registries.common.Schema)3 PrimaryKey (com.hortonworks.registries.storage.PrimaryKey)3 EntitlementException (com.sun.identity.entitlement.EntitlementException)3 PolicyException (com.sun.identity.policy.PolicyException)3 JsonArray (io.vertx.core.json.JsonArray)3 List (java.util.List)3 SequenceFile (ca.corefacility.bioinformatics.irida.model.sequenceFile.SequenceFile)2 TrustAndKeyProvider (com.codingchili.core.security.TrustAndKeyProvider)2 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)2 TypeReference (com.fasterxml.jackson.core.type.TypeReference)2