jdbc-protolib/src/main/java/com/streamsets/pipeline/lib/jdbc/JdbcRecordReader.java
int getOperationFromRecord(
      Record record,
      int defaultOpCode,
      UnsupportedOperationAction unsupportedAction,
      List<OnRecordErrorException> errorRecords
  ) {
    String op = record.getHeader().getAttribute(OperationType.SDC_OPERATION_TYPE);
    int opCode = -1; // unsupported

    if (Strings.isNullOrEmpty(op)) {
      return defaultOpCode;
    }

    // Check if the operation code from header attribute is valid
    try {
      opCode = JDBCOperationType.convertToIntCode(op);
    } catch (NumberFormatException | UnsupportedOperationException ex) {
      LOG.debug(
          "Operation obtained from record is not supported. Handle by UnsupportedOperationAction {}. {}",
          unsupportedAction.getLabel(),
          ex
      );
      switch (unsupportedAction) {
        case SEND_TO_ERROR:
          LOG.debug("Sending record to error due to unsupported operation {}", op);
          errorRecords.add(new OnRecordErrorException(record, JdbcErrors.JDBC_70, op));
          break;
        case USE_DEFAULT:
          opCode = defaultOpCode;
          break;
        case DISCARD:
        default: // unknown action
          LOG.debug("Discarding record with unsupported operation {}", op);
      }
    }
    return opCode;
  }
int getOperationFromRecord(
      Record record,
      int defaultOpCode,
      UnsupportedOperationAction unsupportedAction,
      List<OnRecordErrorException> errorRecords
  ) {
    String op = record.getHeader().getAttribute(OperationType.SDC_OPERATION_TYPE);
    int opCode = -1; // unsupported

    if (Strings.isNullOrEmpty(op)) {
      return defaultOpCode;
    }

    // Check if the operation code from header attribute is valid
    try {
      opCode = JDBCOperationType.convertToIntCode(op);
    } catch (NumberFormatException | UnsupportedOperationException ex) {
      LOG.debug(
          "Operation obtained from record is not supported. Handle by UnsupportedOperationAction {}. {}",
          unsupportedAction.getLabel(),
          ex
      );
      switch (unsupportedAction) {
        case SEND_TO_ERROR:
          LOG.debug("Sending record to error due to unsupported operation {}", op);
          errorRecords.add(new OnRecordErrorException(record, JdbcErrors.JDBC_70, op));
          break;
        case USE_DEFAULT:
          opCode = defaultOpCode;
          break;
        case DISCARD:
        default: // unknown action
          LOG.debug("Discarding record with unsupported operation {}", op);
      }
    }
    return opCode;
  }
int getOperationFromRecord ( Record record , int defaultOpCode , UnsupportedOperationAction unsupportedAction , List < OnRecordErrorException > errorRecords ) { String op = record . getHeader ( ) . getAttribute ( OperationType . SDC_OPERATION_TYPE ) ; int opCode = - 1 ; // unsupported if ( Strings . isNullOrEmpty ( op ) ) { return defaultOpCode ; } // Check if the operation code from header attribute is valid try { opCode = JDBCOperationType . convertToIntCode ( op ) ; } catch ( NumberFormatException | UnsupportedOperationException ex ) { LOG . debug ( "Operation obtained from record is not supported. Handle by UnsupportedOperationAction {}. {}" , unsupportedAction . getLabel ( ) , ex ) ; switch ( unsupportedAction ) { case SEND_TO_ERROR : LOG . debug ( "Sending record to error due to unsupported operation {}" , op ) ; errorRecords . add ( new OnRecordErrorException ( record , JdbcErrors . JDBC_70 , op ) ) ; break ; case USE_DEFAULT : opCode = defaultOpCode ; break ; case DISCARD : default : // unknown action LOG . debug ( "Discarding record with unsupported operation {}" , op ) ; } } return opCode ; }
Get the numeric operation code from record header. The default code is
used if the operation code is not found in the header. This can be
overwritten in inherited classes.

@param record the record to find the operation code
@param defaultOpCode the default operation code
@param unsupportedAction the action to take for unsupported code
@param errorRecords the list to take error records
@return the numeric operation code or -1 for unsupported operation
Get the numeric operation code from record header . The default code is used if the operation code is not found in the header . This can be overwritten in inherited classes .