protected void assertKey(SourceRecord record, String pkField, int pk) { VerifyRecord.hasValidKey(record, pkField, pk); }
/** * Verify that the given {@link SourceRecord} is a {@link Operation#CREATE INSERT/CREATE} record, and that the integer key * matches the expected value. * * @param record the source record; may not be null * @param pkField the single field defining the primary key of the struct; may not be null * @param pk the expected integer value of the primary key in the struct */ public static void isValidInsert(SourceRecord record, String pkField, int pk) { hasValidKey(record, pkField, pk); isValidInsert(record, true); }
/** * Verify that the given {@link SourceRecord} is a {@link Operation#DELETE DELETE} record, and that the integer key * matches the expected value. * * @param record the source record; may not be null * @param pkField the single field defining the primary key of the struct; may not be null * @param pk the expected integer value of the primary key in the struct */ public static void isValidDelete(SourceRecord record, String pkField, int pk) { hasValidKey(record, pkField, pk); isValidDelete(record, true); }
/** * Verify that the given {@link SourceRecord} is a {@link Operation#UPDATE UPDATE} record, and that the integer key * matches the expected value. * * @param record the source record; may not be null * @param pkField the single field defining the primary key of the struct; may not be null * @param pk the expected integer value of the primary key in the struct */ public static void isValidUpdate(SourceRecord record, String pkField, int pk) { hasValidKey(record, pkField, pk); isValidUpdate(record, true); }
/** * Verify that the given {@link SourceRecord} is a valid tombstone, meaning it has a valid non-null key with key schema * but null value and value schema. * * @param record the source record; may not be null * @param pkField the single field defining the primary key of the struct; may not be null * @param pk the expected integer value of the primary key in the struct */ public static void isValidTombstone(SourceRecord record, String pkField, int pk) { hasValidKey(record, pkField, pk); isValidTombstone(record); }
/** * Verify that the given {@link SourceRecord} is a {@link Operation#CREATE READ} record, and that the integer key * matches the expected value. * * @param record the source record; may not be null * @param pkField the single field defining the primary key of the struct; may not be null * @param pk the expected integer value of the primary key in the struct */ public static void isValidRead(SourceRecord record, String pkField, int pk) { hasValidKey(record, pkField, pk); isValidRead(record); }
protected void assertKey(SourceRecord record, String pkField, int pk) { VerifyRecord.hasValidKey(record, pkField, pk); }