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