Skip to content
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 @@ -23,10 +23,10 @@ public class FileSystemConfig
{
private boolean hadoopEnabled;
private boolean alluxioEnabled;
private boolean nativeAzureEnabled;
private boolean nativeS3Enabled;
private boolean nativeGcsEnabled;
private boolean nativeLocalEnabled;
private boolean azureEnabled;
private boolean s3Enabled;
private boolean gcsEnabled;
private boolean localEnabled;
private boolean cacheEnabled;

// Enable leak detection if configured or if running in a CI environment
Expand All @@ -50,61 +50,61 @@ public boolean isAlluxioEnabled()
}

@Config("fs.alluxio.enabled")
public FileSystemConfig setAlluxioEnabled(boolean nativeAlluxioEnabled)
public FileSystemConfig setAlluxioEnabled(boolean alluxioEnabled)
{
this.alluxioEnabled = nativeAlluxioEnabled;
this.alluxioEnabled = alluxioEnabled;
return this;
}

public boolean isNativeAzureEnabled()
public boolean isAzureEnabled()
{
return nativeAzureEnabled;
return azureEnabled;
}

@LegacyConfig("fs.native-azure.enabled")
@Config("fs.azure.enabled")
public FileSystemConfig setNativeAzureEnabled(boolean nativeAzureEnabled)
public FileSystemConfig setAzureEnabled(boolean azureEnabled)
{
this.nativeAzureEnabled = nativeAzureEnabled;
this.azureEnabled = azureEnabled;
return this;
}

public boolean isNativeS3Enabled()
public boolean isS3Enabled()
{
return nativeS3Enabled;
return s3Enabled;
}

@LegacyConfig("fs.native-s3.enabled")
@Config("fs.s3.enabled")
public FileSystemConfig setNativeS3Enabled(boolean nativeS3Enabled)
public FileSystemConfig setS3Enabled(boolean s3Enabled)
{
this.nativeS3Enabled = nativeS3Enabled;
this.s3Enabled = s3Enabled;
return this;
}

public boolean isNativeGcsEnabled()
public boolean isGcsEnabled()
{
return nativeGcsEnabled;
return gcsEnabled;
}

@LegacyConfig("fs.native-gcs.enabled")
@Config("fs.gcs.enabled")
public FileSystemConfig setNativeGcsEnabled(boolean nativeGcsEnabled)
public FileSystemConfig setGcsEnabled(boolean gcsEnabled)
{
this.nativeGcsEnabled = nativeGcsEnabled;
this.gcsEnabled = gcsEnabled;
return this;
}

public boolean isNativeLocalEnabled()
public boolean isLocalEnabled()
{
return nativeLocalEnabled;
return localEnabled;
}

@LegacyConfig("fs.native-local.enabled")
@Config("fs.local.enabled")
public FileSystemConfig setNativeLocalEnabled(boolean nativeLocalEnabled)
public FileSystemConfig setLocalEnabled(boolean localEnabled)
{
this.nativeLocalEnabled = nativeLocalEnabled;
this.localEnabled = localEnabled;
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,27 +95,27 @@ protected void setup(Binder binder)
factories.addBinding("alluxio").to(AlluxioFileSystemFactory.class);
}

if (config.isNativeAzureEnabled()) {
if (config.isAzureEnabled()) {
install(new AzureFileSystemModule());
factories.addBinding("abfs").to(AzureFileSystemFactory.class);
factories.addBinding("abfss").to(AzureFileSystemFactory.class);
factories.addBinding("wasb").to(AzureFileSystemFactory.class);
factories.addBinding("wasbs").to(AzureFileSystemFactory.class);
}

if (config.isNativeS3Enabled()) {
if (config.isS3Enabled()) {
install(new S3FileSystemModule());
factories.addBinding("s3").to(Key.get(TrinoFileSystemFactory.class, FileSystemS3.class));
factories.addBinding("s3a").to(Key.get(TrinoFileSystemFactory.class, FileSystemS3.class));
factories.addBinding("s3n").to(Key.get(TrinoFileSystemFactory.class, FileSystemS3.class));
}

if (config.isNativeGcsEnabled()) {
if (config.isGcsEnabled()) {
install(new GcsFileSystemModule());
factories.addBinding("gs").to(GcsFileSystemFactory.class);
}

if (config.isNativeLocalEnabled()) {
if (config.isLocalEnabled()) {
configBinder(binder).bindConfig(LocalFileSystemConfig.class);
factories.addBinding("local").to(LocalFileSystemFactory.class);
factories.addBinding("file").to(LocalFileSystemFactory.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ public void testDefaults()
assertRecordedDefaults(recordDefaults(FileSystemConfig.class)
.setHadoopEnabled(false)
.setAlluxioEnabled(false)
.setNativeAzureEnabled(false)
.setNativeS3Enabled(false)
.setNativeGcsEnabled(false)
.setNativeLocalEnabled(false)
.setAzureEnabled(false)
.setS3Enabled(false)
.setGcsEnabled(false)
.setLocalEnabled(false)
.setCacheEnabled(false)
.setTrackingEnabled(RUNNING_IN_CI));
}
Expand All @@ -59,10 +59,10 @@ public void testExplicitPropertyMappings()
FileSystemConfig expected = new FileSystemConfig()
.setHadoopEnabled(true)
.setAlluxioEnabled(true)
.setNativeAzureEnabled(true)
.setNativeS3Enabled(true)
.setNativeGcsEnabled(true)
.setNativeLocalEnabled(true)
.setAzureEnabled(true)
.setS3Enabled(true)
.setGcsEnabled(true)
.setLocalEnabled(true)
.setCacheEnabled(true)
.setTrackingEnabled(!RUNNING_IN_CI);

Expand Down