question: private void fetchMetadata ( TableMapLogEvent tableEvent ) throws SQLException , ReplicatorException { if ( metadataCache == null ) metadataCache = new TableMetadataCache ( 5000 ) ; Table table = metadataCache . retrieve ( tableEvent . getDatabaseName ( ) , tableEvent . getTableName ( ) ) ; if ( table == null || table . getTableId ( ) != tableEvent . getTableId ( ) ) { prepareMetadataConnection ( ) ; table = metadataConnection . findTable ( tableEvent . getDatabaseName ( ) , tableEvent . getTableName ( ) , false ) ; if ( table != null ) { table . setTableId ( tableEvent . getTableId ( ) ) ; metadataCache . store ( table ) ; } } else if ( logger . isDebugEnabled ( ) ) logger . debug ( "Table " + tableEvent . getDatabaseName ( ) + "." + tableEvent . getTableName ( ) + " found in cache." ) ; if ( table == null ) { logger . warn ( "No metadata found for table " + tableEvent . getDatabaseName ( ) + "." + tableEvent . getTableName ( ) ) ; } else { tableEvent . setTable ( table ) ; } }
target:  Fetches metadata for the table from the cache or from the database if needed