当前位置: 首页>>代码示例>>Java>>正文


Java CorruptHFileException类代码示例

本文整理汇总了Java中org.apache.hadoop.hbase.io.hfile.CorruptHFileException的典型用法代码示例。如果您正苦于以下问题:Java CorruptHFileException类的具体用法?Java CorruptHFileException怎么用?Java CorruptHFileException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


CorruptHFileException类属于org.apache.hadoop.hbase.io.hfile包,在下文中一共展示了CorruptHFileException类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: checkHFile

import org.apache.hadoop.hbase.io.hfile.CorruptHFileException; //导入依赖的package包/类
/**
 * Checks a path to see if it is a valid hfile.
 *
 * @param p
 *          full Path to an HFile
 * @throws IOException
 *           This is a connectivity related exception
 */
protected void checkHFile(Path p) throws IOException {
  HFile.Reader r = null;
  try {
    r = HFile.createReader(fs, p, cacheConf, conf);
  } catch (CorruptHFileException che) {
    LOG.warn("Found corrupt HFile " + p, che);
    corrupted.add(p);
    if (inQuarantineMode) {
      Path dest = createQuarantinePath(p);
      LOG.warn("Quarantining corrupt HFile " + p + " into " + dest);
      boolean success = fs.mkdirs(dest.getParent());
      success = success ? fs.rename(p, dest): false;
      if (!success) {
        failures.add(p);
      } else {
        quarantined.add(dest);
      }
    }
    return;
  } catch (FileNotFoundException fnfe) {
    LOG.warn("HFile " + p + " was missing.  Likely removed due to compaction/split?");
    missing.add(p);
  } finally {
    hfilesChecked.addAndGet(1);
    if (r != null) {
      r.close(true);
    }
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:38,代码来源:HFileCorruptionChecker.java

示例2: checkHFile

import org.apache.hadoop.hbase.io.hfile.CorruptHFileException; //导入依赖的package包/类
/**
 * Checks a path to see if it is a valid hfile.
 *
 * @param p
 *          full Path to an HFile
 * @throws IOException
 *           This is a connectivity related exception
 */
protected void checkHFile(Path p) throws IOException {
  HFile.Reader r = null;
  try {
    r = HFile.createReader(fs, p, cacheConf);
  } catch (CorruptHFileException che) {
    LOG.warn("Found corrupt HFile " + p, che);
    corrupted.add(p);
    if (inQuarantineMode) {
      Path dest = createQuarantinePath(p);
      LOG.warn("Quarantining corrupt HFile " + p + " into " + dest);
      boolean success = fs.mkdirs(dest.getParent());
      success = success ? fs.rename(p, dest): false;
      if (!success) {
        failures.add(p);
      } else {
        quarantined.add(dest);
      }
    }
    return;
  } catch (FileNotFoundException fnfe) {
    LOG.warn("HFile " + p + " was missing.  Likely removed due to compaction/split?");
    missing.add(p);
  } finally {
    hfilesChecked.addAndGet(1);
    if (r != null) {
      r.close(true);
    }
  }
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:38,代码来源:HFileCorruptionChecker.java

示例3: checkHFile

import org.apache.hadoop.hbase.io.hfile.CorruptHFileException; //导入依赖的package包/类
/**
 * Checks a path to see if it is a valid hfile.
 *
 * @param p
 *          full Path to an HFile
 * @throws IOException
 *           This is a connectivity related exception
 */
protected void checkHFile(Path p) throws IOException {
  HFile.Reader r = null;
  try {
    r = HFile.createReader(fs, p, cacheConf, true, conf);
  } catch (CorruptHFileException che) {
    LOG.warn("Found corrupt HFile " + p, che);
    corrupted.add(p);
    if (inQuarantineMode) {
      Path dest = createQuarantinePath(p);
      LOG.warn("Quarantining corrupt HFile " + p + " into " + dest);
      boolean success = fs.mkdirs(dest.getParent());
      success = success ? fs.rename(p, dest): false;
      if (!success) {
        failures.add(p);
      } else {
        quarantined.add(dest);
      }
    }
    return;
  } catch (FileNotFoundException fnfe) {
    LOG.warn("HFile " + p + " was missing.  Likely removed due to compaction/split?");
    missing.add(p);
  } finally {
    hfilesChecked.addAndGet(1);
    if (r != null) {
      r.close(true);
    }
  }
}
 
开发者ID:apache,项目名称:hbase,代码行数:38,代码来源:HFileCorruptionChecker.java

示例4: checkMobFile

import org.apache.hadoop.hbase.io.hfile.CorruptHFileException; //导入依赖的package包/类
/**
 * Checks a path to see if it is a valid mob file.
 *
 * @param p
 *          full Path to a mob file.
 * @throws IOException
 *           This is a connectivity related exception
 */
protected void checkMobFile(Path p) throws IOException {
  HFile.Reader r = null;
  try {
    r = HFile.createReader(fs, p, cacheConf, true, conf);
  } catch (CorruptHFileException che) {
    LOG.warn("Found corrupt mob file " + p, che);
    corruptedMobFiles.add(p);
    if (inQuarantineMode) {
      Path dest = createQuarantinePath(p);
      LOG.warn("Quarantining corrupt mob file " + p + " into " + dest);
      boolean success = fs.mkdirs(dest.getParent());
      success = success ? fs.rename(p, dest): false;
      if (!success) {
        failureMobFiles.add(p);
      } else {
        quarantinedMobFiles.add(dest);
      }
    }
    return;
  } catch (FileNotFoundException fnfe) {
    LOG.warn("Mob file " + p + " was missing.  Likely removed due to compaction?");
    missedMobFiles.add(p);
  } finally {
    mobFilesChecked.addAndGet(1);
    if (r != null) {
      r.close(true);
    }
  }
}
 
开发者ID:apache,项目名称:hbase,代码行数:38,代码来源:HFileCorruptionChecker.java

示例5: testReadFromCorruptMobFiles

import org.apache.hadoop.hbase.io.hfile.CorruptHFileException; //导入依赖的package包/类
@Test
public void testReadFromCorruptMobFiles() throws Exception {
  final TableName tableName = TableName.valueOf(name.getMethodName());
  setUp(0, tableName);
  createRecordAndCorruptMobFile(tableName, row1, family, qf1, Bytes.toBytes("value1"));
  Get get = new Get(row1);
  IOException ioe = null;
  try {
    table.get(get);
  } catch (IOException e) {
    ioe = e;
  }
  Assert.assertNotNull(ioe);
  Assert.assertEquals(CorruptHFileException.class.getName(), ioe.getClass().getName());
}
 
开发者ID:apache,项目名称:hbase,代码行数:16,代码来源:TestMobStoreScanner.java

示例6: preScannerNext

import org.apache.hadoop.hbase.io.hfile.CorruptHFileException; //导入依赖的package包/类
@Override
public boolean preScannerNext(ObserverContext<RegionCoprocessorEnvironment> e,
  InternalScanner s, List<Result> results, int limit, boolean hasMore) throws IOException {
  throw new CorruptHFileException("For test");
}
 
开发者ID:apache,项目名称:hbase,代码行数:6,代码来源:TestScannerWithCorruptHFile.java


注:本文中的org.apache.hadoop.hbase.io.hfile.CorruptHFileException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。