Skip to content

Commit

Permalink
7
Browse files Browse the repository at this point in the history
  • Loading branch information
morningman committed Jan 10, 2025
1 parent a035d20 commit 5a34bcb
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,6 @@ public static CatalogProperty read(DataInput in) throws IOException {

public void initialize(Type type) {
metastoreProperties = new MetastoreProperties(type, properties);
storageProperties = new StorageProperties(properties);
// storageProperties = new StorageProperties(properties);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public StorageProperties create(Map<String, String> origProps) throws UserExcept

// In previous version, we don't support fs.xxx.support properties.
// So we need to "guess" this info from the properties.

throw new RuntimeException("Unknown storage type");
}

protected StorageProperties(Type type, Map<String, String> origProps) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package org.apache.doris.datasource;

import org.apache.doris.backup.Status;
import org.apache.doris.common.security.authentication.AuthenticationConfig;
import org.apache.doris.common.security.authentication.HadoopAuthenticator;
import org.apache.doris.fs.remote.RemoteFile;
import org.apache.doris.fs.remote.dfs.DFSFileSystem;

import com.aliyun.datalake.metastore.hive2.ProxyMetaStoreClient;
import com.amazonaws.glue.catalog.metastore.AWSCatalogMetastoreClient;
Expand All @@ -19,9 +22,11 @@
import org.apache.paimon.catalog.CatalogContext;
import org.apache.paimon.catalog.CatalogFactory;
import org.apache.paimon.options.Options;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

Expand Down Expand Up @@ -171,4 +176,26 @@ public void testPaimonHMSCatalog() throws IOException {
return paimonCatalog;
});
}

@Test
public void testOSSHDFS() {
String remotePath = "oss://benchmark-dls.cn-beijing.oss-dls.aliyuncs.com/user/yy/tbl_oss_hdfs/";
Map<String, String> properties = Maps.newHashMap();
properties.put("fs.oss.impl", "com.aliyun.jindodata.oss.JindoOssFileSystem");
properties.put("fs.AbstractFileSystem.oss.impl", "com.aliyun.jindodata.oss.JindoOSS");
properties.put("fs.oss.accessKeyId", ak);
properties.put("fs.oss.accessKeySecret", sk);
properties.put("fs.oss.endpoint", "cn-beijing.oss-dls.aliyuncs.com");
DFSFileSystem fs = new DFSFileSystem(properties);
List<RemoteFile> results = new ArrayList<>();

Status st = fs.listFiles(remotePath, false, results);
if (!st.ok()) {
System.out.println("listFiles failed: " + st);
Assertions.fail();
}
for (RemoteFile file : results) {
System.out.println(file);
}
}
}

0 comments on commit 5a34bcb

Please sign in to comment.