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

初始化 FileSystem实例过程中如何开启缓存模式 #114

Open
baisui1981 opened this issue Oct 25, 2023 · 0 comments
Open

初始化 FileSystem实例过程中如何开启缓存模式 #114

baisui1981 opened this issue Oct 25, 2023 · 0 comments

Comments

@baisui1981
Copy link

baisui1981 commented Oct 25, 2023

我在看网上文档介绍说:

JindoFS 有两种使用模式, 块存储模式(BLOCK)和缓存模式(CACHE)。 下面我们介绍下如何在 EMR 中配置和使用 JindoFS 以及不同模式对应的场景。

具体在 https://github.com/aliyun/alibabacloud-jindodata/blob/master/docs/user/4.x/4.6.x/4.6.11/jindofs/hadoop/jindosdk_ide_hadoop.md 这个文档中,在初始化FileSystem 这个实例过程中,可以设置什么参数开启 缓存模式(CACHE)? 能否指点一二

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FSDataInputStream;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;

import java.net.URI;

public class TestJindoSDK {
  public static void main(String[] args) throws Exception {
    Configuration conf = new Configuration();
    conf.set("fs.oss.impl", "com.aliyun.jindodata.oss.JindoOssFileSystem");
    conf.set("fs.AbstractFileSystem.oss.impl", "com.aliyun.jindodata.oss.OSS");
    conf.set("fs.jindofsx.data.cache.enable", "true");


    // set accessKey, secret, endpoint and so on.
    FileSystem fs = FileSystem.get(URI.create("oss://<Bucket>.<HDFS_Endpoint>/"), conf);
    FSDataInputStream in = fs.open(new Path("/uttest/file1"));
    in.read();
    in.close();
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant