Search Java Code Snippets


  Help us in improving the repository. Add new snippets through 'Submit Code Snippet ' link.





#Java - Code Snippets for '#Org.apache.hadoop.fs.Path' - 4 code snippet(s) found

 Sample 1. MapReduce Word Count using Apache Accumlo

https://apache.googlesource.com/accumulo/+/HEAD/examples/simple/src/main/java/org/apache/accumulo/examples/simple/mapreduce/WordCount.java

   Like      Feedback     


 Sample 2. Apache Hadoop Multi File Word Count

https://apache.googlesource.com/hadoop-common/+/trunk/hadoop-mapreduce-project/hadoop-mapreduce-examples/src/main/java/org/apache/hadoop/examples/MultiFileWordCount.java

   Like      Feedback     


 Sample 3. Usage of import org.apache.hadoop.fs.Path

Path path = new Path(uris[i]);
FileSystem fs = path.getFileSystem(conf);
if (fs.isFile(path)) {
outURIs[i] = uris[i];
} else {
Path mergePath = new Path(path.getParent(), "sparkreadable-" + path.getName());
FileUtil.copyMerge(fs, path, fs, mergePath, false, conf, "");

   Like      Feedback     


 Sample 4. Usage of org.apache.hadoop.fs.Path

StringTokenizer tokens = new StringTokenizer(src, Path.SEPARATOR);
while(tokens.hasMoreTokens()) {
   String element = tokens.nextToken();
   if (element.equals("..") || element.equals(".") || (element.indexOf(":") >= 0) || (element.indexOf("/") >= 0)) {
      return false;
   }
}
return true;

   Like      Feedback     



Subscribe to Java News and Posts. Get latest updates and posts on Java from Buggybread.com
Enter your email address:
Delivered by FeedBurner