Package org.apache.hadoop.util.DiskChecker

Examples of org.apache.hadoop.util.DiskChecker.DiskOutOfSpaceException


                    try {
                      out.write(buf, 0, bytesRead);
                      myMetrics.wroteBytes(bytesRead);
                    } catch (IOException iex) {
                      if (iex.getMessage().startsWith("No space left on device")) {
                        throw new DiskOutOfSpaceException("No space left on device");
                      } else {
                        shutdown();
                        throw iex;
                      }
                    }
View Full Code Here


   *  when IOException occurs.
   * If so, handle the error */
  protected void checkDiskError( IOException e ) throws IOException {
    if (e.getMessage() != null &&
        e.getMessage().startsWith("No space left on device")) {
      throw new DiskOutOfSpaceException("No space left on device");
    } else {
      checkDiskError();
    }
  }
View Full Code Here

  /* Check if there is no space in disk or the disk is read-only
   *  when IOException occurs.
   * If so, handle the error */
  private void checkDiskError( IOException e ) throws IOException {
    if (e.getMessage().startsWith("No space left on device")) {
      throw new DiskOutOfSpaceException("No space left on device");
    } else {
      checkDiskError();
    }
  }
View Full Code Here

      while (true) {
        FSVolume volume = volumes[curVolume];
        curVolume = (curVolume + 1) % volumes.length;
        if (volume.getAvailable() > blockSize) { return volume; }
        if (curVolume == startVolume) {
          throw new DiskOutOfSpaceException("Insufficient space for an additional block");
        }
      }
    }
View Full Code Here

   
    LOG.warn("checkDiskError: exception: ", e);
   
    if (e.getMessage() != null &&
        e.getMessage().startsWith("No space left on device")) {
      throw new DiskOutOfSpaceException("No space left on device");
    } else {
      checkDiskError();
    }
  }
View Full Code Here

      while (true) {
        FSVolume volume = volumes[curVolume];
        curVolume = (curVolume + 1) % volumes.length;
        if (volume.getAvailable() > blockSize) { return volume; }
        if (curVolume == startVolume) {
          throw new DiskOutOfSpaceException("Insufficient space for an additional block");
        }
      }
    }
View Full Code Here

                    try {
                      out.write(buf, 0, bytesRead);
                      myMetrics.wroteBytes(bytesRead);
                    } catch (IOException iex) {
                      if (iex.getMessage().startsWith("No space left on device")) {
                        throw new DiskOutOfSpaceException("No space left on device");
                      } else {
                        shutdown();
                        throw iex;
                      }
                    }
View Full Code Here

        while (true) {
          FSVolume volume = volumes[curVolume];
          curVolume = (curVolume + 1) % volumes.length;
          if (volume.getAvailable() >= blockSize) { return volume; }
          if (curVolume == startVolume) {
            throw new DiskOutOfSpaceException("Insufficient space for an additional block");
          }
        }
      }
View Full Code Here

   
    // construct a RBW replica with the new GS
    File blkfile = replicaInfo.getBlockFile();
    FsVolumeImpl v = (FsVolumeImpl)replicaInfo.getVolume();
    if (v.getAvailable() < estimateBlockLen - replicaInfo.getNumBytes()) {
      throw new DiskOutOfSpaceException("Insufficient space for appending to "
          + replicaInfo);
    }
    File newBlkFile = new File(v.getRbwDir(bpid), replicaInfo.getBlockName());
    File oldmeta = replicaInfo.getMetaFile();
    ReplicaBeingWritten newReplicaInfo = new ReplicaBeingWritten(
View Full Code Here

          " related exception")
      return;
    }
    if (e.getMessage() != null &&
        e.getMessage().startsWith("No space left on device")) {
      throw new DiskOutOfSpaceException("No space left on device");
    } else {
      checkDiskError();
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.util.DiskChecker.DiskOutOfSpaceException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.