Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not ignore unparseable URIs in node management #18251

Merged
merged 1 commit into from
Jul 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import org.weakref.jmx.Nested;

import java.net.URI;
import java.net.URISyntaxException;
import java.util.List;
import java.util.Set;
import java.util.concurrent.ScheduledThreadPoolExecutor;
Expand Down Expand Up @@ -183,11 +182,7 @@ private URI getHttpUri(ServiceDescriptor descriptor)
{
String url = descriptor.getProperties().get(httpsRequired ? "https" : "http");
if (url != null) {
try {
return new URI(url);
}
catch (URISyntaxException ignored) {
}
return URI.create(url);
}
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
import java.net.ConnectException;
import java.net.SocketTimeoutException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -266,11 +265,7 @@ private URI getHttpUri(ServiceDescriptor descriptor)
{
String url = descriptor.getProperties().get(httpsRequired ? "https" : "http");
if (url != null) {
try {
return new URI(url);
}
catch (URISyntaxException ignored) {
}
return URI.create(url);
}
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
import org.weakref.jmx.Managed;

import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
Expand Down Expand Up @@ -387,11 +386,7 @@ private static URI getHttpUri(ServiceDescriptor descriptor, boolean httpsRequire
{
String url = descriptor.getProperties().get(httpsRequired ? "https" : "http");
if (url != null) {
try {
return new URI(url);
}
catch (URISyntaxException ignored) {
}
return URI.create(url);
}
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import org.testng.annotations.Test;

import java.net.URI;
import java.net.URISyntaxException;

import static com.google.common.collect.Iterables.getOnlyElement;
import static io.trino.tests.product.TestGroups.HDFS_IMPERSONATION;
Expand Down Expand Up @@ -89,13 +88,7 @@ private static String getTableLocation(QueryExecutor executor, String tableName)
{
String location = getOnlyElement(executor.executeQuery(format("SELECT DISTINCT regexp_replace(\"$path\", '/[^/]*$', '') FROM %s", tableName)).column(1));
if (location.startsWith("hdfs://")) {
try {
URI uri = new URI(location);
return uri.getPath();
}
catch (URISyntaxException e) {
throw new RuntimeException(e);
}
return URI.create(location).getPath();
}
return location;
}
Expand Down