I'm trying to unzip a very large .gz file in java around 50MB and then transferring it to hadoop file system. After unzipping, the file size becomes 20 GB. It takes more than 5 min to do this job.
protected void write(BufferedInputStream bis, Path outputPath, FileSystem hdfs) throws IOException
{
BufferedOutputStream bos = new BufferedOutputStream(hdfs.create(outputPath));
IOUtils.copyBytes(bis, bos, 8*1024);
}
Even after using Buffered I/O streams, it is taking very long to decompress and transfer the file.
Does Hadoop is causing file transfer to be slow or GZIPInputStream is slow?