protected Operation getOperation ( KuduTable table , int op ) throws UnsupportedOperationException { Operation operation = null ; switch ( op ) { case OperationType . INSERT_CODE : operation = table . newInsert ( ) ; break ; case OperationType . UPSERT_CODE : operation = table . newUpsert ( ) ; break ; case OperationType . UPDATE_CODE : operation = table . newUpdate ( ) ; break ; case OperationType . DELETE_CODE : operation = table . newDelete ( ) ; break ; default : LOG . error ( "Operation {} not supported" , op ) ; throw new UnsupportedOperationException ( String . format ( "Unsupported Operation: %s" , op ) ) ; } return operation ; }
Return Operation based on the operation code . If the code has a number that Kudu destination doesn t support it throws UnsupportedOperationException .