Skip to content

Commit 37d3aa4

Browse files
authored
NIFI-15049 Adjusted ExecuteSQL to use static List of Descriptors and Set of Relationships (#10381)
Signed-off-by: David Handermann <[email protected]>
1 parent 5d7d067 commit 37d3aa4

File tree

1 file changed

+26
-21
lines changed
  • nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard

1 file changed

+26
-21
lines changed

nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ExecuteSQL.java

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import org.apache.nifi.flowfile.FlowFile;
3434
import org.apache.nifi.processor.ProcessContext;
3535
import org.apache.nifi.processor.ProcessSession;
36+
import org.apache.nifi.processor.Relationship;
3637
import org.apache.nifi.processor.util.StandardValidators;
3738
import org.apache.nifi.processors.standard.sql.DefaultAvroSqlWriter;
3839
import org.apache.nifi.processors.standard.sql.SqlWriter;
@@ -142,28 +143,32 @@ public class ExecuteSQL extends AbstractExecuteSQL {
142143
.required(true)
143144
.build();
144145

146+
private static final List<PropertyDescriptor> PROPERTY_DESCRIPTORS = List.of(
147+
DBCP_SERVICE,
148+
SQL_PRE_QUERY,
149+
SQL_QUERY,
150+
SQL_POST_QUERY,
151+
QUERY_TIMEOUT,
152+
NORMALIZE_NAMES_FOR_AVRO,
153+
USE_AVRO_LOGICAL_TYPES,
154+
COMPRESSION_FORMAT,
155+
DEFAULT_PRECISION,
156+
DEFAULT_SCALE,
157+
MAX_ROWS_PER_FLOW_FILE,
158+
OUTPUT_BATCH_SIZE,
159+
FETCH_SIZE,
160+
AUTO_COMMIT,
161+
CONTENT_OUTPUT_STRATEGY
162+
);
163+
164+
private static final Set<Relationship> RELATIONSHIPS = Set.of(
165+
REL_SUCCESS,
166+
REL_FAILURE
167+
);
168+
145169
public ExecuteSQL() {
146-
relationships = Set.of(
147-
REL_SUCCESS,
148-
REL_FAILURE
149-
);
150-
propDescriptors = List.of(
151-
DBCP_SERVICE,
152-
SQL_PRE_QUERY,
153-
SQL_QUERY,
154-
SQL_POST_QUERY,
155-
QUERY_TIMEOUT,
156-
NORMALIZE_NAMES_FOR_AVRO,
157-
USE_AVRO_LOGICAL_TYPES,
158-
COMPRESSION_FORMAT,
159-
DEFAULT_PRECISION,
160-
DEFAULT_SCALE,
161-
MAX_ROWS_PER_FLOW_FILE,
162-
OUTPUT_BATCH_SIZE,
163-
FETCH_SIZE,
164-
AUTO_COMMIT,
165-
CONTENT_OUTPUT_STRATEGY
166-
);
170+
relationships = RELATIONSHIPS;
171+
propDescriptors = PROPERTY_DESCRIPTORS;
167172
}
168173

169174
@Override

0 commit comments

Comments
 (0)