org.apache.kafka.common.record
Class Compressor

java.lang.Object
  extended by org.apache.kafka.common.record.Compressor

public class Compressor
extends java.lang.Object


Field Summary
 long numRecords
           
 long writtenUncompressed
           
 
Constructor Summary
Compressor(java.nio.ByteBuffer buffer, CompressionType type)
           
Compressor(java.nio.ByteBuffer buffer, CompressionType type, int blockSize)
           
 
Method Summary
 java.nio.ByteBuffer buffer()
           
 void close()
           
 double compressionRate()
           
 long estimatedBytesWritten()
           
 void put(byte[] bytes, int offset, int len)
           
 void put(java.nio.ByteBuffer buffer)
           
 void putByte(byte value)
           
 void putInt(int value)
           
 void putLong(long value)
           
 void putRecord(byte[] key, byte[] value)
           
 void putRecord(byte[] key, byte[] value, CompressionType type, int valueOffset, int valueSize)
           
 void recordWritten(int size)
           
static java.io.DataInputStream wrapForInput(ByteBufferInputStream buffer, CompressionType type)
           
static java.io.DataOutputStream wrapForOutput(ByteBufferOutputStream buffer, CompressionType type, int bufferSize)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

writtenUncompressed

public long writtenUncompressed

numRecords

public long numRecords
Constructor Detail

Compressor

public Compressor(java.nio.ByteBuffer buffer,
                  CompressionType type,
                  int blockSize)

Compressor

public Compressor(java.nio.ByteBuffer buffer,
                  CompressionType type)
Method Detail

buffer

public java.nio.ByteBuffer buffer()

compressionRate

public double compressionRate()

close

public void close()

putLong

public void putLong(long value)

putInt

public void putInt(int value)

put

public void put(java.nio.ByteBuffer buffer)

putByte

public void putByte(byte value)

put

public void put(byte[] bytes,
                int offset,
                int len)

putRecord

public void putRecord(byte[] key,
                      byte[] value,
                      CompressionType type,
                      int valueOffset,
                      int valueSize)

putRecord

public void putRecord(byte[] key,
                      byte[] value)

recordWritten

public void recordWritten(int size)

estimatedBytesWritten

public long estimatedBytesWritten()

wrapForOutput

public static java.io.DataOutputStream wrapForOutput(ByteBufferOutputStream buffer,
                                                     CompressionType type,
                                                     int bufferSize)

wrapForInput

public static java.io.DataInputStream wrapForInput(ByteBufferInputStream buffer,
                                                   CompressionType type)