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 <mattyb149@apache.org>
This commit is contained in:
Mark Payne 2017-07-13 10:22:28 -04:00 committed by Matt Burgess
parent 5c48655e69
commit a9529adab1
1 changed files with 5 additions and 5 deletions

View File

@ -41,7 +41,6 @@ import org.apache.nifi.repository.schema.SimpleRecordField;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.wali.SerDe; import org.wali.SerDe;
import org.wali.UpdateType;
public class SchemaRepositoryRecordSerde extends RepositoryRecordSerde implements SerDe<RepositoryRecord> { public class SchemaRepositoryRecordSerde extends RepositoryRecordSerde implements SerDe<RepositoryRecord> {
private static final Logger logger = LoggerFactory.getLogger(SchemaRepositoryRecordSerde.class); 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 Record record = (Record) updateRecord.getFieldValue(RepositoryRecordSchema.REPOSITORY_RECORD_UPDATE_V2);
final String actionType = (String) record.getFieldValue(RepositoryRecordSchema.ACTION_TYPE_FIELD); final String actionType = (String) record.getFieldValue(RepositoryRecordSchema.ACTION_TYPE_FIELD);
final UpdateType updateType = UpdateType.valueOf(actionType); final RepositoryRecordType recordType = RepositoryRecordType.valueOf(actionType);
switch (updateType) { switch (recordType) {
case CREATE: case CREATE:
return createRecord(record); return createRecord(record);
case CONTENTMISSING:
case DELETE: case DELETE:
return deleteRecord(record); return deleteRecord(record);
case SWAP_IN: case SWAP_IN:
@ -135,9 +135,9 @@ public class SchemaRepositoryRecordSerde extends RepositoryRecordSerde implement
return swapOutRecord(record); return swapOutRecord(record);
case UPDATE: case UPDATE:
return updateRecord(record); return updateRecord(record);
default:
throw new IOException("Found unrecognized Update Type '" + actionType + "'");
} }
throw new IOException("Found unrecognized Update Type '" + actionType + "'");
} }