Search in sources :

Example 1 with WALLink

use of org.apache.hadoop.hbase.io.WALLink in project hbase by apache.

the class DumpReplicationQueues method getTotalWALSize.

/**
   *  return total size in bytes from a list of WALs
   */
private long getTotalWALSize(FileSystem fs, List<String> wals, String server) throws IOException {
    int size = 0;
    FileStatus fileStatus;
    for (String wal : wals) {
        try {
            fileStatus = (new WALLink(getConf(), server, wal)).getFileStatus(fs);
        } catch (IOException e) {
            if (e instanceof FileNotFoundException) {
                numWalsNotFound++;
                LOG.warn("WAL " + wal + " couldn't be found, skipping", e);
            } else {
                LOG.warn("Can't get file status of WAL " + wal + ", skipping", e);
            }
            continue;
        }
        size += fileStatus.getLen();
    }
    totalSizeOfWALs += size;
    return size;
}
Also used : WALLink(org.apache.hadoop.hbase.io.WALLink) FileStatus(org.apache.hadoop.fs.FileStatus) FileNotFoundException(java.io.FileNotFoundException) IOException(java.io.IOException)

Example 2 with WALLink

use of org.apache.hadoop.hbase.io.WALLink in project hbase by apache.

the class DumpReplicationQueues method getTotalWALSize.

/**
 *  return total size in bytes from a list of WALs
 */
private long getTotalWALSize(FileSystem fs, List<String> wals, ServerName server) throws IOException {
    long size = 0;
    FileStatus fileStatus;
    for (String wal : wals) {
        try {
            fileStatus = (new WALLink(getConf(), server.getServerName(), wal)).getFileStatus(fs);
        } catch (IOException e) {
            if (e instanceof FileNotFoundException) {
                numWalsNotFound++;
                LOG.warn("WAL " + wal + " couldn't be found, skipping", e);
            } else {
                LOG.warn("Can't get file status of WAL " + wal + ", skipping", e);
            }
            continue;
        }
        size += fileStatus.getLen();
    }
    totalSizeOfWALs += size;
    return size;
}
Also used : WALLink(org.apache.hadoop.hbase.io.WALLink) FileStatus(org.apache.hadoop.fs.FileStatus) FileNotFoundException(java.io.FileNotFoundException) IOException(java.io.IOException)

Aggregations

FileNotFoundException (java.io.FileNotFoundException)2 IOException (java.io.IOException)2 FileStatus (org.apache.hadoop.fs.FileStatus)2 WALLink (org.apache.hadoop.hbase.io.WALLink)2