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


Java FsConstants.VIEWFS_SCHEME属性代码示例

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


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

示例1: ViewFs

/**
 * This constructor has the signature needed by
 * {@link AbstractFileSystem#createFileSystem(URI, Configuration)}.
 * 
 * @param theUri which must be that of ViewFs
 * @param conf
 * @throws IOException
 * @throws URISyntaxException 
 */
ViewFs(final URI theUri, final Configuration conf) throws IOException,
    URISyntaxException {
  super(theUri, FsConstants.VIEWFS_SCHEME, false, -1);
  creationTime = Time.now();
  ugi = UserGroupInformation.getCurrentUser();
  config = conf;
  // Now build  client side view (i.e. client side mount table) from config.
  String authority = theUri.getAuthority();
  fsState = new InodeTree<AbstractFileSystem>(conf, authority) {

    @Override
    protected
    AbstractFileSystem getTargetFileSystem(final URI uri)
      throws URISyntaxException, UnsupportedFileSystemException {
        String pathString = uri.getPath();
        if (pathString.isEmpty()) {
          pathString = "/";
        }
        return new ChRootedFs(
            AbstractFileSystem.createFileSystem(uri, config),
            new Path(pathString));
    }

    @Override
    protected
    AbstractFileSystem getTargetFileSystem(
        final INodeDir<AbstractFileSystem> dir) throws URISyntaxException {
      return new InternalDirOfViewFs(dir, creationTime, ugi, getUri());
    }

    @Override
    protected
    AbstractFileSystem getTargetFileSystem(URI[] mergeFsURIList)
        throws URISyntaxException, UnsupportedFileSystemException {
      throw new UnsupportedFileSystemException("mergefs not implemented yet");
      // return MergeFs.createMergeFs(mergeFsURIList, config);
    }
  };
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:48,代码来源:ViewFs.java

示例2: InternalDirOfViewFs

public InternalDirOfViewFs(final InodeTree.INodeDir<AbstractFileSystem> dir,
    final long cTime, final UserGroupInformation ugi, final URI uri)
  throws URISyntaxException {
  super(FsConstants.VIEWFS_URI, FsConstants.VIEWFS_SCHEME, false, -1);
  theInternalDir = dir;
  creationTime = cTime;
  this.ugi = ugi;
  myUri = uri;
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:9,代码来源:ViewFs.java

示例3: setUp

@Override
@Before
public void setUp() throws Exception {
  // create the test root on local_fs
  fsTarget = FileSystem.getLocal(new Configuration());
  super.setUp(); // this sets up conf (and fcView which we replace)

  // Now create a viewfs using a mount table called "default"
  // hence viewfs://default/
  schemeWithAuthority = 
    new URI(FsConstants.VIEWFS_SCHEME, "default", "/", null, null);
  fsView = FileSystem.get(schemeWithAuthority, conf);
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:13,代码来源:TestViewFileSystemWithAuthorityLocalFileSystem.java

示例4: setUp

@Override
@Before
public void setUp() throws Exception {
  // create the test root on local_fs
  fcTarget = FileContext.getLocalFSFileContext();
  super.setUp(); // this sets up conf (and fcView which we replace)
  
  // Now create a viewfs using a mount table called "default"
  // hence viewfs://default/
  schemeWithAuthority = 
    new URI(FsConstants.VIEWFS_SCHEME, "default", "/", null, null);
  fcView = FileContext.getFileContext(schemeWithAuthority, conf);  
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:13,代码来源:TestViewFsWithAuthorityLocalFs.java

示例5: initialize

/**
 * Called after a new FileSystem instance is constructed.
 * @param theUri a uri whose authority section names the host, port, etc. for
 *          this FileSystem
 * @param conf the configuration
 */
@Override
public void initialize(final URI theUri, final Configuration conf)
    throws IOException {
  super.initialize(theUri, conf);
  setConf(conf);
  config = conf;
  // Now build  client side view (i.e. client side mount table) from config.
  final String authority = theUri.getAuthority();
  try {
    myUri = new URI(FsConstants.VIEWFS_SCHEME, authority, "/", null, null);
    fsState = new InodeTree<FileSystem>(conf, authority) {

      @Override
      protected
      FileSystem getTargetFileSystem(final URI uri)
        throws URISyntaxException, IOException {
          return new ChRootedFileSystem(uri, config);
      }

      @Override
      protected
      FileSystem getTargetFileSystem(final INodeDir<FileSystem> dir)
        throws URISyntaxException {
        return new InternalDirOfViewFs(dir, creationTime, ugi, myUri);
      }

      @Override
      protected
      FileSystem getTargetFileSystem(URI[] mergeFsURIList)
          throws URISyntaxException, UnsupportedFileSystemException {
        throw new UnsupportedFileSystemException("mergefs not implemented");
        // return MergeFs.createMergeFs(mergeFsURIList, config);
      }
    };
    workingDir = this.getHomeDirectory();
  } catch (URISyntaxException e) {
    throw new IOException("URISyntax exception: " + theUri);
  }

}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:46,代码来源:ViewFileSystem.java


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