MCPcopy Create free account
hub / github.com/apache/pig / globMatchesFiles

Method globMatchesFiles

src/org/apache/pig/impl/io/FileLocalizer.java:650–672  ·  view source on GitHub ↗
(ElementDescriptor elem,
                                            DataStorage fs)

Source from the content-addressed store, hash-verified

648 }
649
650 private static boolean globMatchesFiles(ElementDescriptor elem,
651 DataStorage fs)
652 throws IOException
653 {
654 try {
655 // Currently, if you give a glob with non-special glob characters, hadoop
656 // returns an array with your file name in it. So check for that.
657 ElementDescriptor[] elems = fs.asCollection(elem.toString());
658 switch (elems.length) {
659 case 0:
660 return false;
661
662 case 1:
663 return !elems[0].equals(elem);
664
665 default:
666 return true;
667 }
668 }
669 catch (DataStorageException e) {
670 throw e;
671 }
672 }
673
674 @VisibleForTesting
675 public static void setR(Random r) {

Callers 2

openDFSFileMethod · 0.95
fileExistsMethod · 0.95

Calls 3

asCollectionMethod · 0.65
toStringMethod · 0.45
equalsMethod · 0.45

Tested by

no test coverage detected