DBZ-1464 Fixed NPE when op is not u/i/d
Signed-off-by: Lev Zemlyanov <lev@confluent.io>
This commit is contained in:
parent
e595b1f530
commit
8cbb8eb63b
@ -94,6 +94,10 @@ public RecordsForCollection forCollection(CollectionId collectionId) {
|
||||
});
|
||||
}
|
||||
|
||||
public static boolean isValidOperation(String operation) {
|
||||
return operationLiterals.containsKey(operation);
|
||||
}
|
||||
|
||||
/**
|
||||
* A record producer for a given collection.
|
||||
*/
|
||||
|
@ -544,6 +544,11 @@ protected boolean handleOplogEvent(ServerAddress primaryAddress, Document event)
|
||||
}
|
||||
return true;
|
||||
}
|
||||
if (!RecordMakers.isValidOperation(event.getString("op"))) {
|
||||
// the op is not insert/update/delete
|
||||
logger.debug("Skipping event with \"op={}\"", event.getString("op"));
|
||||
return true;
|
||||
}
|
||||
int delimIndex = ns.indexOf('.');
|
||||
if (delimIndex > 0) {
|
||||
assert (delimIndex + 1) < ns.length();
|
||||
|
Loading…
Reference in New Issue
Block a user