Skip to content

Commit

Permalink
Allow lakeFSFS to work with Azure (#5986)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnyaug authored Jun 1, 2023
1 parent fbf2d49 commit 8d96ef0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ public class LakeFSFileSystem extends FileSystem {
private boolean failedFSForConfig = false;
private PhysicalAddressTranslator physicalAddressTranslator;
private StorageAccessStrategy storageAccessStrategy;
private AccessMode accessMode;
private static File emptyFile = new File("/dev/null");

// Currently bulk deletes *must* receive a single-threaded executor!
Expand Down Expand Up @@ -136,7 +137,7 @@ void initializeWithClientFactory(URI name, Configuration conf, ClientFactory cli
throw new IOException("Failed to get lakeFS blockstore type", e);
}
String accessModeConf = FSConfiguration.get(conf, uri.getScheme(), ACCESS_MODE_KEY_SUFFIX);
AccessMode accessMode = AccessMode.valueOf(StringUtils.defaultIfBlank(accessModeConf, AccessMode.SIMPLE.toString()).toUpperCase());
accessMode = AccessMode.valueOf(StringUtils.defaultIfBlank(accessModeConf, AccessMode.SIMPLE.toString()).toUpperCase());
if (accessMode == AccessMode.PRESIGNED) {
storageAccessStrategy = new PresignedStorageAccessStrategy(this, lfsClient);
} else if (accessMode == AccessMode.SIMPLE) {
Expand All @@ -150,7 +151,7 @@ private synchronized FileSystem getFSForConfig() {
if (fsForConfig != null) {
return fsForConfig;
}
if (failedFSForConfig) {
if (failedFSForConfig || accessMode == AccessMode.PRESIGNED) {
return null;
}
Path path = new Path(uri);
Expand Down
2 changes: 1 addition & 1 deletion docs/integrations/spark.md
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ and then add these into a configuration file, e.g., `$SPARK_HOME/conf/hdfs-site.
Add the following the cluster's configuration under `Configuration ➡️ Advanced options`:

```
spark.hadoop.fs.access.mode presigned
spark.hadoop.fs.lakefs.access.mode presigned
spark.hadoop.fs.lakefs.impl io.lakefs.LakeFSFileSystem
spark.hadoop.fs.lakefs.access.key AKIAlakefs12345EXAMPLE
spark.hadoop.fs.lakefs.secret.key abc/lakefs/1234567bPxRfiCYEXAMPLEKEY
Expand Down

0 comments on commit 8d96ef0

Please sign in to comment.