exceptionfactory commented on code in PR #10053: URL: https://github.com/apache/nifi/pull/10053#discussion_r2241515503
########## nifi-extension-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/kinesis/property/FlowFileHandlingOnSchemaChangeStrategy.java: ########## @@ -0,0 +1,49 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.nifi.processors.aws.kinesis.property; + +import org.apache.nifi.components.DescribedValue; + +public enum FlowFileHandlingOnSchemaChangeStrategy implements DescribedValue { Review Comment: Recommend shortening this to something like `SchemaDifferenceHandlingStrategy`. ########## nifi-extension-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/kinesis/property/FlowFileHandlingOnSchemaChangeStrategy.java: ########## @@ -0,0 +1,49 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.nifi.processors.aws.kinesis.property; + +import org.apache.nifi.components.DescribedValue; + +public enum FlowFileHandlingOnSchemaChangeStrategy implements DescribedValue { + ROLL_FLOW_FILES("Roll FlowFile", "Create a new FlowFile for each record with a different schema. The previous FlowFile will be completed with the records that have the previous schema. Emitted" + + " FlowFiles will contain continuous record sequences."), + GROUP_FLOW_FILES("Group FlowFiles", "Group records with the same schema into a single FlowFile. If a record with a different schema is encountered, a new FlowFile will be created for the new" + Review Comment: This name does not quite fit the behavior, since it is grouping Records, instead of FlowFiles. The description is clear, so perhaps something like `Group Records By Schema`. ########## nifi-extension-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/kinesis/stream/record/statehandlerstrategy/StateHandlerStrategy.java: ########## @@ -0,0 +1,72 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.nifi.processors.aws.kinesis.stream.record.statehandlerstrategy; + +import org.apache.nifi.schema.access.SchemaNotFoundException; +import org.apache.nifi.serialization.record.Record; +import org.apache.nifi.serialization.record.RecordSchema; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +public abstract class StateHandlerStrategy<State, ActionContext, FinalizeException extends Throwable> { Review Comment: The level of abstraction with the multiple generic types is a bit difficult to follow on initial read. The nested interfaces also seems to make this more complicated than necessary. Instead of having this abstract class and minimal implementations, it seems more straightforward to have a single class with a conditional for the minor difference in handling. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
