private static BinlogEventV4 formUDataEvent(long tableId,int eventType,List<MySqlValue> oldValueList,List<MySqlValue> newValueList){
  Preconditions.checkArgument(oldValueList.size() == newValueList.size(),"Size of Old List and New List should be the same..");
  BinlogEventV4HeaderImpl eventV4Header=new BinlogEventV4HeaderImpl();
  eventV4Header.setTimestamp(System.currentTimeMillis());
  eventV4Header.setEventType(eventType);
  eventV4Header.setServerId(1);
  if (eventType == MySQLConstants.UPDATE_ROWS_EVENT_V2) {
    UpdateRowsEventV2 updateRowsEventV2=new UpdateRowsEventV2(eventV4Header);
    updateRowsEventV2.setTableId(tableId);
    updateRowsEventV2.setRows(getRowPairs(oldValueList,newValueList));
    return updateRowsEventV2;
  }
 else   if (eventType == MySQLConstants.UPDATE_ROWS_EVENT) {
    UpdateRowsEvent updateRowsEvent=new UpdateRowsEvent(eventV4Header);
    updateRowsEvent.setTableId(tableId);
    updateRowsEvent.setRows(getRowPairs(oldValueList,newValueList));
    return updateRowsEvent;
  }
  return null;
}

private static BinlogEventV4 formUDataEvent ( long tableId , int eventType , List < MySqlValue > oldValueList , List < MySqlValue > newValueList ) { Preconditions . checkArgument ( oldValueList . size ( ) == newValueList . size ( ) , "Size of Old List and New List should be the same.." ) ; BinlogEventV4HeaderImpl eventV4Header = new BinlogEventV4HeaderImpl ( ) ; eventV4Header . setTimestamp ( System . currentTimeMillis ( ) ) ; eventV4Header . setEventType ( eventType ) ; eventV4Header . setServerId ( 1 ) ; if ( eventType == MySQLConstants . UPDATE_ROWS_EVENT_V2 ) { UpdateRowsEventV2 updateRowsEventV2 = new UpdateRowsEventV2 ( eventV4Header ) ; updateRowsEventV2 . setTableId ( tableId ) ; updateRowsEventV2 . setRows ( getRowPairs ( oldValueList , newValueList ) ) ; return updateRowsEventV2 ; } else if ( eventType == MySQLConstants . UPDATE_ROWS_EVENT ) { UpdateRowsEvent updateRowsEvent = new UpdateRowsEvent ( eventV4Header ) ; updateRowsEvent . setTableId ( tableId ) ; updateRowsEvent . setRows ( getRowPairs ( oldValueList , newValueList ) ) ; return updateRowsEvent ; } return null ; }
this creates the data event based on the parameters passed . update only .
