31
31
32
32
import com .facebook .fb303 .FacebookBase ;
33
33
import com .facebook .fb303 .fb_status ;
34
- import com .jcabi .aspects .Loggable ;
35
-
34
+ import com .google .common .base .Stopwatch ;
36
35
import com .hotels .bdp .waggledance .conf .WaggleDanceConfiguration ;
37
36
import com .hotels .bdp .waggledance .mapping .model .DatabaseMapping ;
38
37
import com .hotels .bdp .waggledance .mapping .service .MappingEventListener ;
39
38
import com .hotels .bdp .waggledance .mapping .service .impl .NotifyingFederationService ;
40
39
import com .hotels .bdp .waggledance .metrics .Monitored ;
40
+ import com .jcabi .aspects .Loggable ;
41
41
42
42
@ Monitored
43
43
@ Component
@@ -1371,7 +1371,7 @@ public void alter_partitions_with_environment_context(
1371
1371
mapping
1372
1372
.getClient ()
1373
1373
.alter_partitions_with_environment_context (mapping .transformInboundDatabaseName (db_name ), tbl_name ,
1374
- mapping .transformInboundPartitions (new_parts ), environment_context );
1374
+ mapping .transformInboundPartitions (new_parts ), environment_context );
1375
1375
}
1376
1376
1377
1377
@ Override
@@ -1383,7 +1383,7 @@ public void alter_table_with_cascade(String dbname, String tbl_name, Table new_t
1383
1383
mapping
1384
1384
.getClient ()
1385
1385
.alter_table_with_cascade (mapping .transformInboundDatabaseName (dbname ), tbl_name ,
1386
- mapping .transformInboundTable (new_tbl ), cascade );
1386
+ mapping .transformInboundTable (new_tbl ), cascade );
1387
1387
}
1388
1388
1389
1389
@ Override
@@ -1616,14 +1616,34 @@ public GetTableResult get_table_req(GetTableRequest req) throws MetaException, N
1616
1616
@ Loggable (value = Loggable .DEBUG , skipResult = true , name = INVOCATION_LOG_NAME )
1617
1617
public GetTablesResult get_table_objects_by_name_req (GetTablesRequest req )
1618
1618
throws MetaException , InvalidOperationException , UnknownDBException , TException {
1619
+ StringBuilder message = new StringBuilder ();
1620
+ Stopwatch stopWatch = Stopwatch .createStarted ();
1621
+
1622
+ message .append ("get_table_objects_by_name_req: req=" + req .toString () + "\n " );
1619
1623
DatabaseMapping mapping = databaseMappingService .databaseMapping (req .getDbName ());
1624
+ message .append (" databaseMapping took:" + stopWatch .elapsed ().toMillis () + "\n " );
1625
+ stopWatch .reset ().start ();
1626
+
1620
1627
List <String > filteredTables = databaseMappingService .filterTables (req .getDbName (), req .getTblNames (), mapping );
1621
1628
req .setTblNames (filteredTables );
1629
+ message .append (" filtered tables 1st call took: " + stopWatch .elapsed ().toMillis () + "\n " );
1630
+ stopWatch .reset ().start ();
1631
+
1622
1632
GetTablesResult result = mapping
1623
1633
.getClient ()
1624
1634
.get_table_objects_by_name_req (mapping .transformInboundGetTablesRequest (req ));
1635
+ message .append (" HMS call took: " + stopWatch .elapsed ().toMillis () + "\n " );
1636
+ stopWatch .reset ().start ();
1637
+
1625
1638
result .setTables (mapping .getMetastoreFilter ().filterTables (result .getTables ()));
1626
- return mapping .transformOutboundGetTablesResult (result );
1639
+ message .append (" filtered tables 2nd call took: " + stopWatch .elapsed ().toMillis () + "\n " );
1640
+ stopWatch .reset ().start ();
1641
+
1642
+ GetTablesResult getTablesResult = mapping .transformOutboundGetTablesResult (result );
1643
+ message .append (" transform outbound took: " + stopWatch .elapsed ().toMillis () + "\n " );
1644
+ stopWatch .stop ();
1645
+ LOG .error (message .toString ());
1646
+ return getTablesResult ;
1627
1647
}
1628
1648
1629
1649
@ Override
0 commit comments