From a9529adab130c3c5a6b9ae4a93cf27c34484b055 Mon Sep 17 00:00:00 2001 From: Mark Payne Date: Thu, 13 Jul 2017 10:22:28 -0400 Subject: [PATCH] NIFI-4093: Fixed bug where we used the wrong Enum to determine how to process an update to the FlowFile Repo Signed-off-by: Matt Burgess --- .../repository/SchemaRepositoryRecordSerde.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-flowfile-repo-serialization/src/main/java/org/apache/nifi/controller/repository/SchemaRepositoryRecordSerde.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-flowfile-repo-serialization/src/main/java/org/apache/nifi/controller/repository/SchemaRepositoryRecordSerde.java index 221f8cebe9..5630bb5786 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-flowfile-repo-serialization/src/main/java/org/apache/nifi/controller/repository/SchemaRepositoryRecordSerde.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-flowfile-repo-serialization/src/main/java/org/apache/nifi/controller/repository/SchemaRepositoryRecordSerde.java @@ -41,7 +41,6 @@ import org.apache.nifi.repository.schema.SimpleRecordField; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.wali.SerDe; -import org.wali.UpdateType; public class SchemaRepositoryRecordSerde extends RepositoryRecordSerde implements SerDe { private static final Logger logger = LoggerFactory.getLogger(SchemaRepositoryRecordSerde.class); @@ -123,10 +122,11 @@ public class SchemaRepositoryRecordSerde extends RepositoryRecordSerde implement final Record record = (Record) updateRecord.getFieldValue(RepositoryRecordSchema.REPOSITORY_RECORD_UPDATE_V2); final String actionType = (String) record.getFieldValue(RepositoryRecordSchema.ACTION_TYPE_FIELD); - final UpdateType updateType = UpdateType.valueOf(actionType); - switch (updateType) { + final RepositoryRecordType recordType = RepositoryRecordType.valueOf(actionType); + switch (recordType) { case CREATE: return createRecord(record); + case CONTENTMISSING: case DELETE: return deleteRecord(record); case SWAP_IN: @@ -135,9 +135,9 @@ public class SchemaRepositoryRecordSerde extends RepositoryRecordSerde implement return swapOutRecord(record); case UPDATE: return updateRecord(record); - default: - throw new IOException("Found unrecognized Update Type '" + actionType + "'"); } + + throw new IOException("Found unrecognized Update Type '" + actionType + "'"); }