yuqi1129 commented on PR #5079:
URL: https://github.com/apache/gravitino/pull/5079#issuecomment-2419110394

   > How does user use gcp-bundle with gvfs, can you please give me an example?
   
   1. Add the following dependency:
   ```xml
           <dependency>
               <groupId>org.apache.hadoop</groupId>
               <artifactId>hadoop-common</artifactId>
               <version>3.1.0</version>
           </dependency>
           <dependency>
               <groupId>org.apache.gravitino</groupId>
               <artifactId>gcp-bundle</artifactId>
               <version>0.7.0-incubating-SNAPSHOT</version>
           </dependency>
   
           <dependency>
               <groupId>org.apache.gravitino</groupId>
               <artifactId>filesystem-hadoop3-runtime</artifactId>
               <version>0.7.0-incubating-SNAPSHOT</version>
           </dependency>
   ```
   
   2.  The following is an example code.
   ```
     public static void main(String[] args) throws IOException {
   
       Configuration conf = new Configuration();
       conf.set("fs.gvfs.impl", 
"org.apache.gravitino.filesystem.hadoop.GravitinoVirtualFileSystem");
       conf.set("fs.AbstractFileSystem.gvfs.impl", 
"org.apache.gravitino.filesystem.hadoop.Gvfs");
       conf.set("fs.gvfs.impl.disable.cache", "true");
       conf.set("fs.gravitino.server.uri", "http://127.0.0.1:8090";);
       conf.set("fs.gravitino.client.metalake", "gvfs_it_metalake_1fd37007");
   
       // Pass this configuration to the real file system
       conf.set("gravitino.bypass.fs.gs.auth.service.account.enable", "true");
       conf.set("gravitino.bypass.fs.gs.auth.service.account.json.keyfile", 
SERVICE_ACCOUNT_FILE);
       conf.set(FS_FILESYSTEM_PROVIDERS, "gcs");
   
       String gvfsPath = 
"gvfs://fileset/catalog_704cac87/schema_858f9d26/test_fileset_create_88eaed4e";
       Path path = new Path(gvfsPath);
   
       FileSystem f = path.getFileSystem(conf);
   
       System.out.println("fileSystem: " + f);
   
       String filePath = gvfsPath + "/test.txt";
   
       System.out.println(f.exists(new Path(filePath)));
     }
   
   ```
   
   @jerryshao 
   I have confirmed locally and all are as expected. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to