Examples of SSTableScanner


Examples of com.netflix.aegisthus.io.sstable.SSTableScanner

    if (ctx instanceof TaskInputOutputContext) {
      context = (TaskInputOutputContext) ctx;
    }

    try {
      scanner = new SSTableScanner(new DataInputStream(is),
          split.getConvertors(), end, Descriptor.fromFilename(filename).version);
      if (ctx.getConfiguration().get("aegisthus.maxcolsize") != null) {
        scanner.setMaxColSize(ctx.getConfiguration().getLong("aegisthus.maxcolsize", -1L));
        LOG.info(String.format("aegisthus.maxcolsize - %d",
            ctx.getConfiguration().getLong("aegisthus.maxcolsize", -1L)));
View Full Code Here

Examples of org.apache.cassandra.io.SSTableScanner

        }

        // sstables
        for (SSTableReader sstable : ssTables_)
        {
            final SSTableScanner scanner = sstable.getScanner(KEY_RANGE_FILE_BUFFER_SIZE);
            scanner.seekTo(startWith);
            Iterator<DecoratedKey> iter = new CloseableIterator<DecoratedKey>()
            {
                public boolean hasNext()
                {
                    return scanner.hasNext();
                }
                public DecoratedKey next()
                {
                    return scanner.next().getKey();
                }
                public void remove()
                {
                    throw new UnsupportedOperationException();
                }
                public void close() throws IOException
                {
                    scanner.close();
                }
            };
            assert iter instanceof Closeable; // otherwise we leak FDs
            iterators.add(iter);
        }
View Full Code Here

Examples of org.apache.cassandra.io.SSTableScanner

     */
    public static void export(String ssTableFile, PrintStream outs, String[] keys, String[] excludes)
    throws IOException
    {
        SSTableReader reader = SSTableReader.open(ssTableFile);
        SSTableScanner scanner = reader.getScanner(INPUT_FILE_BUFFER_SIZE);
        IPartitioner<?> partitioner = DatabaseDescriptor.getPartitioner();   
        Set<String> excludeSet = new HashSet<String>(Arrays.asList(excludes));
        int i = 0;
       
        outs.println("{");
       
        for (String key : keys)
        {
            if (excludeSet.contains(key))
                continue;
            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

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<String>(Arrays.asList(excludes));

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

Examples of org.apache.cassandra.io.SSTableScanner

     */
    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

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) 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

Examples of org.apache.cassandra.io.SSTableScanner

     */
    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

Examples of org.apache.cassandra.io.SSTableScanner

     * @throws IOException on failure to read/write input/output
     */
    public static void export(String ssTableFile, PrintStream outs) throws IOException
    {
        SSTableReader reader = SSTableReader.open(ssTableFile);
        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

Examples of org.apache.cassandra.io.SSTableScanner

     */
    public static void export(String ssTableFile, PrintStream outs, String[] keys, String[] excludes)
    throws IOException
    {
        SSTableReader reader = SSTableReader.open(ssTableFile);
        SSTableScanner scanner = reader.getScanner(INPUT_FILE_BUFFER_SIZE);
        IPartitioner<?> partitioner = DatabaseDescriptor.getPartitioner();   
        Set<String> excludeSet = new HashSet();
        int i = 0;

        if (excludes != null)
            excludeSet = new HashSet<String>(Arrays.asList(excludes));
       
        outs.println("{");
       
        for (String key : keys)
        {
            if (excludeSet.contains(key))
                continue;
            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

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
            {
                String jsonOut = serializeRow(row);
                outs.print("  " + jsonOut);
                if (scanner.hasNext())
                    outs.println(",");
                else
                    outs.println();
            }
            catch (IOException ioexcep)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.