Example usage for org.apache.hadoop.io.compress CodecPool returnDecompressor

List of usage examples for org.apache.hadoop.io.compress CodecPool returnDecompressor

Introduction

In this page you can find the example usage for org.apache.hadoop.io.compress CodecPool returnDecompressor.

Prototype

public static void returnDecompressor(Decompressor decompressor) 

Source Link

Document

Return the Decompressor to the pool.

Usage

From source file:org.zuinnote.hadoop.bitcoin.format.AbstractBitcoinRecordReader.java

License:Apache License

public synchronized void close() throws IOException {
    try {//from  w w  w  .ja  v a 2  s.  c  o  m
        if (bbr != null) {
            bbr.close();
        }
    } finally {
        if (decompressor != null) {
            CodecPool.returnDecompressor(decompressor);
            decompressor = null;
        }
    }
}

From source file:org.zuinnote.hadoop.office.example.MapReduceExcelInputIntegrationTest.java

License:Apache License

@AfterEach
public void tearDown() throws IOException {
    // Remove input and output directory
    dfsCluster.getFileSystem().delete(DFS_INPUT_DIR, true);
    dfsCluster.getFileSystem().delete(DFS_OUTPUT_DIR, true);
    // close any open decompressor
    for (Decompressor currentDecompressor : this.openDecompressors) {
        if (currentDecompressor != null) {
            CodecPool.returnDecompressor(currentDecompressor);
        }//from w w  w  .  j  a va2s . com
    }

}

From source file:org.zuinnote.hadoop.office.format.common.HadoopFileReader.java

License:Apache License

public void close() throws IOException {
    for (Decompressor currentDecompressor : this.openDecompressors) {
        if (currentDecompressor != null) {
            CodecPool.returnDecompressor(currentDecompressor);
        }// w  ww .j  a  va  2  s. c  om
    }
    // never close the filesystem. Causes issues with Spark
}

From source file:org.zuinnote.hadoop.office.format.mapred.AbstractSpreadSheetDocumentRecordReader.java

License:Apache License

@Override
public synchronized void close() throws IOException {
    try {/* ww w  .j  a  v a 2  s .co m*/
        if (officeReader != null) {
            officeReader.close();
        }
    } finally {
        if (decompressor != null) { // return this decompressor
            CodecPool.returnDecompressor(decompressor);
            decompressor = null;
        } // return decompressor of linked workbooks
        if (this.currentHFR != null) {
            currentHFR.close();
        }
    }
    // do not close the filesystem! will cause exceptions in Spark
}

From source file:org.zuinnote.hadoop.office.format.mapreduce.AbstractSpreadSheetDocumentRecordReader.java

License:Apache License

@Override
public synchronized void close() throws IOException {
    try {//from  w w w .  ja va  2s .com
        if (officeReader != null) {
            officeReader.close();
        }
    } finally {
        if (decompressor != null) { // return this decompressor
            CodecPool.returnDecompressor(decompressor);
            decompressor = null;
        } // return decompressor of linked workbooks
        if (this.currentHFR != null) {
            currentHFR.close();
        }
    }
    // do not close the filesystem! will cause exceptions in Spark

}