/** * Check all files in a column family dir. * * @param cfDir * column family directory * @throws IOException */ protected void checkColFamDir(Path cfDir) throws IOException { FileStatus[] hfs = null; try { hfs = fs.listStatus(cfDir, new HFileFilter(fs)); // use same filter as scanner. } catch (FileNotFoundException fnfe) { // Hadoop 0.23+ listStatus semantics throws an exception if the path does not exist. LOG.warn("Colfam Directory " + cfDir + " does not exist. Likely due to concurrent split/compaction. Skipping."); missing.add(cfDir); return; } // Hadoop 1.0 listStatus does not throw an exception if the path does not exist. if (hfs.length == 0 && !fs.exists(cfDir)) { LOG.warn("Colfam Directory " + cfDir + " does not exist. Likely due to concurrent split/compaction. Skipping."); missing.add(cfDir); return; } for (FileStatus hfFs : hfs) { Path hf = hfFs.getPath(); checkHFile(hf); } }
/** * Check all files in a column family dir. * * @param cfDir * column family directory * @throws IOException */ protected void checkColFamDir(Path cfDir) throws IOException { FileStatus[] statuses = null; try { statuses = fs.listStatus(cfDir); // use same filter as scanner. } catch (FileNotFoundException fnfe) { // Hadoop 0.23+ listStatus semantics throws an exception if the path does not exist. LOG.warn("Colfam Directory " + cfDir + " does not exist. Likely due to concurrent split/compaction. Skipping."); missing.add(cfDir); return; } List<FileStatus> hfs = FSUtils.filterFileStatuses(statuses, new HFileFilter(fs)); // Hadoop 1.0 listStatus does not throw an exception if the path does not exist. if (hfs.isEmpty() && !fs.exists(cfDir)) { LOG.warn("Colfam Directory " + cfDir + " does not exist. Likely due to concurrent split/compaction. Skipping."); missing.add(cfDir); return; } for (FileStatus hfFs : hfs) { Path hf = hfFs.getPath(); checkHFile(hf); } }
/** * Check all files in a mob column family dir. * * @param cfDir * mob column family directory * @throws IOException */ protected void checkMobColFamDir(Path cfDir) throws IOException { FileStatus[] statuses = null; try { statuses = fs.listStatus(cfDir); // use same filter as scanner. } catch (FileNotFoundException fnfe) { // Hadoop 0.23+ listStatus semantics throws an exception if the path does not exist. LOG.warn("Mob colfam Directory " + cfDir + " does not exist. Likely the table is deleted. Skipping."); missedMobFiles.add(cfDir); return; } List<FileStatus> hfs = FSUtils.filterFileStatuses(statuses, new HFileFilter(fs)); // Hadoop 1.0 listStatus does not throw an exception if the path does not exist. if (hfs.isEmpty() && !fs.exists(cfDir)) { LOG.warn("Mob colfam Directory " + cfDir + " does not exist. Likely the table is deleted. Skipping."); missedMobFiles.add(cfDir); return; } for (FileStatus hfFs : hfs) { Path hf = hfFs.getPath(); checkMobFile(hf); } }