Java 类org.apache.hadoop.hdfs.server.datanode.VolumeScanner.ScanResultHandler 实例源码

项目:hadoop    文件:BlockScanner.java   
@SuppressWarnings("unchecked")
Conf(Configuration conf) {
  this.targetBytesPerSec = Math.max(0L, conf.getLong(
      DFS_BLOCK_SCANNER_VOLUME_BYTES_PER_SECOND,
      DFS_BLOCK_SCANNER_VOLUME_BYTES_PER_SECOND_DEFAULT));
  this.maxStalenessMs = Math.max(0L, getUnitTestLong(conf,
      INTERNAL_DFS_BLOCK_SCANNER_MAX_STALENESS_MS,
      INTERNAL_DFS_BLOCK_SCANNER_MAX_STALENESS_MS_DEFAULT));
  this.scanPeriodMs = getConfiguredScanPeriodMs(conf);
  this.cursorSaveMs = Math.max(0L, getUnitTestLong(conf,
      INTERNAL_DFS_BLOCK_SCANNER_CURSOR_SAVE_INTERVAL_MS,
      INTERNAL_DFS_BLOCK_SCANNER_CURSOR_SAVE_INTERVAL_MS_DEFAULT));
  if (allowUnitTestSettings) {
    this.resultHandler = (Class<? extends ScanResultHandler>)
        conf.getClass(INTERNAL_VOLUME_SCANNER_SCAN_RESULT_HANDLER,
                      ScanResultHandler.class);
  } else {
    this.resultHandler = ScanResultHandler.class;
  }
}
项目:aliyun-oss-hadoop-fs    文件:BlockScanner.java   
@SuppressWarnings("unchecked")
Conf(Configuration conf) {
  this.targetBytesPerSec = Math.max(0L, conf.getLong(
      DFS_BLOCK_SCANNER_VOLUME_BYTES_PER_SECOND,
      DFS_BLOCK_SCANNER_VOLUME_BYTES_PER_SECOND_DEFAULT));
  this.maxStalenessMs = Math.max(0L, getUnitTestLong(conf,
      INTERNAL_DFS_BLOCK_SCANNER_MAX_STALENESS_MS,
      INTERNAL_DFS_BLOCK_SCANNER_MAX_STALENESS_MS_DEFAULT));
  this.scanPeriodMs = getConfiguredScanPeriodMs(conf);
  this.cursorSaveMs = Math.max(0L, getUnitTestLong(conf,
      INTERNAL_DFS_BLOCK_SCANNER_CURSOR_SAVE_INTERVAL_MS,
      INTERNAL_DFS_BLOCK_SCANNER_CURSOR_SAVE_INTERVAL_MS_DEFAULT));
  if (allowUnitTestSettings) {
    this.resultHandler = (Class<? extends ScanResultHandler>)
        conf.getClass(INTERNAL_VOLUME_SCANNER_SCAN_RESULT_HANDLER,
                      ScanResultHandler.class);
  } else {
    this.resultHandler = ScanResultHandler.class;
  }
}
项目:big-c    文件:BlockScanner.java   
@SuppressWarnings("unchecked")
Conf(Configuration conf) {
  this.targetBytesPerSec = Math.max(0L, conf.getLong(
      DFS_BLOCK_SCANNER_VOLUME_BYTES_PER_SECOND,
      DFS_BLOCK_SCANNER_VOLUME_BYTES_PER_SECOND_DEFAULT));
  this.maxStalenessMs = Math.max(0L, getUnitTestLong(conf,
      INTERNAL_DFS_BLOCK_SCANNER_MAX_STALENESS_MS,
      INTERNAL_DFS_BLOCK_SCANNER_MAX_STALENESS_MS_DEFAULT));
  this.scanPeriodMs = getConfiguredScanPeriodMs(conf);
  this.cursorSaveMs = Math.max(0L, getUnitTestLong(conf,
      INTERNAL_DFS_BLOCK_SCANNER_CURSOR_SAVE_INTERVAL_MS,
      INTERNAL_DFS_BLOCK_SCANNER_CURSOR_SAVE_INTERVAL_MS_DEFAULT));
  if (allowUnitTestSettings) {
    this.resultHandler = (Class<? extends ScanResultHandler>)
        conf.getClass(INTERNAL_VOLUME_SCANNER_SCAN_RESULT_HANDLER,
                      ScanResultHandler.class);
  } else {
    this.resultHandler = ScanResultHandler.class;
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件:BlockScanner.java   
@SuppressWarnings("unchecked")
Conf(Configuration conf) {
  this.targetBytesPerSec = Math.max(0L, conf.getLong(
      DFS_BLOCK_SCANNER_VOLUME_BYTES_PER_SECOND,
      DFS_BLOCK_SCANNER_VOLUME_BYTES_PER_SECOND_DEFAULT));
  this.maxStalenessMs = Math.max(0L, getUnitTestLong(conf,
      INTERNAL_DFS_BLOCK_SCANNER_MAX_STALENESS_MS,
      INTERNAL_DFS_BLOCK_SCANNER_MAX_STALENESS_MS_DEFAULT));
  this.scanPeriodMs = Math.max(0L,
      getUnitTestLong(conf, INTERNAL_DFS_DATANODE_SCAN_PERIOD_MS,
          TimeUnit.MILLISECONDS.convert(conf.getLong(
              DFS_DATANODE_SCAN_PERIOD_HOURS_KEY,
              DFS_DATANODE_SCAN_PERIOD_HOURS_DEFAULT), TimeUnit.HOURS)));
  this.cursorSaveMs = Math.max(0L, getUnitTestLong(conf,
      INTERNAL_DFS_BLOCK_SCANNER_CURSOR_SAVE_INTERVAL_MS,
      INTERNAL_DFS_BLOCK_SCANNER_CURSOR_SAVE_INTERVAL_MS_DEFAULT));
  if (allowUnitTestSettings) {
    this.resultHandler = (Class<? extends ScanResultHandler>)
        conf.getClass(INTERNAL_VOLUME_SCANNER_SCAN_RESULT_HANDLER,
                      ScanResultHandler.class);
  } else {
    this.resultHandler = ScanResultHandler.class;
  }
}