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


Java FSError类代码示例

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


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

示例1: test

import org.apache.hadoop.fs.FSError; //导入依赖的package包/类
@Test
public void test() throws Exception {
  assumeNonMaprProfile();
  final IOException ioException = new IOException("test io exception");
  final FSError fsError = newFSError(ioException);
  FileSystem underlyingFS = mock(FileSystem.class, new Answer<Object>() {
    @Override
    public Object answer(InvocationOnMock invocation) throws Throwable {
      if (!invocation.getMethod().getName().equals("getScheme")) {
        throw fsError;
      }
      return "mockfs";
    }
  });
  Configuration conf = new Configuration(false);
  FileSystemWrapper fsw = new FileSystemWrapper(conf, underlyingFS, null);
  Object[] params = FSErrorTestUtils.getDummyArguments(method);
  try {
    method.invoke(fsw, params);
  } catch(InvocationTargetException e) {
    assertThat(e.getTargetException(), is(instanceOf(IOException.class)));
    assertThat((IOException) e.getTargetException(), is(sameInstance(ioException)));
  }
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:25,代码来源:TestFileSystemWrapperFSError.java

示例2: test

import org.apache.hadoop.fs.FSError; //导入依赖的package包/类
@Test
public void test() throws Exception {
  assumeNonMaprProfile();
  final IOException ioException = new IOException("test io exception");
  final FSError fsError = newFSError(ioException);
  FSDataOutputStream fdos = mock(FSDataOutputStream.class, new Answer<Object>() {
    @Override
    public Object answer(InvocationOnMock invocation) throws Throwable {
      throw fsError;
    }
  });

  FSDataOutputStreamWrapper fdosw = new FSDataOutputStreamWrapper(fdos);
  Object[] params = getDummyArguments(method);
  try {
    method.invoke(fdosw, params);
  } catch(InvocationTargetException e) {
    assertThat(e.getTargetException(), is(instanceOf(IOException.class)));
    assertThat((IOException) e.getTargetException(), is(sameInstance(ioException)));
  }
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:22,代码来源:TestFSDataOutputStreamWrapper.java

示例3: open

import org.apache.hadoop.fs.FSError; //导入依赖的package包/类
/**
 * If OperatorStats are provided return a instrumented {@link org.apache.hadoop.fs.FSDataInputStream}.
 */
@Override
public FSDataInputStream open(Path f, int bufferSize) throws IOException {
  try {
    return newFSDataInputStreamWrapper(f, underlyingFs.open(f, bufferSize));
  } catch(FSError e) {
    throw propagateFSError(e);
  }
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:12,代码来源:FileSystemWrapper.java

示例4: initialize

import org.apache.hadoop.fs.FSError; //导入依赖的package包/类
@Override
public void initialize(URI name, Configuration conf) throws IOException {
  try {
    underlyingFs.initialize(name, conf);
  } catch(FSError e) {
    throw propagateFSError(e);
  }
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:9,代码来源:FileSystemWrapper.java

示例5: create

import org.apache.hadoop.fs.FSError; //导入依赖的package包/类
@Override
public FSDataOutputStream create(Path f) throws IOException {
  try {
    return newFSDataOutputStreamWrapper(underlyingFs.create(f));
  } catch(FSError e) {
    throw propagateFSError(e);
  }
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:9,代码来源:FileSystemWrapper.java

示例6: available

import org.apache.hadoop.fs.FSError; //导入依赖的package包/类
@Override
public int available() throws IOException {
  try {
    return underlyingIs.available();
  } catch(FSError e) {
    throw FileSystemWrapper.propagateFSError(e);
  }
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:9,代码来源:FSDataInputStreamWrapper.java

示例7: reset

import org.apache.hadoop.fs.FSError; //导入依赖的package包/类
@Override
public synchronized void reset() throws IOException {
  try {
    is.reset();
  } catch(FSError e) {
    throw FileSystemWrapper.propagateFSError(e);
  }
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:9,代码来源:FSDataInputStreamWrapper.java

示例8: getFileStatus

import org.apache.hadoop.fs.FSError; //导入依赖的package包/类
@Override
public FileStatus getFileStatus(Path f) throws IOException {
  try {
    return underlyingFs.getFileStatus(f);
  } catch(FSError e) {
    throw propagateFSError(e);
  }
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:9,代码来源:FileSystemWrapper.java

示例9: hflush

import org.apache.hadoop.fs.FSError; //导入依赖的package包/类
@Override
public void hflush() throws IOException {
  try {
    underlyingOS.hflush();
  } catch(FSError e) {
    throw propagateFSError(e);
  }
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:9,代码来源:FSDataOutputStreamWrapper.java

示例10: getFileLinkStatus

import org.apache.hadoop.fs.FSError; //导入依赖的package包/类
@Override
public FileStatus getFileLinkStatus(Path f) throws AccessControlException, FileNotFoundException,
    UnsupportedFileSystemException, IOException {
  try {
    return underlyingFs.getFileLinkStatus(f);
  } catch(FSError e) {
    throw propagateFSError(e);
  }
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:10,代码来源:FileSystemWrapper.java

示例11: readFully

import org.apache.hadoop.fs.FSError; //导入依赖的package包/类
@Override
public void readFully(long position, byte[] buffer, int offset, int length) throws IOException {
  try {
    underlyingIs.readFully(position, buffer, offset, length);
  } catch(FSError e) {
    throw FileSystemWrapper.propagateFSError(e);
  }
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:9,代码来源:FSDataInputStreamWrapper.java

示例12: getFileChecksum

import org.apache.hadoop.fs.FSError; //导入依赖的package包/类
@Override
public FileChecksum getFileChecksum(Path f) throws IOException {
  try {
    return underlyingFs.getFileChecksum(f);
  } catch(FSError e) {
    throw propagateFSError(e);
  }
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:9,代码来源:FileSystemWrapper.java

示例13: getPos

import org.apache.hadoop.fs.FSError; //导入依赖的package包/类
@Override
public long getPos() throws IOException {
  try {
    return underlyingOS.getPos();
  } catch(FSError e) {
    throw propagateFSError(e);
  }
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:9,代码来源:FSDataOutputStreamWrapper.java

示例14: getStatus

import org.apache.hadoop.fs.FSError; //导入依赖的package包/类
@Override
public FsStatus getStatus(Path p) throws IOException {
  try {
    return underlyingFs.getStatus(p);
  } catch(FSError e) {
    throw propagateFSError(e);
  }
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:9,代码来源:FileSystemWrapper.java

示例15: setPermission

import org.apache.hadoop.fs.FSError; //导入依赖的package包/类
@Override
public void setPermission(Path p, FsPermission permission) throws IOException {
  try {
    underlyingFs.setPermission(p, permission);
  } catch(FSError e) {
    throw propagateFSError(e);
  }
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:9,代码来源:FileSystemWrapper.java


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