Skip to content

Commit

Permalink
Merge getViews and getTables GlueApiStats
Browse files Browse the repository at this point in the history
  • Loading branch information
homar authored and losipiuk committed Feb 22, 2022
1 parent 1f7a537 commit 6293d52
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ public List<String> getAllViews(String databaseName)
.withDatabaseName(databaseName),
GetTablesRequest::setNextToken,
GetTablesResult::getNextToken,
stats.getGetAllViews())
stats.getGetTables())
.map(GetTablesResult::getTableList)
.flatMap(List::stream)
.filter(table -> VIRTUAL_VIEW.name().equals(table.getTableType()))
Expand Down Expand Up @@ -921,10 +921,10 @@ private List<Partition> batchGetPartition(Table table, List<String> partitionNam
for (List<PartitionValueList> partitions : Lists.partition(pendingPartitions, BATCH_GET_PARTITION_MAX_PAGE_SIZE)) {
long startTimestamp = System.currentTimeMillis();
batchGetPartitionFutures.add(glueClient.batchGetPartitionAsync(new BatchGetPartitionRequest()
.withCatalogId(catalogId)
.withDatabaseName(table.getDatabaseName())
.withTableName(table.getTableName())
.withPartitionsToGet(partitions),
.withCatalogId(catalogId)
.withDatabaseName(table.getDatabaseName())
.withTableName(table.getTableName())
.withPartitionsToGet(partitions),
new StatsRecordingAsyncHandler(stats.getGetPartitions(), startTimestamp)));
}
pendingPartitions.clear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ public class GlueMetastoreStats
private final GlueMetastoreApiStats getDatabase = new GlueMetastoreApiStats();
private final GlueMetastoreApiStats getTables = new GlueMetastoreApiStats();
private final GlueMetastoreApiStats getTable = new GlueMetastoreApiStats();
private final GlueMetastoreApiStats getAllViews = new GlueMetastoreApiStats();
private final GlueMetastoreApiStats createDatabase = new GlueMetastoreApiStats();
private final GlueMetastoreApiStats deleteDatabase = new GlueMetastoreApiStats();
private final GlueMetastoreApiStats updateDatabase = new GlueMetastoreApiStats();
Expand Down Expand Up @@ -93,13 +92,6 @@ public GlueMetastoreApiStats getGetTable()
return getTable;
}

@Managed
@Nested
public GlueMetastoreApiStats getGetAllViews()
{
return getAllViews;
}

@Managed
@Nested
public GlueMetastoreApiStats getCreateDatabase()
Expand Down

0 comments on commit 6293d52

Please sign in to comment.