Package org.voltdb.utils.DBBPool

Examples of org.voltdb.utils.DBBPool.BBContainer


        VoltTable[] results = new VoltTable[] { constructResultsTable() };
        results[0].addRow(m_hostId, hostname, m_siteId, tableName, 0, "NO DATA TO DISTRIBUTE", "");
        final Table new_catalog_table = getCatalogTable(tableName);
        Boolean needsConversion = null;
        BBContainer c = null;

        int c_size = 1024 * 1024;
        ByteBuffer c_aggregate = ByteBuffer.allocateDirect(c_size);

        try {
            VoltTable table = null;
            c = null;

            while (hasMoreChunks()) {
                c = getNextChunk();
                if (c == null) {
                    continue; // Should be equivalent to break
                }

                c_aggregate.put(c.b);
            }

            LOG.trace("c_aggregate position :" + c_aggregate.position());
            LOG.trace("c_aggregate capacity :" + c_aggregate.capacity());

            if (needsConversion == null) {
                VoltTable old_table = PrivateVoltTableFactory.createVoltTableFromBuffer(c_aggregate.duplicate(), true);
                needsConversion = SavedTableConverter.needsConversion(old_table, new_catalog_table);
            }

            final VoltTable old_table = PrivateVoltTableFactory.createVoltTableFromBuffer(c_aggregate, true);
            if (needsConversion) {
                table = SavedTableConverter.convertTable(old_table, new_catalog_table);
            } else {
                table = old_table;
            }

            LOG.trace("createPartitionedTables :" + tableName);

            VoltTable[] partitioned_tables = createPartitionedTables(tableName, table);
            if (c != null) {
                c.discard();
            }

            // LoadMultipartitionTable -- send data to all ..

            int[] dependencyIds = new int[sites_to_partitions.size()];
View Full Code Here


        fs.writeBoolean(isReplicated);
        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();
        schemaTable.writeExternal(schemaSerializer);
        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 CRC32 crc = new CRC32();
        ByteBuffer aggregateBuffer = ByteBuffer.allocate(container.b.remaining() + schemaContainer.b.remaining());
View Full Code Here

                newRemaining += newCapacity;
                newCapacity *= 2;
            }

            // Allocate and copy
            BBContainer next;
            if (isDirect) {
                next = DBBPool.allocateDirect(newCapacity);
            } else if (m_pool != null) {
                next = m_pool.acquire(newCapacity);
            } else {
View Full Code Here

TOP

Related Classes of org.voltdb.utils.DBBPool.BBContainer

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.