(ElementDescriptor elem,
DataStorage fs)
| 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) { |
no test coverage detected