use of org.apache.nifi.schema.access.SchemaField in project nifi by apache.
the class SchemaRegistryService method getSuppliedSchemaFields.
protected Set<SchemaField> getSuppliedSchemaFields(final ValidationContext validationContext) {
final String accessStrategyValue = validationContext.getProperty(getSchemaAcessStrategyDescriptor()).getValue();
final SchemaRegistry schemaRegistry = validationContext.getProperty(SCHEMA_REGISTRY).asControllerService(SchemaRegistry.class);
final SchemaAccessStrategy accessStrategy = getSchemaAccessStrategy(accessStrategyValue, schemaRegistry, validationContext);
if (accessStrategy == null) {
return EnumSet.noneOf(SchemaField.class);
}
final Set<SchemaField> suppliedFields = accessStrategy.getSuppliedSchemaFields();
return suppliedFields;
}
use of org.apache.nifi.schema.access.SchemaField in project nifi by apache.
the class SchemaRegistryRecordSetWriter method getRequiredSchemaFields.
protected Set<SchemaField> getRequiredSchemaFields(final ValidationContext validationContext) {
final String writeStrategyValue = validationContext.getProperty(getSchemaWriteStrategyDescriptor()).getValue();
final SchemaAccessWriter writer = getSchemaWriteStrategy(writeStrategyValue);
if (writer == null) {
return EnumSet.noneOf(SchemaField.class);
}
final Set<SchemaField> requiredFields = writer.getRequiredSchemaFields();
return requiredFields;
}
Aggregations