Created
May 19, 2016 05:29
-
-
Save javabrett/5d77b852416dcd2d6bc3c19b17ceabfb to your computer and use it in GitHub Desktop.
Simple MapR FS test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package mapr.test; | |
import java.io.IOException; | |
import org.apache.hadoop.conf.Configuration; | |
import org.apache.hadoop.fs.FileSystem; | |
import org.apache.hadoop.fs.Path; | |
import org.apache.hadoop.security.UserGroupInformation; | |
public class Main { | |
public Main() { | |
} | |
public static void main(String[] args) throws IOException { | |
UserGroupInformation realUser = UserGroupInformation.createRemoteUser("mapr"); | |
UserGroupInformation.setLoginUser(realUser); | |
Configuration conf = new Configuration(); | |
conf.set("fs.default.name", "maprfs:///"); | |
conf.set("fs.maprfs.impl", "com.mapr.fs.MapRFileSystem"); | |
FileSystem fs = FileSystem.get(conf); | |
System.out.println(fs.exists(new Path("/some/mapr/maprfs/path"))); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment