Examples of FsVolumeSpi


Examples of org.apache.hadoop.hdfs.server.datanode.fsdataset.FsVolumeSpi

    }
    // Determine the index of the VolumeId of each block's volume, by comparing
    // the block's volume against the enumerated volumes
    for (int i = 0; i < blocks.size(); i++) {
      ExtendedBlock block = blocks.get(i);
      FsVolumeSpi blockVolume = getReplicaInfo(block).getVolume();
      boolean isValid = false;
      int volumeIndex = 0;
      for (FsVolumeImpl volume : volumes.volumes) {
        // This comparison of references should be safe
        if (blockVolume == volume) {
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.datanode.fsdataset.FsVolumeSpi

  /**
   * Report a bad block which is hosted on the local DN.
   */
  public void reportBadBlocks(ExtendedBlock block) throws IOException{
    BPOfferService bpos = getBPOSForBlock(block);
    FsVolumeSpi volume = getFSDataset().getVolume(block);
    bpos.reportBadBlocks(
        block, volume.getStorageID(), volume.getStorageType());
  }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.datanode.fsdataset.FsVolumeSpi

    }

    // Check if NN recorded length matches on-disk length
    long onDiskLength = data.getLength(block);
    if (block.getNumBytes() > onDiskLength) {
      FsVolumeSpi volume = getFSDataset().getVolume(block);
      // Shorter on-disk len indicates corruption so report NN the corrupt block
      bpos.reportBadBlocks(
          block, volume.getStorageID(), volume.getStorageType());
      LOG.warn("Can't replicate block " + block
          + " because on-disk length " + onDiskLength
          + " is shorter than NameNode recorded length " + block.getNumBytes());
      return;
    }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.datanode.fsdataset.FsVolumeSpi

    }
    // Determine the index of the VolumeId of each block's volume, by comparing
    // the block's volume against the enumerated volumes
    for (int i = 0; i < blocks.size(); i++) {
      ExtendedBlock block = blocks.get(i);
      FsVolumeSpi blockVolume = getReplicaInfo(block).getVolume();
      boolean isValid = false;
      int volumeIndex = 0;
      for (FsVolumeImpl volume : volumes.volumes) {
        // This comparison of references should be safe
        if (blockVolume == volume) {
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.datanode.fsdataset.FsVolumeSpi

    }
    // Determine the index of the VolumeId of each block's volume, by comparing
    // the block's volume against the enumerated volumes
    for (int i = 0; i < blocks.size(); i++) {
      ExtendedBlock block = blocks.get(i);
      FsVolumeSpi blockVolume = getReplicaInfo(block).getVolume();
      boolean isValid = false;
      int volumeIndex = 0;
      for (FsVolumeImpl volume : volumes.volumes) {
        // This comparison of references should be safe
        if (blockVolume == volume) {
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.datanode.fsdataset.FsVolumeSpi

  /**
   * Report a bad block which is hosted on the local DN.
   */
  public void reportBadBlocks(ExtendedBlock block) throws IOException{
    BPOfferService bpos = getBPOSForBlock(block);
    FsVolumeSpi volume = getFSDataset().getVolume(block);
    bpos.reportBadBlocks(
        block, volume.getStorageID(), volume.getStorageType());
  }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.datanode.fsdataset.FsVolumeSpi

    }

    // Check if NN recorded length matches on-disk length
    long onDiskLength = data.getLength(block);
    if (block.getNumBytes() > onDiskLength) {
      FsVolumeSpi volume = getFSDataset().getVolume(block);
      // Shorter on-disk len indicates corruption so report NN the corrupt block
      bpos.reportBadBlocks(
          block, volume.getStorageID(), volume.getStorageType());
      LOG.warn("Can't replicate block " + block
          + " because on-disk length " + onDiskLength
          + " is shorter than NameNode recorded length " + block.getNumBytes());
      return;
    }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.datanode.fsdataset.FsVolumeSpi

    StorageReceivedDeletedBlocks reports[] =
        new StorageReceivedDeletedBlocks[dn.getFSDataset().getVolumes().size()];

    // Lie to the NN that one block on each storage has been deleted.
    for (int i = 0; i < reports.length; ++i) {
      FsVolumeSpi volume = dn.getFSDataset().getVolumes().get(i);

      boolean foundBlockOnStorage = false;
      ReceivedDeletedBlockInfo rdbi[] = new ReceivedDeletedBlockInfo[1];

      // Find the first block on this storage and mark it as deleted for the
      // report.
      for (LocatedBlock block : blocks.getLocatedBlocks()) {
        if (block.getStorageIDs()[0].equals(volume.getStorageID())) {
          rdbi[0] = new ReceivedDeletedBlockInfo(block.getBlock().getLocalBlock(),
              ReceivedDeletedBlockInfo.BlockStatus.DELETED_BLOCK, null);
          foundBlockOnStorage = true;
          break;
        }
      }

      assertTrue(foundBlockOnStorage);
      reports[i] = new StorageReceivedDeletedBlocks(volume.getStorageID(), rdbi);

      if (splitReports) {
        // If we are splitting reports then send the report for this storage now.
        StorageReceivedDeletedBlocks singletonReport[] = { reports[i] };
        cluster.getNameNodeRpc().blockReceivedAndDeleted(dnR, poolId, singletonReport);
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.datanode.fsdataset.FsVolumeSpi

  /**
   * Report a bad block which is hosted on the local DN.
   */
  public void reportBadBlocks(ExtendedBlock block) throws IOException{
    BPOfferService bpos = getBPOSForBlock(block);
    FsVolumeSpi volume = getFSDataset().getVolume(block);
    bpos.reportBadBlocks(
        block, volume.getStorageID(), volume.getStorageType());
  }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.datanode.fsdataset.FsVolumeSpi

    }

    // Check if NN recorded length matches on-disk length
    long onDiskLength = data.getLength(block);
    if (block.getNumBytes() > onDiskLength) {
      FsVolumeSpi volume = getFSDataset().getVolume(block);
      // Shorter on-disk len indicates corruption so report NN the corrupt block
      bpos.reportBadBlocks(
          block, volume.getStorageID(), volume.getStorageType());
      LOG.warn("Can't replicate block " + block
          + " because on-disk length " + onDiskLength
          + " is shorter than NameNode recorded length " + block.getNumBytes());
      return;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.