Skip to content

Commit 52181af

Browse files
committed
Replace deprecated method calls
1 parent b02e4f9 commit 52181af

File tree

9 files changed

+17
-17
lines changed

9 files changed

+17
-17
lines changed

core/trino-main/src/main/java/io/trino/execution/scheduler/faulttolerant/BinPackingNodeAllocatorService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public class BinPackingNodeAllocatorService
114114
private final DataSize eagerSpeculativeTasksNodeMemoryOvercommit;
115115
private final Ticker ticker;
116116

117-
private final ConcurrentNavigableMap<QueryId, Deque<PendingAcquire>> pendingAcquires = new ConcurrentSkipListMap<>(Ordering.natural().onResultOf(QueryId::getId));
117+
private final ConcurrentNavigableMap<QueryId, Deque<PendingAcquire>> pendingAcquires = new ConcurrentSkipListMap<>(Ordering.natural().onResultOf(QueryId::id));
118118
private final Set<BinPackingNodeLease> fulfilledAcquires = newConcurrentHashSet();
119119
private final Duration allowedNoMatchingNodePeriod;
120120
private final Duration exhaustedNodeWaitPeriod;

core/trino-main/src/test/java/io/trino/execution/TestMemoryRevokingScheduler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ private SqlTask newSqlTask(QueryId queryId)
268268
{
269269
QueryContext queryContext = getOrCreateQueryContext(queryId);
270270

271-
TaskId taskId = new TaskId(new StageId(queryId.getId(), 0), idGenerator.incrementAndGet(), 0);
271+
TaskId taskId = new TaskId(new StageId(queryId.id(), 0), idGenerator.incrementAndGet(), 0);
272272
URI location = URI.create("fake://task/" + taskId);
273273

274274
return createSqlTask(

core/trino-main/src/test/java/io/trino/server/TestBasicQueryInfo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ public void testConstructor()
165165
false,
166166
new NodeVersion("test")));
167167

168-
assertThat(basicInfo.getQueryId().getId()).isEqualTo("0");
168+
assertThat(basicInfo.getQueryId().id()).isEqualTo("0");
169169
assertThat(basicInfo.getState()).isEqualTo(RUNNING);
170170
assertThat(basicInfo.isScheduled()).isTrue(); // from query stats
171171
assertThat(basicInfo.getQuery()).isEqualTo("SELECT 4");

core/trino-main/src/test/java/io/trino/server/remotetask/TestHttpRemoteTask.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ public void testOutboundDynamicFilters()
448448
// make sure initial dynamic filter is collected
449449
CompletableFuture<?> future = dynamicFilter.isBlocked();
450450
dynamicFilterService.addTaskDynamicFilters(
451-
new TaskId(new StageId(queryId.getId(), 1), 1, 0),
451+
new TaskId(new StageId(queryId.id(), 1), 1, 0),
452452
ImmutableMap.of(filterId1, Domain.singleValue(BIGINT, 1L)));
453453
future.get();
454454
assertThat(dynamicFilter.getCurrentPredicate()).isEqualTo(TupleDomain.withColumnDomains(ImmutableMap.of(
@@ -474,7 +474,7 @@ public void testOutboundDynamicFilters()
474474

475475
future = dynamicFilter.isBlocked();
476476
dynamicFilterService.addTaskDynamicFilters(
477-
new TaskId(new StageId(queryId.getId(), 1), 1, 0),
477+
new TaskId(new StageId(queryId.id(), 1), 1, 0),
478478
ImmutableMap.of(filterId2, Domain.singleValue(BIGINT, 2L)));
479479
future.get();
480480
assertThat(dynamicFilter.getCurrentPredicate()).isEqualTo(TupleDomain.withColumnDomains(ImmutableMap.of(

plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/BaseIcebergMaterializedViewTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,7 @@ public void testMaterializedViewSnapshotSummariesHaveTrinoQueryId()
764764
.executeWithPlan(getSession(), format("REFRESH MATERIALIZED VIEW %s", materializedViewName))
765765
.queryId();
766766
String savedQueryId = getStorageTableMetadata(materializedViewName).currentSnapshot().summary().get("trino_query_id");
767-
assertThat(savedQueryId).isEqualTo(refreshQueryId.getId());
767+
assertThat(savedQueryId).isEqualTo(refreshQueryId.id());
768768
}
769769
finally {
770770
assertUpdate("DROP TABLE " + sourceTableName);

plugin/trino-ranger/src/main/java/io/trino/plugin/ranger/RangerSystemAccessControl.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ public void checkCanSetUser(Optional<Principal> principal, String userName)
176176
@Override
177177
public void checkCanExecuteQuery(Identity identity, QueryId queryId)
178178
{
179-
if (!hasPermission(RangerTrinoResource.forQueryId(queryId.getId()), identity, queryId, EXECUTE, "ExecuteQuery")) {
179+
if (!hasPermission(RangerTrinoResource.forQueryId(queryId.id()), identity, queryId, EXECUTE, "ExecuteQuery")) {
180180
denyExecuteQuery();
181181
}
182182
}
@@ -916,22 +916,22 @@ private RangerTrinoAccessRequest createAccessRequest(RangerTrinoResource resourc
916916

917917
private Optional<String> getClientAddress(QueryId queryId)
918918
{
919-
return queryId != null ? eventListener.getClientAddress(queryId.getId()) : Optional.empty();
919+
return queryId != null ? eventListener.getClientAddress(queryId.id()) : Optional.empty();
920920
}
921921

922922
private Optional<String> getClientType(QueryId queryId)
923923
{
924-
return queryId != null ? eventListener.getClientType(queryId.getId()) : Optional.empty();
924+
return queryId != null ? eventListener.getClientType(queryId.id()) : Optional.empty();
925925
}
926926

927927
private Optional<String> getQueryText(QueryId queryId)
928928
{
929-
return queryId != null ? eventListener.getQueryText(queryId.getId()) : Optional.empty();
929+
return queryId != null ? eventListener.getQueryText(queryId.id()) : Optional.empty();
930930
}
931931

932932
private Optional<Instant> getQueryTime(QueryId queryId)
933933
{
934-
return queryId != null ? eventListener.getQueryTime(queryId.getId()) : Optional.empty();
934+
return queryId != null ? eventListener.getQueryTime(queryId.id()) : Optional.empty();
935935
}
936936

937937
private Optional<String> getClientAddress(SystemSecurityContext context)

testing/trino-testing/src/main/java/io/trino/testing/BaseFailureRecoveryTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -613,12 +613,12 @@ private ExecutionResult execute(Session session, String query, Optional<String>
613613
String queryId = null;
614614
try {
615615
resultWithPlan = getDistributedQueryRunner().executeWithPlan(withTraceToken(session, traceToken), resolveTableName(query, tableName));
616-
queryId = resultWithPlan.queryId().getId();
616+
queryId = resultWithPlan.queryId().id();
617617
}
618618
catch (RuntimeException e) {
619619
failure = e;
620620
if (e instanceof QueryFailedException queryFailedException) {
621-
queryId = queryFailedException.getQueryId().getId();
621+
queryId = queryFailedException.getQueryId().id();
622622
}
623623
}
624624

testing/trino-tests/src/test/java/io/trino/execution/TestQueryCompletedEvent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,6 @@ private static void assertQueryCompletedIssued(StandaloneQueryRunner queryRunner
8686
assertThat(query.getState()).isEqualTo(FINISHED);
8787
assertEventually(() -> assertThat(queryCompletedQueryIds)
8888
.describedAs("query '%s'", sql)
89-
.contains(result.queryId().getId()));
89+
.contains(result.queryId().id()));
9090
}
9191
}

testing/trino-tests/src/test/java/io/trino/memory/TestClusterMemoryLeakDetector.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@ public void testLeakDetector()
5050
assertThat(leakDetector.getNumberOfLeakedQueries()).isEqualTo(0);
5151

5252
// the leak detector should report no leaked queries as the query is still running
53-
leakDetector.checkForMemoryLeaks(() -> ImmutableList.of(createQueryInfo(testQuery.getId(), RUNNING)), ImmutableMap.of(testQuery, 1L));
53+
leakDetector.checkForMemoryLeaks(() -> ImmutableList.of(createQueryInfo(testQuery.id(), RUNNING)), ImmutableMap.of(testQuery, 1L));
5454
assertThat(leakDetector.getNumberOfLeakedQueries()).isEqualTo(0);
5555

5656
// the leak detector should report exactly one leaked query since the query is finished, and its end time is way in the past
57-
leakDetector.checkForMemoryLeaks(() -> ImmutableList.of(createQueryInfo(testQuery.getId(), FINISHED)), ImmutableMap.of(testQuery, 1L));
57+
leakDetector.checkForMemoryLeaks(() -> ImmutableList.of(createQueryInfo(testQuery.id(), FINISHED)), ImmutableMap.of(testQuery, 1L));
5858
assertThat(leakDetector.getNumberOfLeakedQueries()).isEqualTo(1);
5959

6060
// the leak detector should report no leaked queries as the query doesn't have any memory reservation
61-
leakDetector.checkForMemoryLeaks(() -> ImmutableList.of(createQueryInfo(testQuery.getId(), FINISHED)), ImmutableMap.of(testQuery, 0L));
61+
leakDetector.checkForMemoryLeaks(() -> ImmutableList.of(createQueryInfo(testQuery.id(), FINISHED)), ImmutableMap.of(testQuery, 0L));
6262
assertThat(leakDetector.getNumberOfLeakedQueries()).isEqualTo(0);
6363

6464
// the leak detector should report exactly one leaked query since the coordinator doesn't know of any query

0 commit comments

Comments
 (0)