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


Java FsDatasetSpi.Factory方法代码示例

本文整理汇总了Java中org.apache.hadoop.hdfs.server.datanode.fsdataset.FsDatasetSpi.Factory方法的典型用法代码示例。如果您正苦于以下问题:Java FsDatasetSpi.Factory方法的具体用法?Java FsDatasetSpi.Factory怎么用?Java FsDatasetSpi.Factory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.hdfs.server.datanode.fsdataset.FsDatasetSpi的用法示例。


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

示例1: initStorage

import org.apache.hadoop.hdfs.server.datanode.fsdataset.FsDatasetSpi; //导入方法依赖的package包/类
/**
 * Initializes the {@link #data}. The initialization is done only once, when
 * handshake with the the first namenode is completed.
 */
private void initStorage(final NamespaceInfo nsInfo) throws IOException {
  final FsDatasetSpi.Factory<? extends FsDatasetSpi<?>> factory
      = FsDatasetSpi.Factory.getFactory(conf);
  
  if (!factory.isSimulated()) {
    final StartupOption startOpt = getStartupOption(conf);
    if (startOpt == null) {
      throw new IOException("Startup option not set.");
    }
    final String bpid = nsInfo.getBlockPoolID();
    //read storage info, lock data dirs and transition fs state if necessary
    storage.recoverTransitionRead(this, bpid, nsInfo, dataDirs, startOpt);
    final StorageInfo bpStorage = storage.getBPStorage(bpid);
    LOG.info("Setting up storage: nsid=" + bpStorage.getNamespaceID()
        + ";bpid=" + bpid + ";lv=" + storage.getLayoutVersion()
        + ";nsInfo=" + nsInfo);
  }

  synchronized(this)  {
    if (data == null) {
      data = factory.newInstance(this, storage, conf);
    }
  }
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:29,代码来源:DataNode.java

示例2: initStorage

import org.apache.hadoop.hdfs.server.datanode.fsdataset.FsDatasetSpi; //导入方法依赖的package包/类
/**
 * Initializes the {@link #data}. The initialization is done only once, when
 * handshake with the the first namenode is completed.
 */
private void initStorage(final NamespaceInfo nsInfo) throws IOException {
  final FsDatasetSpi.Factory<? extends FsDatasetSpi<?>> factory =
      FsDatasetSpi.Factory.getFactory(conf);
  
  if (!factory.isSimulated()) {
    final StartupOption startOpt = getStartupOption(conf);
    if (startOpt == null) {
      throw new IOException("Startup option not set.");
    }
    final String bpid = nsInfo.getBlockPoolID();
    //read storage info, lock data dirs and transition fs state if necessary
    storage.recoverTransitionRead(this, bpid, nsInfo, dataDirs, startOpt);
    final StorageInfo bpStorage = storage.getBPStorage(bpid);
    LOG.info(
        "Setting up storage: nsid=" + bpStorage.getNamespaceID() + ";bpid=" +
            bpid + ";lv=" + storage.getLayoutVersion() + ";nsInfo=" + nsInfo);
  }

  synchronized (this) {
    if (data == null) {
      data = factory.newInstance(this, storage, conf);
    }
  }
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:29,代码来源:DataNode.java

示例3: initStorage

import org.apache.hadoop.hdfs.server.datanode.fsdataset.FsDatasetSpi; //导入方法依赖的package包/类
/**
 * Initializes the {@link #data}. The initialization is done only once, when
 * handshake with the the first namenode is completed.
 */
private void initStorage(final NamespaceInfo nsInfo) throws IOException {
  final FsDatasetSpi.Factory<? extends FsDatasetSpi<?>> factory
      = FsDatasetSpi.Factory.getFactory(conf);
  
  if (!factory.isSimulated()) {
    final StartupOption startOpt = getStartupOption(conf);
    if (startOpt == null) {
      throw new IOException("Startup option not set.");
    }
    final String bpid = nsInfo.getBlockPoolID();
    //read storage info, lock data dirs and transition fs state if necessary
    synchronized (this) {
      storage.recoverTransitionRead(this, nsInfo, dataDirs, startOpt);
    }
    final StorageInfo bpStorage = storage.getBPStorage(bpid);
    LOG.info("Setting up storage: nsid=" + bpStorage.getNamespaceID()
        + ";bpid=" + bpid + ";lv=" + storage.getLayoutVersion()
        + ";nsInfo=" + nsInfo + ";dnuuid=" + storage.getDatanodeUuid());
  }

  // If this is a newly formatted DataNode then assign a new DatanodeUuid.
  checkDatanodeUuid();

  synchronized(this)  {
    if (data == null) {
      data = factory.newInstance(this, storage, conf);
    }
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:34,代码来源:DataNode.java

示例4: testFSDatasetFactory

import org.apache.hadoop.hdfs.server.datanode.fsdataset.FsDatasetSpi; //导入方法依赖的package包/类
@Test
public void testFSDatasetFactory() {
  final Configuration conf = new Configuration();
  FsDatasetSpi.Factory<?> f = FsDatasetSpi.Factory.getFactory(conf);
  assertEquals(FsDatasetFactory.class, f.getClass());
  assertFalse(f.isSimulated());

  SimulatedFSDataset.setFactory(conf);
  FsDatasetSpi.Factory<?> s = FsDatasetSpi.Factory.getFactory(conf);
  assertEquals(SimulatedFSDataset.Factory.class, s.getClass());
  assertTrue(s.isSimulated());
}
 
开发者ID:naver,项目名称:hadoop,代码行数:13,代码来源:TestSimulatedFSDataset.java

示例5: initStorage

import org.apache.hadoop.hdfs.server.datanode.fsdataset.FsDatasetSpi; //导入方法依赖的package包/类
/**
 * Initializes the {@link #data}. The initialization is done only once, when
 * handshake with the the first namenode is completed.
 */
private void initStorage(final NamespaceInfo nsInfo) throws IOException {
  final FsDatasetSpi.Factory<? extends FsDatasetSpi<?>> factory
      = FsDatasetSpi.Factory.getFactory(conf);
  
  if (!factory.isSimulated()) {
    final StartupOption startOpt = getStartupOption(conf);
    if (startOpt == null) {
      throw new IOException("Startup option not set.");
    }
    final String bpid = nsInfo.getBlockPoolID();
    //read storage info, lock data dirs and transition fs state if necessary
    synchronized (this) {
      storage.recoverTransitionRead(this, bpid, nsInfo, dataDirs, startOpt);
    }
    final StorageInfo bpStorage = storage.getBPStorage(bpid);
    LOG.info("Setting up storage: nsid=" + bpStorage.getNamespaceID()
        + ";bpid=" + bpid + ";lv=" + storage.getLayoutVersion()
        + ";nsInfo=" + nsInfo + ";dnuuid=" + storage.getDatanodeUuid());
  }

  // If this is a newly formatted DataNode then assign a new DatanodeUuid.
  checkDatanodeUuid();

  synchronized(this)  {
    if (data == null) {
      data = factory.newInstance(this, storage, conf);
    }
  }
}
 
开发者ID:yncxcw,项目名称:FlexMap,代码行数:34,代码来源:DataNode.java

示例6: initStorage

import org.apache.hadoop.hdfs.server.datanode.fsdataset.FsDatasetSpi; //导入方法依赖的package包/类
/**
 * Initializes the {@link #data}. The initialization is done only once, when
 * handshake with the the first namenode is completed.
 */
private void initStorage(final NamespaceInfo nsInfo) throws IOException {
  final FsDatasetSpi.Factory<? extends FsDatasetSpi<?>> factory
      = FsDatasetSpi.Factory.getFactory(conf);
  
  if (!factory.isSimulated()) {
    final StartupOption startOpt = getStartupOption(conf);
    if (startOpt == null) {
      throw new IOException("Startup option not set.");
    }
    final String bpid = nsInfo.getBlockPoolID();
    //read storage info, lock data dirs and transition fs state if necessary
    storage.recoverTransitionRead(this, bpid, nsInfo, dataDirs, startOpt);
    final StorageInfo bpStorage = storage.getBPStorage(bpid);
    LOG.info("Setting up storage: nsid=" + bpStorage.getNamespaceID()
        + ";bpid=" + bpid + ";lv=" + storage.getLayoutVersion()
        + ";nsInfo=" + nsInfo + ";dnuuid=" + storage.getDatanodeUuid());
  }

  // If this is a newly formatted DataNode then assign a new DatanodeUuid.
  checkDatanodeUuid();

  synchronized(this)  {
    if (data == null) {
      data = factory.newInstance(this, storage, conf);
    }
  }
}
 
开发者ID:Seagate,项目名称:hadoop-on-lustre2,代码行数:32,代码来源:DataNode.java


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