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.
Constructor Summary |
Descriptor(java.io.File directory,
java.lang.String ksname,
java.lang.String cfname,
int generation,
boolean 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,
boolean temp)
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
LEGACY_VERSION
public static final java.lang.String LEGACY_VERSION
- See Also:
- Constant Field Values
CURRENT_VERSION
public static final java.lang.String CURRENT_VERSION
- See Also:
- Constant Field Values
directory
public final java.io.File directory
version
public final java.lang.String 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
temporary
public final boolean temporary
hasStringsInBloomFilter
public final boolean hasStringsInBloomFilter
hasIntRowSize
public final boolean hasIntRowSize
hasEncodedKeys
public final boolean hasEncodedKeys
isLatestVersion
public final boolean isLatestVersion
usesOldBloomFilter
public final boolean usesOldBloomFilter
metadataIncludesReplayPosition
public final boolean metadataIncludesReplayPosition
tracksMaxTimestamp
public final boolean tracksMaxTimestamp
hasCompressionRatio
public final boolean hasCompressionRatio
Descriptor
public Descriptor(java.io.File directory,
java.lang.String ksname,
java.lang.String cfname,
int generation,
boolean 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,
boolean temp)
filenameFor
public java.lang.String filenameFor(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 Pair<Descriptor,java.lang.String> fromFilename(java.io.File directory,
java.lang.String name)
- Filename of the form "/-[tmp-][-]-"
- Parameters:
directory
- The directory of the SSTable filesname
- The name of the SSTable file
- Returns:
- A Descriptor for the SSTable, and the Component remainder.
extractKeyspaceName
public static java.lang.String extractKeyspaceName(java.io.File directory)
- Extracts the keyspace name out of the directory name. Snapshot directories have a slightly different
path structure and need to be treated differently.
Regular path: "/-[tmp-][-]-"
Snapshot path: "/snapshots//-[tmp-][-]-"
- Parameters:
directory
- a directory containing SSTables
- Returns:
- the keyspace name
asTemporary
public Descriptor asTemporary(boolean temporary)
- Parameters:
temporary
- temporary flag
- Returns:
- A clone of this descriptor with the given 'temporary' status.
isCompatible
public boolean isCompatible()
- Returns:
- true if the current Cassandra version can read the given sstable version
isStreamCompatible
public boolean isStreamCompatible()
- Returns:
- true if the current Cassandra version can stream the given sstable version
from another node. This is stricter than opening it locally [isCompatible] because
streaming needs to rebuild all the non-data components, and it only knows how to write
the latest 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
Copyright © 2011 The Apache Software Foundation