Skip to content

Commit a6a9072

Browse files
committed
added logging for debugging
1 parent cebb3a9 commit a6a9072

File tree

1 file changed

+25
-5
lines changed

1 file changed

+25
-5
lines changed

waggle-dance-core/src/main/java/com/hotels/bdp/waggledance/server/FederatedHMSHandler.java

+25-5
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@
3131

3232
import com.facebook.fb303.FacebookBase;
3333
import com.facebook.fb303.fb_status;
34-
import com.jcabi.aspects.Loggable;
35-
34+
import com.google.common.base.Stopwatch;
3635
import com.hotels.bdp.waggledance.conf.WaggleDanceConfiguration;
3736
import com.hotels.bdp.waggledance.mapping.model.DatabaseMapping;
3837
import com.hotels.bdp.waggledance.mapping.service.MappingEventListener;
3938
import com.hotels.bdp.waggledance.mapping.service.impl.NotifyingFederationService;
4039
import com.hotels.bdp.waggledance.metrics.Monitored;
40+
import com.jcabi.aspects.Loggable;
4141

4242
@Monitored
4343
@Component
@@ -1371,7 +1371,7 @@ public void alter_partitions_with_environment_context(
13711371
mapping
13721372
.getClient()
13731373
.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);
13751375
}
13761376

13771377
@Override
@@ -1383,7 +1383,7 @@ public void alter_table_with_cascade(String dbname, String tbl_name, Table new_t
13831383
mapping
13841384
.getClient()
13851385
.alter_table_with_cascade(mapping.transformInboundDatabaseName(dbname), tbl_name,
1386-
mapping.transformInboundTable(new_tbl), cascade);
1386+
mapping.transformInboundTable(new_tbl), cascade);
13871387
}
13881388

13891389
@Override
@@ -1616,14 +1616,34 @@ public GetTableResult get_table_req(GetTableRequest req) throws MetaException, N
16161616
@Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME)
16171617
public GetTablesResult get_table_objects_by_name_req(GetTablesRequest req)
16181618
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");
16191623
DatabaseMapping mapping = databaseMappingService.databaseMapping(req.getDbName());
1624+
message.append(" databaseMapping took:" + stopWatch.elapsed().toMillis() + "\n");
1625+
stopWatch.reset().start();
1626+
16201627
List<String> filteredTables = databaseMappingService.filterTables(req.getDbName(), req.getTblNames(), mapping);
16211628
req.setTblNames(filteredTables);
1629+
message.append(" filtered tables 1st call took: " + stopWatch.elapsed().toMillis() + "\n");
1630+
stopWatch.reset().start();
1631+
16221632
GetTablesResult result = mapping
16231633
.getClient()
16241634
.get_table_objects_by_name_req(mapping.transformInboundGetTablesRequest(req));
1635+
message.append(" HMS call took: " + stopWatch.elapsed().toMillis() + "\n");
1636+
stopWatch.reset().start();
1637+
16251638
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;
16271647
}
16281648

16291649
@Override

0 commit comments

Comments
 (0)