Package org.apache.cassandra.io

Examples of org.apache.cassandra.io.SSTableScanner


   
    // This is necessary to accommodate the test suite since you cannot open a Reader more
    // than once from within the same process.
    static void export(SSTableReader reader, PrintStream outs, String[] excludes) throws IOException
    {
        SSTableScanner scanner = reader.getScanner(INPUT_FILE_BUFFER_SIZE);
        Set<String> excludeSet = new HashSet();

        if (excludes != null)
            excludeSet = new HashSet<String>(Arrays.asList(excludes));

        outs.println("{");
       
        while(scanner.hasNext())
        {
            IteratingRow row = scanner.next();
            if (excludeSet.contains(row.getKey().key))
                continue;
            try
            {
                outs.print("  ");
                serializeRow(outs, row);
                if (scanner.hasNext())
                    outs.println(",");
                else
                    outs.println();
            }
            catch (IOException ioexcep)
View Full Code Here


     */
    public static void export(String ssTableFile, PrintStream outs, String[] keys)
    throws IOException
    {
        SSTableReader reader = SSTableReader.open(ssTableFile);
        SSTableScanner scanner = reader.getScanner(INPUT_FILE_BUFFER_SIZE);
        IPartitioner<?> partitioner = DatabaseDescriptor.getPartitioner();   
        int i = 0;
       
        outs.println("{");
       
        for (String key : keys)
        {
            DecoratedKey<?> dk = partitioner.decorateKey(key);
            scanner.seekTo(dk);
           
            i++;
           
            if (scanner.hasNext())
            {
                IteratingRow row = scanner.next();
                try
                {
                    String jsonOut = serializeRow(row);
                    if (i != 1)
                        outs.println(",");
View Full Code Here

   
    // This is necessary to accommodate the test suite since you cannot open a Reader more
    // than once from within the same process.
    static void export(SSTableReader reader, PrintStream outs) throws IOException
    {
        SSTableScanner scanner = reader.getScanner(INPUT_FILE_BUFFER_SIZE);
       
        outs.println("{");
       
        while(scanner.hasNext())
        {
            IteratingRow row = scanner.next();
            try
            {
                String jsonOut = serializeRow(row);
                outs.print("  " + jsonOut);
                if (scanner.hasNext())
                    outs.println(",");
                else
                    outs.println();
            }
            catch (IOException ioexcep)
View Full Code Here

     */
    public static void export(String ssTableFile, PrintStream outs, String[] keys)
    throws IOException
    {
        SSTableReader reader = SSTableReader.open(ssTableFile);
        SSTableScanner scanner = reader.getScanner();
        IPartitioner<?> partitioner = DatabaseDescriptor.getPartitioner();   
        int i = 0;
       
        outs.println("{");
       
        for (String key : keys)
        {
            DecoratedKey<?> dk = partitioner.decorateKey(key);
            scanner.seekTo(dk);
           
            i++;
           
            if (scanner.hasNext())
            {
                IteratingRow row = scanner.next();
                try
                {
                    String jsonOut = serializeRow(row);
                    if (i != 1)
                        outs.println(",");
View Full Code Here

   
    // This is necessary to accommodate the test suite since you cannot open a Reader more
    // than once from within the same process.
    static void export(SSTableReader reader, PrintStream outs) throws IOException
    {
        SSTableScanner scanner = reader.getScanner();
       
        outs.println("{");
       
        while(scanner.hasNext())
        {
            IteratingRow row = scanner.next();
            try
            {
                String jsonOut = serializeRow(row);
                outs.print("  " + jsonOut);
                if (scanner.hasNext())
                    outs.println(",");
                else
                    outs.println();
            }
            catch (IOException ioexcep)
View Full Code Here

TOP

Related Classes of org.apache.cassandra.io.SSTableScanner

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.