MyCassandra-0.2.1/src/java/org/apache/cassandra/tools/SSTableExport.java
/**
     * Enumerate row keys from an SSTableReader and write the result to a PrintStream.
     * 
     * @param ssTableFile the file to export the rows from
     * @param outs PrintStream to write the output to
     * @throws IOException on failure to read/write input/output
     */
Enumerate row keys from an SSTableReader and write the result to a PrintStream.

@param ssTableFile the file to export the rows from
@param outs PrintStream to write the output to
@throws IOException on failure to read/write input/output
Enumerate row keys from an SSTableReader and write the result to a PrintStream . @param ssTableFile the file to export the rows from @param outs PrintStream to write the output to @throws IOException on failure to read / write input / output
public static void enumeratekeys(String ssTableFile, PrintStream outs)
    throws IOException
    {
        Descriptor desc = Descriptor.fromFilename(ssTableFile);
        KeyIterator iter = new KeyIterator(desc);
        DecoratedKey lastKey = null;
        while (iter.hasNext())
        {
            DecoratedKey key = iter.next();
            if (lastKey != null && lastKey.compareTo(key) > 0 )
                throw new IOException("Key out of order! " + lastKey + " > " + key);
            lastKey = key;
            outs.println(bytesToHex(key.key));
        }
        iter.close();
        outs.flush();
    }
public static void enumeratekeys ( String ssTableFile , PrintStream outs ) throws IOException { Descriptor desc = Descriptor . fromFilename ( ssTableFile ) ; KeyIterator iter = new KeyIterator ( desc ) ; DecoratedKey lastKey = null ; while ( iter . hasNext ( ) ) { DecoratedKey key = iter . next ( ) ; if ( lastKey != null && lastKey . compareTo ( key ) > 0 ) throw new IOException ( "Key out of order! " + lastKey + " > " + key ) ; lastKey = key ; outs . println ( bytesToHex ( key . key ) ) ; } iter . close ( ) ; outs . flush ( ) ; }
Enumerate row keys from an SSTableReader and write the result to a PrintStream.
Enumerate row keys from an SSTableReader and write the result to a PrintStream .
// validate order of the keys in the sstable