Package org.apache.cassandra.streaming

Examples of org.apache.cassandra.streaming.StreamContext


        // transfer the first and last key
        IPartitioner p = StorageService.getPartitioner();
        List<Range> ranges = new ArrayList<Range>();
        ranges.add(new Range(p.getMinimumToken(), p.getToken("key".getBytes())));
        ranges.add(new Range(p.getToken("key2".getBytes()), p.getMinimumToken()));
        StreamOut.transferSSTables(new StreamContext(LOCAL), tablename, Arrays.asList(sstable), ranges);

        // confirm that the SSTable was transferred and registered
        ColumnFamilyStore cfstore = Table.open(tablename).getColumnFamilyStore(cfname);
        List<Row> rows = Util.getRangeSlice(cfstore);
        assertEquals(2, rows.size());
View Full Code Here


        // transfer the first and last key
        IPartitioner p = StorageService.getPartitioner();
        List<Range> ranges = new ArrayList<Range>();
        ranges.add(new Range(p.getMinimumToken(), p.getToken("transfer1".getBytes())));
        ranges.add(new Range(p.getToken("test2".getBytes()), p.getMinimumToken()));
        StreamOut.transferSSTables(new StreamContext(LOCAL), tablename, Arrays.asList(sstable, sstable2), ranges);

        // confirm that the SSTable was transferred and registered
        ColumnFamilyStore cfstore = Table.open(tablename).getColumnFamilyStore(cfname);
        List<Row> rows = Util.getRangeSlice(cfstore);
        assertEquals(8, rows.size());
View Full Code Here

                // send ranges to the remote node
                Future f = StageManager.getStage(StageManager.STREAM_STAGE).submit(new WrappedRunnable()
                {
                    protected void runMayThrow() throws Exception
                    {
                        StreamContext context = new StreamContext(request.endpoint);
                        StreamOut.transferSSTables(context, request.cf.left, sstables, ranges);
                        StreamOutManager.remove(context);
                    }
                });
                // request ranges from the remote node
View Full Code Here

TOP

Related Classes of org.apache.cassandra.streaming.StreamContext

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.