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


Java UnsupportedFileSystemException类代码示例

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


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

示例1: createInternal

import org.apache.hadoop.fs.UnsupportedFileSystemException; //导入依赖的package包/类
@Override
public FSDataOutputStream createInternal(final Path f,
    final EnumSet<CreateFlag> flag, final FsPermission absolutePermission,
    final int bufferSize, final short replication, final long blockSize,
    final Progressable progress, final ChecksumOpt checksumOpt,
    final boolean createParent) throws AccessControlException,
    FileAlreadyExistsException, FileNotFoundException,
    ParentNotDirectoryException, UnsupportedFileSystemException,
    UnresolvedLinkException, IOException {
  InodeTree.ResolveResult<AbstractFileSystem> res;
  try {
    res = fsState.resolve(getUriPath(f), false);
  } catch (FileNotFoundException e) {
    if (createParent) {
      throw readOnlyMountTable("create", f);
    } else {
      throw e;
    }
  }
  assert(res.remainingPath != null);
  return res.targetFileSystem.createInternal(res.remainingPath, flag,
      absolutePermission, bufferSize, replication,
      blockSize, progress, checksumOpt,
      createParent);
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:26,代码来源:ViewFs.java

示例2: printResults

import org.apache.hadoop.fs.UnsupportedFileSystemException; //导入依赖的package包/类
protected static void printResults(PrintStream out) throws UnsupportedFileSystemException {
  out.println("Result of running LoadGenerator against fileSystem: " + 
  FileContext.getFileContext().getDefaultFileSystem().getUri());
  if (numOfOps[OPEN] != 0) {
    out.println("Average open execution time: " + 
        (double)executionTime[OPEN]/numOfOps[OPEN] + "ms");
  }
  if (numOfOps[LIST] != 0) {
    out.println("Average list execution time: " + 
        (double)executionTime[LIST]/numOfOps[LIST] + "ms");
  }
  if (numOfOps[DELETE] != 0) {
    out.println("Average deletion execution time: " + 
        (double)executionTime[DELETE]/numOfOps[DELETE] + "ms");
    out.println("Average create execution time: " + 
        (double)executionTime[CREATE]/numOfOps[CREATE] + "ms");
    out.println("Average write_close execution time: " + 
        (double)executionTime[WRITE_CLOSE]/numOfOps[WRITE_CLOSE] + "ms");
  }
  if (totalTime != 0) { 
    out.println("Average operations per second: " + 
        (double)totalOps/totalTime +"ops/s");
  }
  out.println();
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:26,代码来源:LoadGenerator.java

示例3: doAppLogAggregationPostCleanUp

import org.apache.hadoop.fs.UnsupportedFileSystemException; //导入依赖的package包/类
private void doAppLogAggregationPostCleanUp() {
  // Remove the local app-log-dirs
  List<Path> localAppLogDirs = new ArrayList<Path>();
  for (String rootLogDir : dirsHandler.getLogDirsForCleanup()) {
    Path logPath = new Path(rootLogDir, applicationId);
    try {
      // check if log dir exists
      lfs.getFileStatus(logPath);
      localAppLogDirs.add(logPath);
    } catch (UnsupportedFileSystemException ue) {
      LOG.warn("Log dir " + rootLogDir + "is an unsupported file system", ue);
      continue;
    } catch (IOException fe) {
      continue;
    }
  }

  if (localAppLogDirs.size() > 0) {
    this.delService.delete(this.userUgi.getShortUserName(), null,
      localAppLogDirs.toArray(new Path[localAppLogDirs.size()]));
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:23,代码来源:AppLogAggregatorImpl.java

示例4: FileContextLocationFactory

import org.apache.hadoop.fs.UnsupportedFileSystemException; //导入依赖的package包/类
/**
 * Creates a new instance.
 *
 * @param configuration the hadoop configuration
 * @param pathBase base path for all non-absolute location created through this {@link LocationFactory}.
 */
public FileContextLocationFactory(final Configuration configuration, String pathBase) {
  this.configuration = configuration;
  this.pathBase = new Path(pathBase.startsWith("/") ? pathBase : "/" + pathBase);

  int maxCacheSize = configuration.getInt(Configs.Keys.FILE_CONTEXT_CACHE_MAX_SIZE,
                                          Configs.Defaults.FILE_CONTEXT_CACHE_MAX_SIZE);
  this.fileContextCache = CacheBuilder
    .newBuilder()
    .weakKeys()
    .weakValues()
    .maximumSize(maxCacheSize)
    .build(new CacheLoader<UserGroupInformation, FileContext>() {
      @Override
      public FileContext load(UserGroupInformation ugi) throws Exception {
        return ugi.doAs(new PrivilegedExceptionAction<FileContext>() {
          @Override
          public FileContext run() throws UnsupportedFileSystemException {
            return FileContext.getFileContext(configuration);
          }
        });
      }
    });
}
 
开发者ID:apache,项目名称:twill,代码行数:30,代码来源:FileContextLocationFactory.java

示例5: doAppLogAggregationPostCleanUp

import org.apache.hadoop.fs.UnsupportedFileSystemException; //导入依赖的package包/类
private void doAppLogAggregationPostCleanUp() {
  // Remove the local app-log-dirs
  List<Path> localAppLogDirs = new ArrayList<Path>();
  for (String rootLogDir : dirsHandler.getLogDirsForCleanup()) {
    Path logPath = new Path(rootLogDir, userFolder +  Path.SEPARATOR + applicationId);
    try {
      // check if log dir exists
      lfs.getFileStatus(logPath);
      localAppLogDirs.add(logPath);
    } catch (UnsupportedFileSystemException ue) {
      LOG.warn("Log dir " + rootLogDir + "is an unsupported file system", ue);
      continue;
    } catch (IOException fe) {
      continue;
    }
  }

  if (localAppLogDirs.size() > 0) {
    this.delService.delete(this.userUgi.getShortUserName(), null,
      localAppLogDirs.toArray(new Path[localAppLogDirs.size()]));
  }
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:23,代码来源:AppLogAggregatorImpl.java

示例6: ViewFs

import org.apache.hadoop.fs.UnsupportedFileSystemException; //导入依赖的package包/类
/**
 * 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,代码行数:49,代码来源:ViewFs.java

示例7: getFileLinkStatus

import org.apache.hadoop.fs.UnsupportedFileSystemException; //导入依赖的package包/类
@Override
public FileStatus getFileLinkStatus(final Path f)
   throws AccessControlException, FileNotFoundException,
   UnsupportedFileSystemException, IOException {
  InodeTree.ResolveResult<AbstractFileSystem> res = 
    fsState.resolve(getUriPath(f), false); // do not follow mount link
  return res.targetFileSystem.getFileLinkStatus(res.remainingPath);
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:9,代码来源:ViewFs.java

示例8: testInvalidConfig

import org.apache.hadoop.fs.UnsupportedFileSystemException; //导入依赖的package包/类
@Test(expected=FileAlreadyExistsException.class)
public void testInvalidConfig() throws IOException, URISyntaxException {
  Configuration conf = new Configuration();
  ConfigUtil.addLink(conf, "/internalDir/linkToDir2",
      new Path("file:///dir2").toUri());
  ConfigUtil.addLink(conf, "/internalDir/linkToDir2/linkToDir3",
      new Path("file:///dir3").toUri());
  
  class Foo { };
  
   new InodeTree<Foo>(conf, null) {

    @Override
    protected
    Foo getTargetFileSystem(final URI uri)
      throws URISyntaxException, UnsupportedFileSystemException {
        return null;
    }

    @Override
    protected
    Foo getTargetFileSystem(
        org.apache.hadoop.fs.viewfs.InodeTree.INodeDir<Foo>
                                        dir)
      throws URISyntaxException {
      return null;
    }

    @Override
    protected
    Foo getTargetFileSystem(URI[] mergeFsURIList)
        throws URISyntaxException, UnsupportedFileSystemException {
      return null;
    }
  };
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:37,代码来源:TestViewFsConfig.java

示例9: setup

import org.apache.hadoop.fs.UnsupportedFileSystemException; //导入依赖的package包/类
@BeforeClass
public static void setup() throws AccessControlException,
    FileNotFoundException, UnsupportedFileSystemException, IOException {
  localFS = FileContext.getLocalFSFileContext();
  localFS.delete(new Path(localFSDirBase.getAbsolutePath()), true);
  localFSDirBase.mkdirs();
  // Do not start cluster here
}
 
开发者ID:naver,项目名称:hadoop,代码行数:9,代码来源:TestDiskFailures.java

示例10: submitDirForDeletion

import org.apache.hadoop.fs.UnsupportedFileSystemException; //导入依赖的package包/类
private void submitDirForDeletion(String userName, Path dir) {
  try {
    lfs.getFileStatus(dir);
    delService.delete(userName, dir, new Path[] {});
  } catch (UnsupportedFileSystemException ue) {
    LOG.warn("Local dir " + dir + " is an unsupported filesystem", ue);
  } catch (IOException ie) {
    // ignore
    return;
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:12,代码来源:ResourceLocalizationService.java

示例11: serviceInit

import org.apache.hadoop.fs.UnsupportedFileSystemException; //导入依赖的package包/类
@Override
protected void serviceInit(Configuration conf) throws Exception {
  try {
    //TODO Is this required?
    FileContext.getLocalFSFileContext(conf);
  } catch (UnsupportedFileSystemException e) {
    throw new YarnRuntimeException("Failed to start ContainersLauncher", e);
  }
  super.serviceInit(conf);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:11,代码来源:ContainersLauncher.java

示例12: run

import org.apache.hadoop.fs.UnsupportedFileSystemException; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public void run() {
  List<Path> localAppLogDirs = new ArrayList<Path>();
  FileContext lfs = getLocalFileContext(getConfig());
  for (String rootLogDir : dirsHandler.getLogDirsForCleanup()) {
    Path logDir = new Path(rootLogDir, applicationId.toString());
    try {
      lfs.getFileStatus(logDir);
      localAppLogDirs.add(logDir);
    } catch (UnsupportedFileSystemException ue) {
      LOG.warn("Unsupported file system used for log dir " + logDir, ue);
      continue;
    } catch (IOException ie) {
      continue;
    }
  }

  // Inform the application before the actual delete itself, so that links
  // to logs will no longer be there on NM web-UI.
  NonAggregatingLogHandler.this.dispatcher.getEventHandler().handle(
    new ApplicationEvent(this.applicationId,
      ApplicationEventType.APPLICATION_LOG_HANDLING_FINISHED));
  if (localAppLogDirs.size() > 0) {
    NonAggregatingLogHandler.this.delService.delete(user, null,
      (Path[]) localAppLogDirs.toArray(new Path[localAppLogDirs.size()]));
  }
  try {
    NonAggregatingLogHandler.this.stateStore.removeLogDeleter(
        this.applicationId);
  } catch (IOException e) {
    LOG.error("Error removing log deletion state", e);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:35,代码来源:NonAggregatingLogHandler.java

示例13: DockerContainerExecutor

import org.apache.hadoop.fs.UnsupportedFileSystemException; //导入依赖的package包/类
public DockerContainerExecutor() {
  try {
    this.lfs = FileContext.getLocalFSFileContext();
    this.dockerImagePattern = Pattern.compile(DOCKER_IMAGE_PATTERN);
  } catch (UnsupportedFileSystemException e) {
    throw new RuntimeException(e);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:9,代码来源:DockerContainerExecutor.java

示例14: getLfs

import org.apache.hadoop.fs.UnsupportedFileSystemException; //导入依赖的package包/类
static final FileContext getLfs() {
  try {
    return FileContext.getLocalFSFileContext();
  } catch (UnsupportedFileSystemException e) {
    throw new RuntimeException(e);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:8,代码来源:DeletionService.java

示例15: DefaultContainerExecutor

import org.apache.hadoop.fs.UnsupportedFileSystemException; //导入依赖的package包/类
public DefaultContainerExecutor() {
  try {
    this.lfs = FileContext.getLocalFSFileContext();
  } catch (UnsupportedFileSystemException e) {
    throw new RuntimeException(e);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:8,代码来源:DefaultContainerExecutor.java


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