src/java/org/apache/cassandra/io/sstable/Descriptor.java
/**
     * Filename of the form "<ksname>-<cfname>-[tmp-][<version>-]<gen>-<component>"
     *
     * @param directory The directory of the SSTable files
     * @param name The name of the SSTable file
     *
     * @return A Descriptor for the SSTable, and the Component remainder.
     */


@return A Descriptor for the SSTable, and the Component remainder.
@return A Descriptor for the SSTable and the Component remainder .
public static Pair<Descriptor,String> fromFilename(File directory, String name)
    {
        StringTokenizer st = new StringTokenizer(name, String.valueOf(separator));
        String nexttok;
        String ksname = st.nextToken();
        String cfname = st.nextToken();
        nexttok = st.nextToken();
        boolean temporary = false;
        if (nexttok.equals(SSTable.TEMPFILE_MARKER))
        {
            temporary = true;
            nexttok = st.nextToken();
        }
        String version = LEGACY_VERSION;
        if (versionValidate(nexttok))
        {
            version = nexttok;
            nexttok = st.nextToken();
        }
        int generation = Integer.parseInt(nexttok);
        String component = st.nextToken();
        directory = directory != null ? directory : new File(".");
        return new Pair<Descriptor,String>(new Descriptor(version, directory, ksname, cfname, generation, temporary), component);
    }
public static Pair < Descriptor , String > fromFilename ( File directory , String name ) { StringTokenizer st = new StringTokenizer ( name , String . valueOf ( separator ) ) ; String nexttok ; String ksname = st . nextToken ( ) ; String cfname = st . nextToken ( ) ; nexttok = st . nextToken ( ) ; boolean temporary = false ; if ( nexttok . equals ( SSTable . TEMPFILE_MARKER ) ) { temporary = true ; nexttok = st . nextToken ( ) ; } String version = LEGACY_VERSION ; if ( versionValidate ( nexttok ) ) { version = nexttok ; nexttok = st . nextToken ( ) ; } int generation = Integer . parseInt ( nexttok ) ; String component = st . nextToken ( ) ; directory = directory != null ? directory : new File ( "." ) ; return new Pair < Descriptor , String > ( new Descriptor ( version , directory , ksname , cfname , generation , temporary ) , component ) ; }
Filename of the form "<ksname>-<cfname>-[tmp-][<version>-]<gen>-<component>"
 @param directory The directory of the SSTable files
 @param name The name of the SSTable file
Filename of the form " <ksname > - <cfname > - [ tmp - ] [ <version > - ] <gen > - <component > " @param directory The directory of the SSTable files @param name The name of the SSTable file
// tokenize the filename // all filenames must start with keyspace and column family // optional temporary marker // optional version string // component suffix