コード例 #1
0
ファイル: Store.java プロジェクト: Jeff-Johny/elasticsearch
 @Override
 public IndexInput openInput(String name, IOContext context) throws IOException {
   ensureOpen();
   StoreFileMetaData metaData = filesMetadata.get(name);
   if (metaData == null) {
     throw new FileNotFoundException(name);
   }
   IndexInput in = metaData.directory().openInput(name, context);
   boolean success = false;
   try {
     // Only for backward comp. since we now use Lucene codec compression
     if (name.endsWith(".fdt") || name.endsWith(".tvf")) {
       Compressor compressor = CompressorFactory.compressor(in);
       if (compressor != null) {
         in = compressor.indexInput(in);
       }
     }
     success = true;
   } finally {
     if (!success) {
       IOUtils.closeWhileHandlingException(in);
     }
   }
   return in;
 }
コード例 #2
0
ファイル: Store.java プロジェクト: bdargan/elasticsearch
 @Override
 public IndexInput openInput(String name, IOContext context) throws IOException {
   StoreFileMetaData metaData = filesMetadata.get(name);
   if (metaData == null) {
     throw new FileNotFoundException(name);
   }
   IndexInput in = metaData.directory().openInput(name, context);
   // Only for backward comp. since we now use Lucene codec compression
   if (name.endsWith(".fdt") || name.endsWith(".tvf")) {
     Compressor compressor = CompressorFactory.compressor(in);
     if (compressor != null) {
       in = compressor.indexInput(in);
     }
   }
   return in;
 }
コード例 #3
0
 public static HandlesStreamInput cachedHandlesCompressed(Compressor compressor, StreamInput in)
     throws IOException {
   Entry entry = instance();
   entry.handles.reset(compressor.streamInput(in));
   return entry.handles;
 }
コード例 #4
0
 public static StreamInput compressed(Compressor compressor, StreamInput in) throws IOException {
   return compressor.streamInput(in);
 }