Search in sources :

Example 1 with SftpGetMonitor

use of org.apache.gobblin.source.extractor.extract.sftp.SftpFsHelper.SftpGetMonitor in project incubator-gobblin by apache.

the class SftpLightWeightFileSystem method open.

@Override
public FSDataInputStream open(Path path, int bufferSize) throws IOException {
    SftpGetMonitor monitor = new SftpGetMonitor();
    try {
        ChannelSftp channelSftp = this.fsHelper.getSftpChannel();
        InputStream is = channelSftp.get(HadoopUtils.toUriPath(path), monitor);
        return new FSDataInputStream(new BufferedFSInputStream(new SftpFsHelper.SftpFsFileInputStream(is, channelSftp), bufferSize));
    } catch (SftpException e) {
        throw new IOException(e);
    }
}
Also used : BufferedFSInputStream(org.apache.hadoop.fs.BufferedFSInputStream) ChannelSftp(com.jcraft.jsch.ChannelSftp) BufferedFSInputStream(org.apache.hadoop.fs.BufferedFSInputStream) FSDataInputStream(org.apache.hadoop.fs.FSDataInputStream) SeekableFSInputStream(org.apache.gobblin.util.io.SeekableFSInputStream) InputStream(java.io.InputStream) SftpException(com.jcraft.jsch.SftpException) FSDataInputStream(org.apache.hadoop.fs.FSDataInputStream) SftpGetMonitor(org.apache.gobblin.source.extractor.extract.sftp.SftpFsHelper.SftpGetMonitor) IOException(java.io.IOException)

Aggregations

ChannelSftp (com.jcraft.jsch.ChannelSftp)1 SftpException (com.jcraft.jsch.SftpException)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 SftpGetMonitor (org.apache.gobblin.source.extractor.extract.sftp.SftpFsHelper.SftpGetMonitor)1 SeekableFSInputStream (org.apache.gobblin.util.io.SeekableFSInputStream)1 BufferedFSInputStream (org.apache.hadoop.fs.BufferedFSInputStream)1 FSDataInputStream (org.apache.hadoop.fs.FSDataInputStream)1