Package org.apache.cassandra.io.util

Examples of org.apache.cassandra.io.util.DataOutputBuffer.reset()


        SSTableWriter writer = new SSTableWriter(cfs.getFlushPath(), columnFamilies.size(), StorageService.getPartitioner());

        DataOutputBuffer buffer = new DataOutputBuffer();
        for (Map.Entry<DecoratedKey, ColumnFamily> entry : columnFamilies.entrySet())
        {
            buffer.reset();
            /* serialize the cf with column indexes */
            ColumnFamily.serializer().serializeWithIndexes(entry.getValue(), buffer);
            /* Now write the key and value to disk */
            writer.append(entry.getKey(), buffer);
        }
View Full Code Here


                                            DatabaseDescriptor.getSubComparator(Keyspace, CFName),
                                            TimestampReconciler.instance,
                                            CFMetaData.getId(Keyspace, CFName));
       
        for(ColumnFamily cf : ColumnFamiles) {
            bufOut.reset();
            ColumnFamily.serializer().serializeWithIndexes(cf, bufOut);
            byte[] data = new byte[bufOut.getLength()];
            System.arraycopy(bufOut.getData(), 0, data, 0, bufOut.getLength());

            column = new Column(FBUtilities.toByteArray(cf.id()), data, new TimestampClock(0));
View Full Code Here

        DataOutputBuffer out = new DataOutputBuffer();
        Iterator<IColumn> iter = iterator();
        while (iter.hasNext())
        {
            IColumn column = iter.next();
            out.reset();
            try
            {
                emptyColumnFamily.getColumnSerializer().serialize(column, out);
            }
            catch (IOException e)
View Full Code Here

                else
                    addToStandardCF((JSONArray)json.get(rowKey.key), cfamily);
                          
                ColumnFamily.serializer().serializeWithIndexes(cfamily, dob);
                writer.append(rowKey, dob);
                dob.reset();
                cfamily.clear();
            }
           
            writer.closeAndOpenReader();
        }
View Full Code Here

        SSTableWriter writer = new SSTableWriter(cfs.getFlushPath(), columnFamilies.size(), StorageService.getPartitioner());

        DataOutputBuffer buffer = new DataOutputBuffer();
        for (Map.Entry<DecoratedKey, ColumnFamily> entry : columnFamilies.entrySet())
        {
            buffer.reset();
            /* serialize the cf with column indexes */
            ColumnFamily.serializer().serializeWithIndexes(entry.getValue(), buffer);
            /* Now write the key and value to disk */
            writer.append(entry.getKey(), buffer);
        }
View Full Code Here

        SSTableWriter writer = new SSTableWriter(cfs.getFlushPath(), columnFamilies.size(), StorageService.getPartitioner());

        DataOutputBuffer buffer = new DataOutputBuffer();
        for (Map.Entry<DecoratedKey, ColumnFamily> entry : columnFamilies.entrySet())
        {
            buffer.reset();
            /* serialize the cf with column indexes */
            ColumnFamily.serializer().serializeWithIndexes(entry.getValue(), buffer);
            /* Now write the key and value to disk */
            writer.append(entry.getKey(), buffer);
        }
View Full Code Here

                else
                    addToStandardCF((JSONArray)json.get(rowKey.key), cfamily);
                          
                ColumnFamily.serializer().serializeWithIndexes(cfamily, dob);
                writer.append(rowKey, dob);
                dob.reset();
                cfamily.clear();
            }
           
            writer.closeAndOpenReader(0);
        }
View Full Code Here

                                            DatabaseDescriptor.getSubComparator(Keyspace, CFName),
                                            new TimestampReconciler(),
                                            CFMetaData.getId(Keyspace, CFName));
       
        for(ColumnFamily cf : ColumnFamiles) {
            bufOut.reset();
            ColumnFamily.serializer().serializeWithIndexes(cf, bufOut);
            byte[] data = new byte[bufOut.getLength()];
            System.arraycopy(bufOut.getData(), 0, data, 0, bufOut.getLength());

            column = new Column(FBUtilities.toByteArray(cf.id()), data, new TimestampClock(0));
View Full Code Here

        /* Get the first column family from list, this is just to get past validation */
        baseColumnFamily = new ColumnFamily(CFName, "Standard",DatabaseDescriptor.getComparator(Keyspace, CFName), DatabaseDescriptor.getSubComparator(Keyspace, CFName));
       
        for(ColumnFamily cf : ColumnFamiles) {
            bufOut.reset();
            try
            {
                ColumnFamily.serializer().serializeWithIndexes(cf, bufOut);
                byte[] data = new byte[bufOut.getLength()];
                System.arraycopy(bufOut.getData(), 0, data, 0, bufOut.getLength());
View Full Code Here

        DataOutputBuffer out = new DataOutputBuffer();
        Iterator<IColumn> iter = iterator();
        while (iter.hasNext())
        {
            IColumn column = iter.next();
            out.reset();
            try
            {
                emptyColumnFamily.getColumnSerializer().serialize(column, out);
            }
            catch (IOException e)
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.