当前位置: 首页>>代码示例>>Java>>正文


Java CodecPool.returnDecompressor方法代码示例

本文整理汇总了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();
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:22,代码来源:SequenceFile.java

示例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;
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:19,代码来源:IFile.java

示例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();
  }
}
 
开发者ID:JasonBian,项目名称:azkaban,代码行数:23,代码来源:AzkabanSequenceFileReader.java

示例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
 
}
 
开发者ID:ZuInnoTe,项目名称:hadoopoffice,代码行数:19,代码来源:AbstractSpreadSheetDocumentRecordReader.java

示例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
}
 
开发者ID:ZuInnoTe,项目名称:hadoopoffice,代码行数:18,代码来源:AbstractSpreadSheetDocumentRecordReader.java

示例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);
  }
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:19,代码来源:IFile.java

示例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);
  }
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:9,代码来源:Compression.java

示例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;
    }
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:13,代码来源:LineRecordReader.java

示例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;
    }
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:15,代码来源:FixedLengthRecordReader.java

示例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);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:12,代码来源:PossiblyDecompressedInputStream.java

示例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;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:37,代码来源:HadoopLogsAnalyzer.java

示例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);
        }

    }
}
 
开发者ID:Comcast,项目名称:spark-util,代码行数:15,代码来源:ErrorHandlingLineRecordReader.java

示例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();
    }
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:11,代码来源:Compression.java

示例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;
      }
    }
  }
 
开发者ID:ZuInnoTe,项目名称:hadoopcryptoledger,代码行数:14,代码来源:AbstractEthereumRecordReader.java

示例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;
    }
}
 
开发者ID:apache,项目名称:incubator-hivemall,代码行数:9,代码来源:HadoopUtils.java


注:本文中的org.apache.hadoop.io.compress.CodecPool.returnDecompressor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。