类org.apache.hadoop.fs.FSError源码实例Demo

下面列出了怎么用org.apache.hadoop.fs.FSError的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: dremio-oss   文件: HadoopFileSystem.java
/**
 * Canonicalizes a path if supported by the filesystem
 *
 * @param fs   the filesystem to use
 * @param path the path to canonicalize
 * @return the canonicalized path, or the same path if not supported by the filesystem.
 * @throws IOException
 */
public static Path canonicalizePath(org.apache.hadoop.fs.FileSystem fs, Path path) throws IOException {
  try {
    if (fs instanceof PathCanonicalizer) {
      final org.apache.hadoop.fs.Path hadoopPath = toHadoopPath(path);
      final org.apache.hadoop.fs.Path result = ((PathCanonicalizer) fs).canonicalizePath(hadoopPath);
      if (hadoopPath == result) {
        return path;
      }
      return fromHadoopPath(result);
    }
    return path;
  } catch (FSError e) {
    throw propagateFSError(e);
  }
}
 
源代码2 项目: dremio-oss   文件: HadoopFileSystemWrapper.java
@Override
@Deprecated
public FSDataOutputStream createNonRecursive(Path f, FsPermission permission, boolean overwrite, int bufferSize,
    short replication, long blockSize, Progressable progress) throws IOException {
  try (WaitRecorder recorder = OperatorStats.getWaitRecorder(operatorStats)) {
    return newFSDataOutputStreamWrapper(underlyingFs.createNonRecursive(f, permission, overwrite, bufferSize, replication,
        blockSize, progress));
  } catch(FSError e) {
    throw propagateFSError(e);
  }
}
 
源代码3 项目: dremio-oss   文件: FSDataInputStreamWrapper.java
@Override
public int read(ByteBuffer dst) throws IOException {
  try {
    return underlyingIs.read(dst);
  } catch(FSError e) {
    throw DremioHadoopFileSystemWrapper.propagateFSError(e);
  }
}
 
源代码4 项目: dremio-oss   文件: FSDataOutputStreamWrapper.java
@Override
public void write(int b) throws IOException {
  try {
    underlyingOS.write(b);
  } catch(FSError e) {
    throw propagateFSError(e);
  }
}
 
源代码5 项目: dremio-oss   文件: FSDataInputStreamWrapper.java
@Override
public int available() throws IOException {
  try {
    return underlyingIs.available();
  } catch(FSError e) {
    throw DremioHadoopFileSystemWrapper.propagateFSError(e);
  }
}
 
源代码6 项目: dremio-oss   文件: FSDataOutputStreamWrapper.java
@Override
public void hflush() throws IOException {
  try {
    underlyingOS.hflush();
  } catch(FSError e) {
    throw propagateFSError(e);
  }
}
 
源代码7 项目: dremio-oss   文件: HadoopFileSystem.java
@Override
public void setPermission(Path p, Set<PosixFilePermission> permissions) throws IOException {
  try (WaitRecorder recorder = OperatorStats.getWaitRecorder(operatorStats)) {
    underlyingFs.setPermission(toHadoopPath(p), toFsPermission(permissions));
  } catch (FSError e) {
    throw propagateFSError(e);
  }
}
 
源代码8 项目: dremio-oss   文件: HadoopFileSystemWrapper.java
@Override
@Deprecated
public boolean delete(Path f) throws IOException {
  try (WaitRecorder recorder = OperatorStats.getWaitRecorder(operatorStats)) {
    return underlyingFs.delete(f);
  } catch(FSError e) {
    throw propagateFSError(e);
  }
}
 
源代码9 项目: dremio-oss   文件: FSDataOutputStreamWrapper.java
@Override
public void flush() throws IOException {
  try {
    underlyingOS.flush();
  } catch(FSError e) {
    propagateFSError(e);
  }
}
 
源代码10 项目: dremio-oss   文件: HadoopFileSystemWrapper.java
@Override
public boolean createNewFile(Path f) throws IOException {
 try (WaitRecorder recorder = OperatorStats.getWaitRecorder(operatorStats)) {
    return underlyingFs.createNewFile(f);
  } catch(FSError e) {
    throw propagateFSError(e);
  }
}
 
源代码11 项目: dremio-oss   文件: FSDataInputStreamWrapper.java
@Override
public long skip(long n) throws IOException {
  try {
    return is.skip(n);
  } catch(FSError e) {
    throw HadoopFileSystemWrapper.propagateFSError(e);
  }
}
 
源代码12 项目: dremio-oss   文件: HadoopFileSystem.java
@Override
public DirectoryStream<FileAttributes> glob(Path pattern, Predicate<Path> filter)
  throws FileNotFoundException, IOException {
  try (WaitRecorder recorder = OperatorStats.getWaitRecorder(operatorStats)) {
    return new ArrayDirectoryStream(underlyingFs.globStatus(toHadoopPath(pattern), toPathFilter(filter)));
  } catch (FSError e) {
    throw propagateFSError(e);
  }
}
 
源代码13 项目: dremio-oss   文件: FSDataOutputStreamWrapper.java
@Override
public void write(byte[] b) throws IOException {
  try {
    underlyingOS.write(b);
  } catch(FSError e) {
    throw propagateFSError(e);
  }
}
 
源代码14 项目: dremio-oss   文件: DremioHadoopFileSystemWrapper.java
@Override
public boolean isDirectory(Path f) throws IOException {
  final org.apache.hadoop.fs.Path p = toHadoopPath(f);
  boolean exists = false;
  try (WaitRecorder recorder = OperatorStats.getWaitRecorder(operatorStats)) {
    exists = underlyingFs.isDirectory(p);
    if (!exists && isNAS) {
      forceRefresh(f);
      exists = underlyingFs.isDirectory(p);
    }
  } catch(FSError e) {
    throw propagateFSError(e);
  }
  return exists;
}
 
源代码15 项目: dremio-oss   文件: HadoopFileSystem.java
@Override
public boolean isDirectory(Path f) throws IOException {
  final org.apache.hadoop.fs.Path p = toHadoopPath(f);
  boolean exists = false;
  try (WaitRecorder recorder = OperatorStats.getWaitRecorder(operatorStats)) {
    exists = underlyingFs.isDirectory(p);
    if (!exists && isNAS) {
      forceRefresh(f);
      exists = underlyingFs.isDirectory(p);
    }
  } catch (FSError e) {
    throw propagateFSError(e);
  }
  return exists;
}
 
源代码16 项目: dremio-oss   文件: FSDataInputStreamWrapper.java
@Override
public long skip(long n) throws IOException {
  try {
    return underlyingIs.skip(n);
  } catch(FSError e) {
    throw DremioHadoopFileSystemWrapper.propagateFSError(e);
  }
}
 
源代码17 项目: dremio-oss   文件: FSDataInputStreamWrapper.java
@Override
public void reset() throws IOException {
  try {
    underlyingIs.reset();
  } catch(FSError e) {
    throw DremioHadoopFileSystemWrapper.propagateFSError(e);
  }
}
 
源代码18 项目: dremio-oss   文件: FSDataInputStreamWrapper.java
@Override
public int available() throws IOException {
  try{
    return is.available();
  } catch(FSError e) {
    throw HadoopFileSystemWrapper.propagateFSError(e);
  }
}
 
源代码19 项目: dremio-oss   文件: FSDataInputStreamWrapper.java
/**
 * Most of the read are going to be block reads which use {@link #read(byte[], int,
 * int)}. So not adding stats for single byte reads.
 */
@Override
public int read() throws IOException {
  try {
    return is.read();
  } catch(FSError e) {
    throw HadoopFileSystemWrapper.propagateFSError(e);
  }
}
 
源代码20 项目: dremio-oss   文件: HadoopFileSystemWrapper.java
@Override
public void copyFromLocalFile(boolean delSrc, boolean overwrite, Path[] srcs, Path dst) throws IOException {
  try (WaitRecorder recorder = OperatorStats.getWaitRecorder(operatorStats)) {
    underlyingFs.copyFromLocalFile(delSrc, overwrite, srcs, dst);
  } catch(FSError e) {
    throw propagateFSError(e);
  }
}
 
源代码21 项目: dremio-oss   文件: FSDataOutputStreamWrapper.java
@Override
public void setDropBehind(Boolean dropBehind) throws IOException {
  try {
    underlyingOS.setDropBehind(dropBehind);
  } catch(FSError e) {
    throw propagateFSError(e);
  }
}
 
源代码22 项目: dremio-oss   文件: DremioHadoopFileSystemWrapper.java
@Override
public FSOutputStream create(Path f) throws IOException {
  try (WaitRecorder recorder = OperatorStats.getWaitRecorder(operatorStats)) {
    return newFSDataOutputStreamWrapper(underlyingFs.create(toHadoopPath(f)), f.toString());
  } catch(FSError e) {
    throw propagateFSError(e);
  }
}
 
源代码23 项目: dremio-oss   文件: FSDataOutputStreamWrapper.java
@Override
public void setDropBehind(Boolean dropBehind) throws IOException {
  try {
    underlyingOS.setDropBehind(dropBehind);
  } catch(FSError e) {
    throw propagateFSError(e);
  }
}
 
源代码24 项目: dremio-oss   文件: FSDataInputStreamWrapper.java
@Override
public int read(byte[] b, int off, int len) throws IOException {
  try {
    return underlyingIs.read(b, off, len);
  } catch(FSError e) {
    throw HadoopFileSystem.propagateFSError(e);
  }
}
 
源代码25 项目: dremio-oss   文件: FSDataInputStreamWrapper.java
@Override
public int read(ByteBuffer dst) throws IOException {
  try {
    return underlyingIs.read(dst);
  } catch(FSError e) {
    throw HadoopFileSystem.propagateFSError(e);
  }
}
 
源代码26 项目: dremio-oss   文件: HadoopFileSystemWrapper.java
@Override
public byte[] getXAttr(final Path path, final String name) throws IOException {
  try (WaitRecorder recorder = OperatorStats.getWaitRecorder(operatorStats)) {
    return underlyingFs.getXAttr(path, name);
  } catch(FSError e) {
    throw propagateFSError(e);
  }
}
 
源代码27 项目: dremio-oss   文件: FSDataOutputStreamWrapper.java
@Override
public void write(byte[] b) throws IOException {
  try {
    underlyingOS.write(b);
  } catch(FSError e) {
    throw propagateFSError(e);
  }
}
 
源代码28 项目: dremio-oss   文件: FSDataInputStreamWrapper.java
@Override
public void setDropBehind(Boolean dropBehind) throws IOException, UnsupportedOperationException {
  try {
    underlyingIs.setDropBehind(dropBehind);
  } catch(FSError e) {
    throw HadoopFileSystemWrapper.propagateFSError(e);
  }
}
 
源代码29 项目: dremio-oss   文件: FSDataInputStreamWrapper.java
@Override
public int available() throws IOException {
  try {
    return underlyingIs.available();
  } catch(FSError e) {
    throw HadoopFileSystem.propagateFSError(e);
  }
}
 
源代码30 项目: dremio-oss   文件: FSDataOutputStreamWrapper.java
@Override
public void flush() throws IOException {
  try {
    underlyingOS.flush();
  } catch(FSError e) {
    propagateFSError(e);
  }
}
 
 类所在包
 同包方法