Package org.apache.cassandra.io

Examples of org.apache.cassandra.io.SSTableReader


        {
            byte[] bytes = columnFamilies.get(key);
            assert bytes.length > 0;
            writer.append(key, bytes);
        }
        SSTableReader sstable = writer.closeAndOpenReader();
        logger.info("Completed flushing " + writer.getFilename());
        return sstable;
    }
View Full Code Here


            String [] temp = fileName.split("-");

            //Open the file to see if all parts are now here
            try
            {
                SSTableReader sstable = SSTableWriter.renameAndOpen(pendingFile.getTargetFile());
                //TODO add a sanity check that this sstable has all its parts and is ok
                Table.open(tableName).getColumnFamilyStore(temp[0]).addSSTable(sstable);
                logger.info("Streaming added " + sstable.getFilename());
            }
            catch (IOException e)
            {
                throw new RuntimeException("Not able to add streamed file " + pendingFile.getTargetFile(), e);
            }
View Full Code Here

            ColumnFamily.serializer().serializeWithIndexes(entry.getValue(), buffer);
            /* Now write the key and value to disk */
            writer.append(entry.getKey(), buffer);
        }

        SSTableReader ssTable = writer.closeAndOpenReader();
        logger.info(String.format("Completed flushing %s (%d bytes)",
                                  ssTable.getFilename(), new File(ssTable.getFilename()).length()));
        return ssTable;
    }
View Full Code Here

                ColumnFamily.serializer().serializeWithIndexes(columnFamily, buffer);
                /* Now write the key and value to disk */
                writer.append(partitioner.decorateKey(key), buffer);
            }
        }
        SSTableReader ssTable = writer.closeAndOpenReader();
        cfStore.onMemtableFlush(cLogCtx);
        cfStore.storeLocation(ssTable);
        buffer.close();
        isFlushed_ = true;
        logger_.info("Completed flushing " + ssTable.getFilename());
    }
View Full Code Here

                File file = new File( streamContext.getTargetFile() );
                String fileName = file.getName();
                String [] temp = fileName.split("-");
               
                //Open the file to see if all parts are now here
                SSTableReader sstable = null;
                try
                {
                    sstable = SSTableWriter.renameAndOpen(streamContext.getTargetFile());
                   
                    //TODO add a sanity check that this sstable has all its parts and is ok
                    Table.open(tableName).getColumnFamilyStore(temp[0]).addToList(sstable);
                    logger_.info("Bootstrap added " + sstable.getFilename());
                }
                catch (IOException e)
                {
                    logger_.error("Not able to bootstrap with file " + streamContext.getTargetFile(), e);                   
                }
View Full Code Here

        // compact so we have a big row with more than the minimum index count
        if (cfStore.getSSTables().size() > 1)
        {
            cfStore.doCompaction(2, cfStore.getSSTables().size());
        }
        SSTableReader sstable = cfStore.getSSTables().iterator().next();
        long position = sstable.getPosition(key);
        BufferedRandomAccessFile file = new BufferedRandomAccessFile(sstable.getFilename(), "r");
        file.seek(position);
        assert file.readUTF().equals(key);
        file.readInt();
        IndexHelper.skipBloomFilter(file);
        ArrayList<IndexHelper.IndexInfo> indexes = IndexHelper.deserializeIndex(file);
View Full Code Here

     * @throws IOException on failure to read/write input/output
     */
    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)
View Full Code Here

     * @param outs PrintStream to write the output to
     * @throws IOException on failure to read/write input/output
     */
    public static void export(String ssTableFile, PrintStream outs, String[] excludes) throws IOException
    {
        SSTableReader reader = SSTableReader.open(ssTableFile);
        export(reader, outs, excludes);
    }
View Full Code Here

        {
            byte[] bytes = columnFamilies.get(key);
            assert bytes.length > 0;
            writer.append(key, bytes);
        }
        SSTableReader sstable = writer.closeAndOpenReader();
        logger.info("Completed flushing " + writer.getFilename());
        return sstable;
    }
View Full Code Here

            String [] temp = fileName.split("-");

            //Open the file to see if all parts are now here
            try
            {
                SSTableReader sstable = SSTableWriter.renameAndOpen(pendingFile.getTargetFile());
                //TODO add a sanity check that this sstable has all its parts and is ok
                Table.open(tableName).getColumnFamilyStore(temp[0]).addSSTable(sstable);
                logger.info("Streaming added " + sstable.getFilename());
            }
            catch (IOException e)
            {
                throw new RuntimeException("Not able to add streamed file " + pendingFile.getTargetFile(), e);
            }
View Full Code Here

TOP

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

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.