Skip to content

Commit a967527

Browse files
committed
Fixing logging
1 parent a6a9072 commit a967527

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

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

+8-6
Original file line numberDiff line numberDiff line change
@@ -1616,32 +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+
long total = System.currentTimeMillis();
16191620
StringBuilder message = new StringBuilder();
16201621
Stopwatch stopWatch = Stopwatch.createStarted();
16211622

1622-
message.append("get_table_objects_by_name_req: req=" + req.toString() + "\n");
1623+
message.append("get_table_objects_by_name_req: req=" + req.toString() + ", ");
16231624
DatabaseMapping mapping = databaseMappingService.databaseMapping(req.getDbName());
1624-
message.append(" databaseMapping took:" + stopWatch.elapsed().toMillis() + "\n");
1625+
message.append("DatabaseMapping took:" + stopWatch.elapsed().toMillis() + ", ");
16251626
stopWatch.reset().start();
16261627

16271628
List<String> filteredTables = databaseMappingService.filterTables(req.getDbName(), req.getTblNames(), mapping);
16281629
req.setTblNames(filteredTables);
1629-
message.append(" filtered tables 1st call took: " + stopWatch.elapsed().toMillis() + "\n");
1630+
message.append("Filtered tables 1st call took: " + stopWatch.elapsed().toMillis() + ", ");
16301631
stopWatch.reset().start();
16311632

16321633
GetTablesResult result = mapping
16331634
.getClient()
16341635
.get_table_objects_by_name_req(mapping.transformInboundGetTablesRequest(req));
1635-
message.append(" HMS call took: " + stopWatch.elapsed().toMillis() + "\n");
1636+
message.append("HMS call took: " + stopWatch.elapsed().toMillis() + ", ");
16361637
stopWatch.reset().start();
16371638

16381639
result.setTables(mapping.getMetastoreFilter().filterTables(result.getTables()));
1639-
message.append(" filtered tables 2nd call took: " + stopWatch.elapsed().toMillis() + "\n");
1640+
message.append("Filtered tables 2nd call took: " + stopWatch.elapsed().toMillis() + ", ");
16401641
stopWatch.reset().start();
16411642

16421643
GetTablesResult getTablesResult = mapping.transformOutboundGetTablesResult(result);
1643-
message.append(" transform outbound took: " + stopWatch.elapsed().toMillis() + "\n");
1644+
message.append("Transform outbound took: " + stopWatch.elapsed().toMillis()+", ");
16441645
stopWatch.stop();
1646+
message.append("Total get_table_objects_by_name_req took: " + (System.currentTimeMillis() - total));
16451647
LOG.error(message.toString());
16461648
return getTablesResult;
16471649
}

0 commit comments

Comments
 (0)