CompressionMetadata.Writer (apache-cassandra API)
Date: 2012-05-04

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.cassandra.io.compress
Class CompressionMetadata.Writer

    java.lang.Object
      java.io.RandomAccessFile
          org.apache.cassandra.io.compress.CompressionMetadata.Writer

All Implemented Interfaces:
  java.io.Closeable, java.io.DataInput, java.io.DataOutput

Enclosing class:
  CompressionMetadata

    public static class CompressionMetadata.Writer

extends java.io.RandomAccessFile

Constructor Summary
`CompressionMetadata.Writer(java.lang.String path)`

Method Summary
`long` | `chunkOffsetBy(int chunkIndex)` Get a chunk offset by it's index.
`void` | `finalizeHeader(long dataLength, int chunks)`
`void` | `resetAndTruncate(int chunkIndex)` Reset the writer so that the next chunk offset written will be the one of `chunkIndex`.
`void` | `writeHeader(CompressionParameters parameters)`

Methods inherited from class java.io.RandomAccessFile
`close, getChannel, getFD, getFilePointer, length, read, read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, seek, setLength, skipBytes, write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### CompressionMetadata.Writer

    public CompressionMetadata.Writer(java.lang.String path)
                               throws java.io.IOException

Throws:
  `java.io.IOException`

Method Detail

### writeHeader

    public void writeHeader(CompressionParameters parameters)
                     throws java.io.IOException

  Throws:
    `java.io.IOException`

### finalizeHeader

    public void finalizeHeader(long dataLength,
                               int chunks)
                        throws java.io.IOException

  Throws:
    `java.io.IOException`

### chunkOffsetBy

    public long chunkOffsetBy(int chunkIndex)
                       throws java.io.IOException

  Get a chunk offset by it's index.

  Parameters:
    `chunkIndex` - Index of the chunk.
  Returns:
    offset of the chunk in the compressed file.
  Throws:
    `java.io.IOException` - any I/O error.

### resetAndTruncate

    public void resetAndTruncate(int chunkIndex)
                          throws java.io.IOException

  Reset the writer so that the next chunk offset written will be the one of `chunkIndex`.

  Throws:
    `java.io.IOException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2012 The Apache Software Foundation