src/java/org/apache/cassandra/tools/SSTableExport.java
/**
     * Export an SSTable and write the resulting JSON to a PrintStream.
     * 
     * @param ssTableFile the SSTable to export
     * @param outs PrintStream to write the output to
     * @param excludes keys to exclude from export
     *
     * @throws IOException on failure to read/write input/output
     */
Export an SSTable and write the resulting JSON to a PrintStream.

@param ssTableFile the SSTable to export
@param outs PrintStream to write the output to
@param excludes keys to exclude from export

@throws IOException on failure to read/write input/output
Export an SSTable and write the resulting JSON to a PrintStream . @param ssTableFile the SSTable to export @param outs PrintStream to write the output to @param excludes keys to exclude from export @throws IOException on failure to read / write input / output
public static void export(String ssTableFile, PrintStream outs, String[] excludes) throws IOException
    {
        Descriptor descriptor = Descriptor.fromFilename(ssTableFile);
        CFMetaData metadata;
        if (descriptor.cfname.contains("."))
        {
            int i = descriptor.cfname.indexOf(".");
            String parentName = descriptor.cfname.substring(0, i);
            CFMetaData parent = Schema.instance.getCFMetaData(descriptor.ksname, parentName);
            ColumnDefinition def = parent.getColumnDefinitionForIndex(descriptor.cfname.substring(i + 1));
            metadata = CFMetaData.newIndexMetadata(parent, def, KeysIndex.indexComparator());
        }
        else
        {
            metadata = Schema.instance.getCFMetaData(descriptor.ksname, descriptor.cfname);
        }
        export(SSTableReader.open(descriptor, metadata), outs, excludes);
    }
public static void export ( String ssTableFile , PrintStream outs , String [ ] excludes ) throws IOException { Descriptor descriptor = Descriptor . fromFilename ( ssTableFile ) ; CFMetaData metadata ; if ( descriptor . cfname . contains ( "." ) ) { int i = descriptor . cfname . indexOf ( "." ) ; String parentName = descriptor . cfname . substring ( 0 , i ) ; CFMetaData parent = Schema . instance . getCFMetaData ( descriptor . ksname , parentName ) ; ColumnDefinition def = parent . getColumnDefinitionForIndex ( descriptor . cfname . substring ( i + 1 ) ) ; metadata = CFMetaData . newIndexMetadata ( parent , def , KeysIndex . indexComparator ( ) ) ; } else { metadata = Schema . instance . getCFMetaData ( descriptor . ksname , descriptor . cfname ) ; } export ( SSTableReader . open ( descriptor , metadata ) , outs , excludes ) ; }
Export an SSTable and write the resulting JSON to a PrintStream.
Export an SSTable and write the resulting JSON to a PrintStream .
// look up index metadata from parent