Search in sources :

Example 51 with JsonIgnore

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

the class FeedLineage method serialize.

@JsonIgnore
private void serialize(Feed feed) {
    if (feed.getDependentFeeds() != null) {
        Set<String> ids = new HashSet<>();
        Set<Feed> dependentFeeds = new HashSet<>(feed.getDependentFeeds());
        feed.setDependentFeeds(null);
        dependentFeeds.stream().forEach(depFeed -> {
            feedMap.put(depFeed.getId(), depFeed);
            ids.add(depFeed.getId());
            if (depFeed.getDependentFeeds() != null) {
                serialize(depFeed);
            }
        });
        feed.setDependentFeedIds(ids);
    }
    if (feed.getUsedByFeeds() != null) {
        Set<String> ids = new HashSet<>();
        Set<Feed> usedByFeeds = new HashSet<>(feed.getUsedByFeeds());
        feed.getUsedByFeeds().clear();
        usedByFeeds.stream().forEach(depFeed -> {
            feedMap.put(depFeed.getId(), depFeed);
            ids.add(depFeed.getId());
            if (depFeed.getUsedByFeeds() != null) {
                serialize(depFeed);
            }
        });
        feed.setUsedByFeedIds(ids);
    }
    if (feed.getSources() != null) {
        feed.getSources().forEach(feedSource -> {
            Datasource ds = serializeDatasource(feedSource.getDatasource());
            feedSource.setDatasource(null);
            if (StringUtils.isBlank(feedSource.getDatasourceId())) {
                feedSource.setDatasourceId(ds != null ? ds.getId() : null);
            }
        });
    }
    if (feed.getDestinations() != null) {
        feed.getDestinations().forEach(feedDestination -> {
            Datasource ds = serializeDatasource(feedDestination.getDatasource());
            feedDestination.setDatasource(null);
            if (StringUtils.isBlank(feedDestination.getDatasourceId())) {
                feedDestination.setDatasourceId(ds != null ? ds.getId() : null);
            }
        });
    }
    feedMap.put(feed.getId(), feed);
}
Also used : Datasource(com.thinkbiganalytics.metadata.rest.model.data.Datasource) HashSet(java.util.HashSet) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Example 52 with JsonIgnore

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

the class TableSetup method updateFieldStringData.

@JsonIgnore
public void updateFieldStringData() {
    StringBuffer fieldsString = new StringBuffer();
    StringBuffer nullableFieldsString = new StringBuffer();
    StringBuffer primaryKeyFieldsString = new StringBuffer();
    if (tableSchema != null && tableSchema.getFields() != null) {
        for (Field field : tableSchema.getFields()) {
            setStringBuffer(fieldsString, field.getName(), "\n");
            if (field.isNullable()) {
                setStringBuffer(nullableFieldsString, field.getName(), ",");
            }
            if (field.isPrimaryKey()) {
                setStringBuffer(primaryKeyFieldsString, field.getName(), ",");
            }
        }
    }
    setFieldsString(fieldsString.toString());
    setNullableFields(nullableFieldsString.toString());
    setPrimaryKeyFields(primaryKeyFieldsString.toString());
}
Also used : DefaultField(com.thinkbiganalytics.discovery.model.DefaultField) MetadataField(com.thinkbiganalytics.metadata.MetadataField) Field(com.thinkbiganalytics.discovery.schema.Field) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Example 53 with JsonIgnore

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

the class TableSetup method updateFieldIndexString.

@JsonIgnore
public void updateFieldIndexString() {
    StringBuffer sb = new StringBuffer();
    if (tableSchema != null && tableSchema.getFields() != null && fieldPolicies != null) {
        int idx = 0;
        for (FieldPolicy field : fieldPolicies) {
            if (field.isIndex() && StringUtils.isNotBlank(sb.toString())) {
                sb.append(",");
            }
            if (field.isIndex()) {
                sb.append(tableSchema.getFields().get(idx).getName());
            }
            idx++;
        }
    }
    fieldIndexString = sb.toString();
}
Also used : FieldPolicy(com.thinkbiganalytics.policy.rest.model.FieldPolicy) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Example 54 with JsonIgnore

use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore in project topcom-cloud by 545314690.

the class Group method getRoleNames.

@JsonIgnore
public Set<String> getRoleNames() {
    Set<String> roleNames = new HashSet();
    Set<Role> roles = this.getRoles();
    if (roles != null) {
        Iterator var3 = roles.iterator();
        while (var3.hasNext()) {
            Role role = (Role) var3.next();
            roleNames.add(role.getName());
        }
    }
    return roleNames;
}
Also used : Iterator(java.util.Iterator) HashSet(java.util.HashSet) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Example 55 with JsonIgnore

use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore in project topcom-cloud by 545314690.

the class Role method getPermissions.

@JsonIgnore
public Set<String> getPermissions() {
    Set<String> permissions = new HashSet();
    Set<Resource> resources = this.getResources();
    if (resources != null) {
        Iterator var3 = resources.iterator();
        while (var3.hasNext()) {
            Resource resource = (Resource) var3.next();
            permissions.add(resource.getPermission());
        }
    }
    return permissions;
}
Also used : Iterator(java.util.Iterator) HashSet(java.util.HashSet) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Aggregations

JsonIgnore (com.fasterxml.jackson.annotation.JsonIgnore)113 lombok.val (lombok.val)14 ArrayList (java.util.ArrayList)12 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