當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。