Skip to content

Commit

Permalink
support azure
Browse files Browse the repository at this point in the history
  • Loading branch information
“v_kkhuang” committed Jan 17, 2025
1 parent 9be69de commit 50ee6c9
Show file tree
Hide file tree
Showing 8 changed files with 503 additions and 11 deletions.
12 changes: 12 additions & 0 deletions linkis-commons/linkis-storage/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,18 @@
<version>1.12.261</version>
</dependency>

<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-storage-blob</artifactId>
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-storage-common</artifactId>
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-identity</artifactId>
</dependency>
<dependency>
<groupId>org.apache.parquet</groupId>
<artifactId>parquet-avro</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.linkis.storage.factory.impl;

import org.apache.linkis.common.io.Fs;
import org.apache.linkis.storage.factory.BuildFactory;
import org.apache.linkis.storage.fs.impl.AzureBlobFileSystem;
import org.apache.linkis.storage.utils.StorageUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;

public class BuildAzureBlobFileSystem implements BuildFactory {
private static final Logger LOG = LoggerFactory.getLogger(BuildAzureBlobFileSystem.class);

@Override
public Fs getFs(String user, String proxyUser) {
AzureBlobFileSystem fs = new AzureBlobFileSystem();
try {
fs.init(null);
} catch (IOException e) {
LOG.warn("get file system failed", e);
}
fs.setUser(user);
return fs;
}

@Override
public Fs getFs(String user, String proxyUser, String label) {
AzureBlobFileSystem fs = new AzureBlobFileSystem();
try {
fs.init(null);
} catch (IOException e) {
LOG.warn("get file system failed", e);
}
fs.setUser(user);
return fs;
}

@Override
public String fsName() {
return StorageUtils.BLOB;
}
}
Loading

0 comments on commit 50ee6c9

Please sign in to comment.