ElementDescriptor[] globPaths = store.asCollection(location);
for (int m = 0; m < globPaths.length; m++) {
paths.add(globPaths[m]);
}
for (int j = 0; j < paths.size(); j++) {
ElementDescriptor fullPath = store.asElement(store
.getActiveContainer(), paths.get(j));
// Skip hadoop's private/meta files ...
if (fullPath.systemElement()) {
continue;
}
if (fullPath instanceof ContainerDescriptor) {
for (ElementDescriptor child : ((ContainerDescriptor) fullPath)) {
paths.add(child);
}
continue;
}
Map<String, Object> stats = fullPath.getStatistics();
long bs = (Long) (stats.get(ElementDescriptor.BLOCK_SIZE_KEY));
long size = (Long) (stats.get(ElementDescriptor.LENGTH_KEY));
long pos = 0;
String name = fullPath.toString();
// System.out.println(size + " " + name);
if (name.endsWith(".gz") || !splittable) {
// Anything that ends with a ".gz" we must process as a complete
// file
slices.add(new PigSlice(name, funcSpec, 0, size));