private static BinlogEventV4 formBinLogTableMapEvent(String dbName,String tableName,long tableId){
  BinlogEventV4HeaderImpl tableMapEventHeader=new BinlogEventV4HeaderImpl();
  tableMapEventHeader.setTimestamp(System.currentTimeMillis());
  tableMapEventHeader.setEventType(MySQLConstants.TABLE_MAP_EVENT);
  tableMapEventHeader.setServerId(1);
  TableMapEvent tableMapEvent=new TableMapEvent(tableMapEventHeader);
  tableMapEvent.setTableId(tableId);
  tableMapEvent.setDatabaseNameLength(dbName.length());
  tableMapEvent.setDatabaseName(StringColumn.valueOf(dbName.getBytes()));
  tableMapEvent.setTableNameLength(tableName.length());
  tableMapEvent.setTableName(StringColumn.valueOf(tableName.getBytes()));
  return tableMapEvent;
}

private static BinlogEventV4 formBinLogTableMapEvent ( String dbName , String tableName , long tableId ) { BinlogEventV4HeaderImpl tableMapEventHeader = new BinlogEventV4HeaderImpl ( ) ; tableMapEventHeader . setTimestamp ( System . currentTimeMillis ( ) ) ; tableMapEventHeader . setEventType ( MySQLConstants . TABLE_MAP_EVENT ) ; tableMapEventHeader . setServerId ( 1 ) ; TableMapEvent tableMapEvent = new TableMapEvent ( tableMapEventHeader ) ; tableMapEvent . setTableId ( tableId ) ; tableMapEvent . setDatabaseNameLength ( dbName . length ( ) ) ; tableMapEvent . setDatabaseName ( StringColumn . valueOf ( dbName . getBytes ( ) ) ) ; tableMapEvent . setTableNameLength ( tableName . length ( ) ) ; tableMapEvent . setTableName ( StringColumn . valueOf ( tableName . getBytes ( ) ) ) ; return tableMapEvent ; }
the second bin log event of a transaction is always a table map event
