public class Descriptor
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
java.lang.String |
cfname |
java.io.File |
directory
canonicalized path to the directory where SSTable resides
|
SSTableFormat.Type |
formatType |
int |
generation |
java.lang.String |
ksname |
static java.lang.String |
TMP_EXT |
Version |
version
version has the following format:
[a-z]+ |
Constructor and Description |
---|
Descriptor(java.io.File directory,
java.lang.String ksname,
java.lang.String cfname,
int generation)
A descriptor that assumes CURRENT_VERSION.
|
Descriptor(java.io.File directory,
java.lang.String ksname,
java.lang.String cfname,
int generation,
SSTableFormat.Type formatType)
Constructor for sstable writers only.
|
Descriptor(java.lang.String version,
java.io.File directory,
java.lang.String ksname,
java.lang.String cfname,
int generation,
SSTableFormat.Type formatType) |
Descriptor(Version version,
java.io.File directory,
java.lang.String ksname,
java.lang.String cfname,
int generation,
SSTableFormat.Type formatType) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
baseFilename() |
boolean |
equals(java.lang.Object o) |
java.lang.String |
filenameFor(Component component) |
static Descriptor |
fromFilename(java.io.File file)
Parse a sstable filename into a Descriptor.
|
static Descriptor |
fromFilename(java.lang.String filename)
Parse a sstable filename into a Descriptor.
|
static Pair<Descriptor,Component> |
fromFilenameWithComponent(java.io.File file)
Parse a sstable filename, extracting both the
Descriptor and Component part. |
SSTableFormat |
getFormat() |
IMetadataSerializer |
getMetadataSerializer() |
java.util.List<java.io.File> |
getTemporaryFiles()
Return any temporary files found in the directory
|
int |
hashCode() |
boolean |
isCompatible() |
static boolean |
isValidFile(java.io.File file) |
java.lang.String |
relativeFilenameFor(Component component) |
java.lang.String |
tmpFilenameFor(Component component) |
java.lang.String |
tmpFilenameForStreaming(Component component) |
java.lang.String |
toString() |
Descriptor |
withFormatType(SSTableFormat.Type newType) |
Descriptor |
withGeneration(int newGeneration) |
public static java.lang.String TMP_EXT
public final java.io.File directory
public final Version version
[a-z]+
public final java.lang.String ksname
public final java.lang.String cfname
public final int generation
public final SSTableFormat.Type formatType
public Descriptor(java.io.File directory, java.lang.String ksname, java.lang.String cfname, int generation)
public Descriptor(java.io.File directory, java.lang.String ksname, java.lang.String cfname, int generation, SSTableFormat.Type formatType)
public Descriptor(java.lang.String version, java.io.File directory, java.lang.String ksname, java.lang.String cfname, int generation, SSTableFormat.Type formatType)
public Descriptor(Version version, java.io.File directory, java.lang.String ksname, java.lang.String cfname, int generation, SSTableFormat.Type formatType)
public Descriptor withGeneration(int newGeneration)
public Descriptor withFormatType(SSTableFormat.Type newType)
public java.lang.String tmpFilenameFor(Component component)
public java.lang.String tmpFilenameForStreaming(Component component)
public java.lang.String filenameFor(Component component)
public java.lang.String baseFilename()
public java.lang.String relativeFilenameFor(Component component)
public SSTableFormat getFormat()
public java.util.List<java.io.File> getTemporaryFiles()
public static boolean isValidFile(java.io.File file)
public static Descriptor fromFilename(java.lang.String filename)
This is a shortcut for fromFilename(new File(filename))
.
filename
- the filename to a sstable component.java.lang.IllegalArgumentException
- if the provided file
does point to a valid sstable filename. This could
mean either that the filename doesn't look like a sstable file, or that it is for an old and unsupported
versions.public static Descriptor fromFilename(java.io.File file)
SSTables files are all located within subdirectories of the form <keyspace>/<table>/
. Normal sstables are
are directly within that subdirectory structure while 2ndary index, backups and snapshot are each inside an
additional subdirectory. The file themselves have the form:
<version>-<gen>-<format>-<component>
.
Note that this method will only sucessfully parse sstable files of supported versions.
file
- the File
object for the filename to parse.java.lang.IllegalArgumentException
- if the provided file
does point to a valid sstable filename. This could
mean either that the filename doesn't look like a sstable file, or that it is for an old and unsupported
versions.public static Pair<Descriptor,Component> fromFilenameWithComponent(java.io.File file)
Descriptor
and Component
part.file
- the File
object for the filename to parse.file
.java.lang.IllegalArgumentException
- if the provided file
does point to a valid sstable filename. This could
mean either that the filename doesn't look like a sstable file, or that it is for an old and unsupported
versions.public IMetadataSerializer getMetadataSerializer()
public boolean isCompatible()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
Copyright © 2009-2021 The Apache Software Foundation