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

Update airlift to 295 #24695

Merged
merged 1 commit into from
Jan 13, 2025
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 @@ -19,6 +19,7 @@
import com.google.inject.Scopes;
import com.google.inject.Singleton;
import io.airlift.configuration.AbstractConfigurationAwareModule;
import io.airlift.configuration.ConfigPropertyMetadata;
import io.opentelemetry.api.OpenTelemetry;
import io.opentelemetry.api.trace.Tracer;
import io.trino.filesystem.Location;
Expand Down Expand Up @@ -85,7 +86,9 @@ protected void setup(Binder binder)
nodeManager,
openTelemetry);

loader.configure().forEach(this::consumeProperty);
loader.configure().forEach((name, securitySensitive) ->
consumeProperty(new ConfigPropertyMetadata(name, securitySensitive)));

binder.bind(HdfsFileSystemLoader.class).toInstance(loader);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import java.nio.file.Path;
import java.util.List;
import java.util.Map;
import java.util.Set;

import static com.google.common.base.Verify.verify;
import static com.google.common.collect.Streams.stream;
Expand Down Expand Up @@ -85,10 +84,10 @@ public HdfsFileSystemLoader(
}

@SuppressWarnings("unchecked")
public Set<String> configure()
public Map<String, Boolean> configure()
{
try (var _ = new ThreadContextClassLoader(classLoader)) {
return (Set<String>) manager.getClass().getMethod("configure").invoke(manager);
return (Map<String, Boolean>) manager.getClass().getMethod("configure").invoke(manager);
}
catch (ReflectiveOperationException e) {
throw new RuntimeException("Failed to configure HDFS:\n%s\n%s\n%s".formatted("<".repeat(70), e.getCause(), ">".repeat(70)), e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import com.google.inject.Module;
import io.airlift.bootstrap.Bootstrap;
import io.airlift.bootstrap.LifeCycleManager;
import io.airlift.configuration.ConfigPropertyMetadata;
import io.opentelemetry.api.OpenTelemetry;
import io.trino.filesystem.TrinoFileSystemFactory;
import io.trino.hdfs.HdfsModule;
Expand All @@ -34,9 +35,9 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;

import static com.google.common.base.Preconditions.checkState;
import static java.util.stream.Collectors.toMap;

public final class HdfsFileSystemManager
{
Expand Down Expand Up @@ -84,9 +85,11 @@ public HdfsFileSystemManager(
.setOptionalConfigurationProperties(config);
}

public Set<String> configure()
public Map<String, Boolean> configure()
{
return bootstrap.configure();
return bootstrap.configure()
.stream()
.collect(toMap(ConfigPropertyMetadata::name, ConfigPropertyMetadata::securitySensitive));
}

public TrinoFileSystemFactory create()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import org.junit.jupiter.api.Test;

import java.io.IOException;
import java.util.Set;
import java.util.UUID;

import static org.assertj.core.api.Assertions.assertThat;
Expand All @@ -47,8 +46,7 @@ void testManager()
new TestingNodeManager(),
OpenTelemetry.noop());

Set<String> used = manager.configure();
assertThat(used).containsExactly("hive.dfs.verify-checksum", "hive.s3.region");
assertThat(manager.configure().keySet()).containsExactly("hive.dfs.verify-checksum", "hive.s3.region");

TrinoFileSystemFactory factory = manager.create();
TrinoFileSystem fileSystem = factory.create(ConnectorIdentity.ofUser("test"));
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@
<air.test.jvm.additional-arguments>${air.test.jvm.additional-arguments.default}</air.test.jvm.additional-arguments>

<!-- keep dependency properties sorted -->
<dep.airlift.version>294</dep.airlift.version>
<dep.airlift.version>295</dep.airlift.version>
<dep.alluxio.version>2.9.6</dep.alluxio.version>
<dep.antlr.version>4.13.2</dep.antlr.version>
<dep.avro.version>1.12.0</dep.avro.version>
Expand Down
Loading