org.apache.cassandra.db.commitlog

## Class CommitLogDescriptor

- java.lang.Object
- - org.apache.cassandra.db.commitlog.CommitLogDescriptor

    public class CommitLogDescriptor
    extends java.lang.Object

### Field Summary

Fields
`ParameterizedClass` `compression`
`static int` `current_version` Increment this number if there is a changes in the commit log disc layout or MessagingVersion changes.
`long` `id`
`static int` `VERSION_12`
`static int` `VERSION_20`
`static int` `VERSION_21`
`static int` `VERSION_22`
`static int` `VERSION_30`

### Constructor Summary

Constructors
Constructor and Description
`CommitLogDescriptor(int version, long id, ParameterizedClass compression, EncryptionContext encryptionContext)`
`CommitLogDescriptor(long id, ParameterizedClass compression, EncryptionContext encryptionContext)`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`boolean` `equals(CommitLogDescriptor that)`
`boolean` `equals(java.lang.Object that)`
`boolean` `equalsIgnoringCompression(CommitLogDescriptor that)`
`java.lang.String` `fileName()`
`static CommitLogDescriptor` `fromFileName(java.lang.String name)`
`static CommitLogDescriptor` `fromHeader(java.io.File file, EncryptionContext encryptionContext)`
`EncryptionContext` `getEncryptionContext()`
`int` `getMessagingVersion()`
`static boolean` `isValid(java.lang.String filename)`
`static CommitLogDescriptor` `readHeader(java.io.DataInput input, EncryptionContext encryptionContext)`
`java.lang.String` `toString()`
`static void` `writeHeader(java.nio.ByteBuffer out, CommitLogDescriptor descriptor)`
`static void` `writeHeader(java.nio.ByteBuffer out, CommitLogDescriptor descriptor, java.util.Map<java.lang.String,java.lang.String> additionalHeaders)`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Field Detail

#### VERSION_12

    public static final int VERSION_12

See Also:
  Constant Field Values

#### VERSION_20

    public static final int VERSION_20

See Also:
  Constant Field Values

#### VERSION_21

    public static final int VERSION_21

See Also:
  Constant Field Values

#### VERSION_22

    public static final int VERSION_22

See Also:
  Constant Field Values

#### VERSION_30

    public static final int VERSION_30

See Also:
  Constant Field Values

#### current_version

    public static final int current_version

Increment this number if there is a changes in the commit log disc layout or MessagingVersion changes. Note: make sure to handle `getMessagingVersion()`

See Also:
  Constant Field Values

#### id

    public final long id

#### compression

    public final ParameterizedClass compression

### Constructor Detail

#### CommitLogDescriptor

    public CommitLogDescriptor(int version,
                               long id,
                               ParameterizedClass compression,
                               EncryptionContext encryptionContext)

#### CommitLogDescriptor

    public CommitLogDescriptor(long id,
                               ParameterizedClass compression,
                               EncryptionContext encryptionContext)

### Method Detail

#### writeHeader

    public static void writeHeader(java.nio.ByteBuffer out,
                                   CommitLogDescriptor descriptor)

#### writeHeader

    public static void writeHeader(java.nio.ByteBuffer out,
                                   CommitLogDescriptor descriptor,
                                   java.util.Map<java.lang.String,java.lang.String> additionalHeaders)

Parameters:
  `additionalHeaders` - Allow segments to pass custom header data

#### fromHeader

    public static CommitLogDescriptor fromHeader(java.io.File file,
                                                 EncryptionContext encryptionContext)

#### readHeader

    public static CommitLogDescriptor readHeader(java.io.DataInput input,
                                                 EncryptionContext encryptionContext)
                                          throws java.io.IOException

Throws:
  `java.io.IOException`

#### fromFileName

    public static CommitLogDescriptor fromFileName(java.lang.String name)

#### getMessagingVersion

    public int getMessagingVersion()

#### fileName

    public java.lang.String fileName()

#### isValid

    public static boolean isValid(java.lang.String filename)

Parameters:
  `filename` - the filename to check
Returns:
  true if filename could be a commit log based on it's filename

#### getEncryptionContext

    public EncryptionContext getEncryptionContext()

#### toString

    public java.lang.String toString()

Overrides:
  `toString` in class `java.lang.Object`

#### equals

    public boolean equals(java.lang.Object that)

Overrides:
  `equals` in class `java.lang.Object`

#### equalsIgnoringCompression

    public boolean equalsIgnoringCompression(CommitLogDescriptor that)

#### equals

    public boolean equals(CommitLogDescriptor that)