Skip to content

Commit

Permalink
remove executor
Browse files Browse the repository at this point in the history
  • Loading branch information
auden-woolfson committed Dec 16, 2024
1 parent b7deffe commit b671d68
Showing 1 changed file with 0 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@
import java.util.NoSuchElementException;
import java.util.Optional;
import java.util.OptionalInt;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import static com.facebook.presto.execution.QueryState.QUEUED;
import static com.facebook.presto.server.QueryStateInfo.createQueryStateInfo;
Expand Down Expand Up @@ -108,7 +106,6 @@ public void getQueryStateInfos(
List<BasicQueryInfo> queryInfos = dispatchManager.getQueries();
Optional<Pattern> userPattern = isNullOrEmpty(user) ? Optional.empty() : Optional.of(Pattern.compile(user));

ExecutorService executor = Executors.newSingleThreadExecutor();
List<QueryStateInfo> queryStateInfos = queryInfos.stream()
.filter(queryInfo -> includeAllQueries || !queryInfo.getState().isDone())
.filter(queryInfo -> userPattern.map(pattern -> pattern.matcher(Slices.utf8Slice(queryInfo.getSession().getUser())).matches()).orElse(true))
Expand All @@ -118,7 +115,6 @@ public void getQueryStateInfos(
excludeResourceGroupPathInfo,
queryTextSizeLimit == null ? OptionalInt.empty() : OptionalInt.of(queryTextSizeLimit)))
.collect(toImmutableList());
executor.shutdown();

asyncResponse.resume(Response.ok(queryStateInfos).build());
}
Expand Down

0 comments on commit b671d68

Please sign in to comment.