本文整理汇总了Java中org.apache.hadoop.io.compress.CodecPool.returnDecompressor方法的典型用法代码示例。如果您正苦于以下问题:Java CodecPool.returnDecompressor方法的具体用法?Java CodecPool.returnDecompressor怎么用?Java CodecPool.returnDecompressor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.io.compress.CodecPool
的用法示例。
在下文中一共展示了CodecPool.returnDecompressor方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: close
import org.apache.hadoop.io.compress.CodecPool; //导入方法依赖的package包/类
/** Close the file. */
@Override
public synchronized void close() throws IOException {
// Return the decompressors to the pool
CodecPool.returnDecompressor(keyLenDecompressor);
CodecPool.returnDecompressor(keyDecompressor);
CodecPool.returnDecompressor(valLenDecompressor);
CodecPool.returnDecompressor(valDecompressor);
keyLenDecompressor = keyDecompressor = null;
valLenDecompressor = valDecompressor = null;
if (keyDeserializer != null) {
keyDeserializer.close();
}
if (valDeserializer != null) {
valDeserializer.close();
}
// Close the input-stream
in.close();
}
示例2: close
import org.apache.hadoop.io.compress.CodecPool; //导入方法依赖的package包/类
public void close() throws IOException {
// Close the underlying stream
in.close();
// Release the buffer
dataIn = null;
buffer = null;
if(readRecordsCounter != null) {
readRecordsCounter.increment(numRecordsRead);
}
// Return the decompressor
if (decompressor != null) {
decompressor.reset();
CodecPool.returnDecompressor(decompressor);
decompressor = null;
}
}
示例3: close
import org.apache.hadoop.io.compress.CodecPool; //导入方法依赖的package包/类
/** Close the file. */
public synchronized void close() throws IOException {
// Return the decompressors to the pool
CodecPool.returnDecompressor(keyLenDecompressor);
CodecPool.returnDecompressor(keyDecompressor);
CodecPool.returnDecompressor(valLenDecompressor);
CodecPool.returnDecompressor(valDecompressor);
keyLenDecompressor = keyDecompressor = null;
valLenDecompressor = valDecompressor = null;
if (keyDeserializer != null) {
keyDeserializer.close();
}
if (valDeserializer != null) {
valDeserializer.close();
}
// Close the input-stream
if(in != null) {
in.close();
}
}
示例4: close
import org.apache.hadoop.io.compress.CodecPool; //导入方法依赖的package包/类
@Override
public synchronized void close() throws IOException {
try {
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
}
示例5: close
import org.apache.hadoop.io.compress.CodecPool; //导入方法依赖的package包/类
@Override
public synchronized void close() throws IOException {
try {
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
}
示例6: close
import org.apache.hadoop.io.compress.CodecPool; //导入方法依赖的package包/类
public void close() throws IOException {
// Return the decompressor
if (decompressor != null) {
decompressor.reset();
CodecPool.returnDecompressor(decompressor);
decompressor = null;
}
// Close the underlying stream
in.close();
// Release the buffer
dataIn = null;
buffer = null;
if(readRecordsCounter != null) {
readRecordsCounter.increment(numRecordsRead);
}
}
示例7: returnDecompressor
import org.apache.hadoop.io.compress.CodecPool; //导入方法依赖的package包/类
public void returnDecompressor(Decompressor decompressor) {
if (decompressor != null) {
if(LOG.isDebugEnabled()) {
LOG.debug("Returned a decompressor: " + decompressor.hashCode());
}
CodecPool.returnDecompressor(decompressor);
}
}
示例8: close
import org.apache.hadoop.io.compress.CodecPool; //导入方法依赖的package包/类
public synchronized void close() throws IOException {
try {
if (in != null) {
in.close();
}
} finally {
if (decompressor != null) {
CodecPool.returnDecompressor(decompressor);
decompressor = null;
}
}
}
示例9: close
import org.apache.hadoop.io.compress.CodecPool; //导入方法依赖的package包/类
@Override
public synchronized void close() throws IOException {
try {
if (inputStream != null) {
inputStream.close();
inputStream = null;
}
} finally {
if (decompressor != null) {
CodecPool.returnDecompressor(decompressor);
decompressor = null;
}
}
}
示例10: close
import org.apache.hadoop.io.compress.CodecPool; //导入方法依赖的package包/类
@Override
public void close() throws IOException {
// coreInputStream.close() is called before returning of decompressor to the
// pool because coreInputStream.close() could(though currently it doesn't)
// access the decompressor.
coreInputStream.close();
if (decompressor != null) {
CodecPool.returnDecompressor(decompressor);
}
}
示例11: setNextDirectoryInputStream
import org.apache.hadoop.io.compress.CodecPool; //导入方法依赖的package包/类
private boolean setNextDirectoryInputStream() throws FileNotFoundException,
IOException {
if (input != null) {
input.close();
LOG.info("File closed: " + currentFileName);
input = null;
}
if (inputCodec != null) {
CodecPool.returnDecompressor(inputDecompressor);
inputDecompressor = null;
inputCodec = null;
}
++inputDirectoryCursor;
if (inputDirectoryCursor >= inputDirectoryFiles.length) {
return false;
}
fileFirstLine = true;
currentFileName = inputDirectoryFiles[inputDirectoryCursor];
LOG.info("\nOpening file " + currentFileName
+ " *************************** .");
LOG
.info("This file, " + (inputDirectoryCursor + 1) + "/"
+ inputDirectoryFiles.length + ", starts with line " + lineNumber
+ ".");
input =
maybeUncompressedPath(new Path(inputDirectoryPath, currentFileName));
return true;
}
示例12: close
import org.apache.hadoop.io.compress.CodecPool; //导入方法依赖的package包/类
public synchronized void close() {
try {
if(this.in != null) {
this.in.close();
}
}catch(Exception ex){
LOG.warn("Exception on close: {}", ex, ex);
} finally {
if(this.decompressor != null) {
CodecPool.returnDecompressor(this.decompressor);
}
}
}
示例13: returnDecompressor
import org.apache.hadoop.io.compress.CodecPool; //导入方法依赖的package包/类
public void returnDecompressor(Decompressor decompressor) {
if (decompressor != null) {
if (LOG.isTraceEnabled()) LOG.trace("Returning decompressor " + decompressor + " to pool.");
CodecPool.returnDecompressor(decompressor);
if (decompressor.getClass().isAnnotationPresent(DoNotPool.class)) {
if (LOG.isTraceEnabled()) LOG.trace("Ending decompressor " + decompressor);
decompressor.end();
}
}
}
示例14: close
import org.apache.hadoop.io.compress.CodecPool; //导入方法依赖的package包/类
@Override
public synchronized void close() throws IOException {
try {
if (ebr != null) {
ebr.close();
}
} finally {
if (decompressor != null) {
CodecPool.returnDecompressor(decompressor);
decompressor = null;
}
}
}
示例15: close
import org.apache.hadoop.io.compress.CodecPool; //导入方法依赖的package包/类
@Override
public void close() throws IOException {
super.close();
if (decompressor != null) {
CodecPool.returnDecompressor(decompressor);
this.decompressor = null;
}
}