org.elasticsearch.common.compress
Class CompressedIndexOutput<T extends CompressorContext>

java.lang.Object
  extended by org.apache.lucene.store.DataOutput
      extended by org.apache.lucene.store.IndexOutput
          extended by org.elasticsearch.common.compress.CompressedIndexOutput<T>
All Implemented Interfaces:
Closeable
Direct Known Subclasses:
LZFCompressedIndexOutput, SnappyCompressedIndexOutput

public abstract class CompressedIndexOutput<T extends CompressorContext>
extends org.apache.lucene.store.IndexOutput


Field Summary
protected  T context
           
protected  byte[] uncompressed
           
protected  int uncompressedLength
           
 
Constructor Summary
CompressedIndexOutput(org.apache.lucene.store.IndexOutput out, T context)
           
 
Method Summary
 void close()
           
protected abstract  void compress(byte[] data, int offset, int len, org.apache.lucene.store.IndexOutput out)
          Compresses the data into the output
 void copyBytes(org.apache.lucene.store.DataInput input, long length)
           
protected abstract  void doClose()
           
 void flush()
           
 long getFilePointer()
           
 long length()
           
 void seek(long pos)
           
 org.apache.lucene.store.IndexOutput underlying()
           
 void writeByte(byte b)
           
 void writeBytes(byte[] input, int offset, int length)
           
protected abstract  void writeHeader(org.apache.lucene.store.IndexOutput out)
           
 
Methods inherited from class org.apache.lucene.store.IndexOutput
setLength
 
Methods inherited from class org.apache.lucene.store.DataOutput
writeBytes, writeChars, writeChars, writeInt, writeLong, writeShort, writeString, writeStringStringMap, writeVInt, writeVLong
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

context

protected final T extends CompressorContext context

uncompressed

protected byte[] uncompressed

uncompressedLength

protected int uncompressedLength
Constructor Detail

CompressedIndexOutput

public CompressedIndexOutput(org.apache.lucene.store.IndexOutput out,
                             T context)
                      throws IOException
Throws:
IOException
Method Detail

underlying

public org.apache.lucene.store.IndexOutput underlying()

writeByte

public void writeByte(byte b)
               throws IOException
Specified by:
writeByte in class org.apache.lucene.store.DataOutput
Throws:
IOException

writeBytes

public void writeBytes(byte[] input,
                       int offset,
                       int length)
                throws IOException
Specified by:
writeBytes in class org.apache.lucene.store.DataOutput
Throws:
IOException

copyBytes

public void copyBytes(org.apache.lucene.store.DataInput input,
                      long length)
               throws IOException
Overrides:
copyBytes in class org.apache.lucene.store.DataOutput
Throws:
IOException

flush

public void flush()
           throws IOException
Specified by:
flush in class org.apache.lucene.store.IndexOutput
Throws:
IOException

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Specified by:
close in class org.apache.lucene.store.IndexOutput
Throws:
IOException

doClose

protected abstract void doClose()
                         throws IOException
Throws:
IOException

getFilePointer

public long getFilePointer()
Specified by:
getFilePointer in class org.apache.lucene.store.IndexOutput

seek

public void seek(long pos)
          throws IOException
Specified by:
seek in class org.apache.lucene.store.IndexOutput
Throws:
IOException

length

public long length()
            throws IOException
Specified by:
length in class org.apache.lucene.store.IndexOutput
Throws:
IOException

writeHeader

protected abstract void writeHeader(org.apache.lucene.store.IndexOutput out)
                             throws IOException
Throws:
IOException

compress

protected abstract void compress(byte[] data,
                                 int offset,
                                 int len,
                                 org.apache.lucene.store.IndexOutput out)
                          throws IOException
Compresses the data into the output

Throws:
IOException


Copyright © 2009-2012. All Rights Reserved.