org.apache.cassandra.io.sstable

## Class Descriptor

- java.lang.Object
- - org.apache.cassandra.io.sstable.Descriptor

    public class Descriptor
    extends java.lang.Object

A SSTable is described by the keyspace and column family it contains data for, a generation (where higher generations contain more recent data) and an alphabetic version string. A descriptor can be marked as temporary, which influences generated filenames.

### Nested Class Summary

Nested Classes
`static class` `Descriptor.Type`
`static class` `Descriptor.Version`

### Field Summary

Fields
`java.lang.String` `cfname`
`java.io.File` `directory`
`int` `generation`
`java.lang.String` `ksname`
`Descriptor.Type` `type`
`Descriptor.Version` `version` version has the following format: `[a-z]+`

### Constructor Summary

Constructors
Constructor and Description
`Descriptor(Descriptor.Version version, java.io.File directory, java.lang.String ksname, java.lang.String cfname, int generation, Descriptor.Type temp)`
`Descriptor(java.io.File directory, java.lang.String ksname, java.lang.String cfname, int generation, Descriptor.Type temp)` A descriptor that assumes CURRENT_VERSION.
`Descriptor(java.lang.String version, java.io.File directory, java.lang.String ksname, java.lang.String cfname, int generation, Descriptor.Type temp)`

### Method Summary

Methods
`Descriptor` `asType(Descriptor.Type type)`
`java.lang.String` `baseFilename()`
`boolean` `equals(java.lang.Object o)`
`java.lang.String` `filenameFor(Component component)`
`java.lang.String` `filenameFor(java.lang.String suffix)`
`static Pair<Descriptor,java.lang.String>` `fromFilename(java.io.File directory, java.lang.String name)`
`static Pair<Descriptor,java.lang.String>` `fromFilename(java.io.File directory, java.lang.String name, boolean skipComponent)` Filename of the form "<ksname>-<cfname>-[tmp-][<version>-]<gen>-<component>"
`static Descriptor` `fromFilename(java.lang.String filename)`
`static Descriptor` `fromFilename(java.lang.String filename, boolean skipComponent)`
`IMetadataSerializer` `getMetadataSerializer()`
`int` `hashCode()`
`boolean` `isCompatible()`
`java.lang.String` `relativeFilenameFor(Component component)`
`java.lang.String` `toString()`
`Descriptor` `withGeneration(int newGeneration)`

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

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

### Field Detail

#### directory

    public final java.io.File directory

#### version

    public final Descriptor.Version version

version has the following format: `[a-z]+`

#### ksname

    public final java.lang.String ksname

#### cfname

    public final java.lang.String cfname

#### generation

    public final int generation

#### type

    public final Descriptor.Type type

### Constructor Detail

#### Descriptor

    public Descriptor(java.io.File directory,
              java.lang.String ksname,
              java.lang.String cfname,
              int generation,
              Descriptor.Type temp)

A descriptor that assumes CURRENT_VERSION.

#### Descriptor

    public Descriptor(java.lang.String version,
              java.io.File directory,
              java.lang.String ksname,
              java.lang.String cfname,
              int generation,
              Descriptor.Type temp)

#### Descriptor

    public Descriptor(Descriptor.Version version,
              java.io.File directory,
              java.lang.String ksname,
              java.lang.String cfname,
              int generation,
              Descriptor.Type temp)

### Method Detail

#### withGeneration

    public Descriptor withGeneration(int newGeneration)

#### filenameFor

    public java.lang.String filenameFor(Component component)

#### baseFilename

    public java.lang.String baseFilename()

#### relativeFilenameFor

    public java.lang.String relativeFilenameFor(Component component)

#### filenameFor

    public java.lang.String filenameFor(java.lang.String suffix)

Parameters:
  `suffix` - A component suffix, such as 'Data.db'/'Index.db'/etc
Returns:
  A filename for this descriptor with the given suffix.

#### fromFilename

    public static Descriptor fromFilename(java.lang.String filename)

Parameters:
  `filename` - The SSTable filename
Returns:
  Descriptor of the SSTable initialized from filename
See Also:
  `fromFilename(File directory, String name)`

#### fromFilename

    public static Descriptor fromFilename(java.lang.String filename,
                          boolean skipComponent)

#### fromFilename

    public static Pair<Descriptor,java.lang.String> fromFilename(java.io.File directory,
                                                 java.lang.String name)

#### fromFilename

    public static Pair<Descriptor,java.lang.String> fromFilename(java.io.File directory,
                                                 java.lang.String name,
                                                 boolean skipComponent)

Filename of the form "<ksname>-<cfname>-[tmp-][<version>-]<gen>-<component>"

Parameters:
  `directory` - The directory of the SSTable files
  `name` - The name of the SSTable file
  `skipComponent` - true if the name param should not be parsed for a component tag
Returns:
  A Descriptor for the SSTable, and the Component remainder.

#### asType

    public Descriptor asType(Descriptor.Type type)

Parameters:
  `type` - temporary flag
Returns:
  A clone of this descriptor with the given 'temporary' status.

#### getMetadataSerializer

    public IMetadataSerializer getMetadataSerializer()

#### isCompatible

    public boolean isCompatible()

Returns:
  true if the current Cassandra version can read the given sstable version

#### toString

    public java.lang.String toString()

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

#### equals

    public boolean equals(java.lang.Object o)

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

#### hashCode

    public int hashCode()

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