Package org.voltcore.utils.DBBPool

Examples of org.voltcore.utils.DBBPool.BBContainer.b()


         */
        private void readChunksV2() {
            //For reading the compressed input.
            final BBContainer fileInputBufferC =
                    DBBPool.allocateDirect(CompressionService.maxCompressedLength(DEFAULT_CHUNKSIZE));
            final ByteBuffer fileInputBuffer = fileInputBufferC.b();
            long sinceLastFAdvise = Long.MAX_VALUE;
            long positionAtLastFAdvise = 0;
            while (m_hasMoreChunks) {
                if (sinceLastFAdvise > 1024 * 1024 * 48) {
                    sinceLastFAdvise = 0;
View Full Code Here


        private void readChunks() {
            //For reading the compressed input.
            BBContainer fileInputBufferC =
                    DBBPool.allocateDirect(CompressionService.maxCompressedLength(DEFAULT_CHUNKSIZE));
            ByteBuffer fileInputBuffer = fileInputBufferC.b();
            while (m_hasMoreChunks) {
                /*
                 * Limit the number of chunk materialized into memory at one time
                 */
                try {
View Full Code Here

        }
        private Container getOutputBuffer(final int nextChunkPartitionId) {
            BBContainer c = m_buffers.poll();
            if (c == null) {
                final BBContainer originContainer = DBBPool.allocateDirect(DEFAULT_CHUNKSIZE);
                final ByteBuffer b = originContainer.b();
                final Container retcont = new Container(b, originContainer, nextChunkPartitionId);
                return retcont;
            }
            /*
             * Need to reconstruct the container with the partition id of the next
View Full Code Here

        if (!isReplicated) {
            fs.writeArray(partitionIds);
            fs.writeInt(numPartitions);
        }
        final BBContainer container = fs.getBBContainer();
        container.b().position(4);
        container.b().putInt(container.b().remaining() - 4);
        container.b().position(0);

        FastSerializer schemaSerializer = new FastSerializer();
        int schemaTableLen = schemaTable.getSerializedSize();
View Full Code Here

            fs.writeArray(partitionIds);
            fs.writeInt(numPartitions);
        }
        final BBContainer container = fs.getBBContainer();
        container.b().position(4);
        container.b().putInt(container.b().remaining() - 4);
        container.b().position(0);

        FastSerializer schemaSerializer = new FastSerializer();
        int schemaTableLen = schemaTable.getSerializedSize();
        ByteBuffer serializedSchemaTable = ByteBuffer.allocate(schemaTableLen);
View Full Code Here

            fs.writeArray(partitionIds);
            fs.writeInt(numPartitions);
        }
        final BBContainer container = fs.getBBContainer();
        container.b().position(4);
        container.b().putInt(container.b().remaining() - 4);
        container.b().position(0);

        FastSerializer schemaSerializer = new FastSerializer();
        int schemaTableLen = schemaTable.getSerializedSize();
        ByteBuffer serializedSchemaTable = ByteBuffer.allocate(schemaTableLen);
View Full Code Here

            fs.writeInt(numPartitions);
        }
        final BBContainer container = fs.getBBContainer();
        container.b().position(4);
        container.b().putInt(container.b().remaining() - 4);
        container.b().position(0);

        FastSerializer schemaSerializer = new FastSerializer();
        int schemaTableLen = schemaTable.getSerializedSize();
        ByteBuffer serializedSchemaTable = ByteBuffer.allocate(schemaTableLen);
        schemaTable.flattenToBuffer(serializedSchemaTable);
View Full Code Here

        ByteBuffer serializedSchemaTable = ByteBuffer.allocate(schemaTableLen);
        schemaTable.flattenToBuffer(serializedSchemaTable);
        serializedSchemaTable.flip();
        schemaSerializer.write(serializedSchemaTable);
        final BBContainer schemaContainer = schemaSerializer.getBBContainer();
        schemaContainer.b().limit(schemaContainer.b().limit() - 4);//Don't want the row count
        schemaContainer.b().position(schemaContainer.b().position() + 4);//Don't want total table length

        final PureJavaCrc32 crc = new PureJavaCrc32();
        ByteBuffer aggregateBuffer = ByteBuffer.allocate(container.b().remaining() + schemaContainer.b().remaining());
        aggregateBuffer.put(container.b());
View Full Code Here

        ByteBuffer serializedSchemaTable = ByteBuffer.allocate(schemaTableLen);
        schemaTable.flattenToBuffer(serializedSchemaTable);
        serializedSchemaTable.flip();
        schemaSerializer.write(serializedSchemaTable);
        final BBContainer schemaContainer = schemaSerializer.getBBContainer();
        schemaContainer.b().limit(schemaContainer.b().limit() - 4);//Don't want the row count
        schemaContainer.b().position(schemaContainer.b().position() + 4);//Don't want total table length

        final PureJavaCrc32 crc = new PureJavaCrc32();
        ByteBuffer aggregateBuffer = ByteBuffer.allocate(container.b().remaining() + schemaContainer.b().remaining());
        aggregateBuffer.put(container.b());
View Full Code Here

        schemaTable.flattenToBuffer(serializedSchemaTable);
        serializedSchemaTable.flip();
        schemaSerializer.write(serializedSchemaTable);
        final BBContainer schemaContainer = schemaSerializer.getBBContainer();
        schemaContainer.b().limit(schemaContainer.b().limit() - 4);//Don't want the row count
        schemaContainer.b().position(schemaContainer.b().position() + 4);//Don't want total table length

        final PureJavaCrc32 crc = new PureJavaCrc32();
        ByteBuffer aggregateBuffer = ByteBuffer.allocate(container.b().remaining() + schemaContainer.b().remaining());
        aggregateBuffer.put(container.b());
        container.discard();
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.