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

sdk: support storage class flag for sdk #3588

Merged
merged 1 commit into from
May 11, 2023
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
7 changes: 4 additions & 3 deletions sdk/java/libjfs/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ func freeHandle(fd int) {
type javaConf struct {
MetaURL string `json:"meta"`
Bucket string `json:"bucket"`
StorageClass string `json:"storageClass"`
ReadOnly bool `json:"readOnly"`
NoBGJob bool `json:"noBGJob"`
OpenCache float64 `json:"openCache"`
Expand Down Expand Up @@ -468,13 +469,13 @@ func jfs_init(cname, jsonConf, user, group, superuser, supergroup *C.char) uintp
go metric.UpdateMetrics(m, registerer)
}

if jConf.Bucket != "" {
davies marked this conversation as resolved.
Show resolved Hide resolved
format.Bucket = jConf.Bucket
}
blob, err := cmd.NewReloadableStorage(format, m, func(f *meta.Format) {
if jConf.Bucket != "" {
format.Bucket = jConf.Bucket
}
if jConf.StorageClass != "" {
format.StorageClass = jConf.StorageClass
}
})
if err != nil {
logger.Errorf("object storage: %s", err)
Expand Down
3 changes: 2 additions & 1 deletion sdk/java/src/main/java/io/juicefs/JuiceFileSystemImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ public void initialize(URI uri, Configuration conf) throws IOException {
obj.put(key, Boolean.valueOf(getConf(conf, key, "false")));
}
obj.put("bucket", getConf(conf, "bucket", ""));
obj.put("storageClass", getConf(conf, "storage-class", ""));
obj.put("readOnly", Boolean.valueOf(getConf(conf, "read-only", "false")));
obj.put("noBGJob", Boolean.valueOf(getConf(conf, "no-bgjob", "false")));
obj.put("cacheDir", getConf(conf, "cache-dir", "memory"));
Expand Down Expand Up @@ -579,7 +580,7 @@ public static Libjfs loadLibrary() throws IOException {
LibraryLoader<Libjfs> libjfsLibraryLoader = LibraryLoader.create(Libjfs.class);
libjfsLibraryLoader.failImmediately();

int soVer = 7;
int soVer = 8;
String osId = "so";
String archId = "amd64";
String resourceFormat = "libjfs-%s.%s.gz";
Expand Down