FileStatus[] dirs;
try {
dirs = whPath_.getFileSystem(conf_).listStatus(whPath_);
} catch (IOException e) {
throw new MetaException("DB Error: Table " + whPath_ + " missing?");
}
if(dirs == null) {
throw new MetaException("FATAL: " + whPath_ + " does not seem to exist or maybe has no partitions in DFS");
}
Boolean equalsSeen = null;
String partKey = null;
for (int i = 0; i < dirs.length; i++) {
String dname = dirs[i].getPath().getName();
int sepidx = dname.indexOf('=');
if (sepidx == -1) {
if (equalsSeen != null && equalsSeen.booleanValue()) {
throw new MetaException("DB Error: Table "+tableName_+" dir corrupted?");
}
equalsSeen = Boolean.valueOf(false);
continue;
} else {
if (equalsSeen != null && !equalsSeen.booleanValue()) {
throw new MetaException("DB Error: Table "+tableName_+" dir corrupted?");
}
equalsSeen = Boolean.valueOf(true);
}
String partVal = dname.substring(sepidx+1);
if (partKey != null) {
if (!partKey.equals(dname.substring(0,sepidx))) {
throw new MetaException("DB Error: Directory "+dirs[i]);
}
} else {
partKey = dname.substring(0,sepidx);
}