Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ru.at_consulting.bigdata.wordcount.system;
- import org.apache.hadoop.conf.Configuration;
- import org.apache.hadoop.conf.Configured;
- import org.apache.hadoop.fs.FileSystem;
- import org.apache.hadoop.fs.Path;
- import org.apache.hadoop.fs.PathFilter;
- import java.io.IOException;
- /**
- * Created by Evzerov E
- */
- public class DatePathFilter extends Configured implements PathFilter {
- FileSystem fs;
- @Override
- public boolean accept(Path path) {
- try {
- return !fs.isDirectory(path) || (path.toString().contains("dir1"));
- } catch (IOException e) {
- e.printStackTrace();
- return false;
- }
- }
- @Override
- public void setConf(Configuration conf) {
- if (conf != null) {
- try {
- fs = FileSystem.get(conf);
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement