Package org.voltcore.utils.DBBPool

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


        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


        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();
        aggregateBuffer.put(schemaContainer.b());
        schemaContainer.discard();
        aggregateBuffer.flip();
View Full Code Here

        final PureJavaCrc32 crc = new PureJavaCrc32();
        ByteBuffer aggregateBuffer = ByteBuffer.allocate(container.b().remaining() + schemaContainer.b().remaining());
        aggregateBuffer.put(container.b());
        container.discard();
        aggregateBuffer.put(schemaContainer.b());
        schemaContainer.discard();
        aggregateBuffer.flip();
        crc.update(aggregateBuffer.array(), 4, aggregateBuffer.capacity() - 4);

        final int crcValue = (int) crc.getValue();
View Full Code Here

            tupleData.discard();
            return null;
        }

        if (prependLength) {
            tupleData.b().putInt(tupleData.b().remaining() - 4);
            tupleData.b().position(0);
        }

        m_outstandingWriteTasks.incrementAndGet();
        ListenableFuture<?> writeTask = m_es.submit(new Callable<Object>() {
View Full Code Here

            tupleData.discard();
            return null;
        }

        if (prependLength) {
            tupleData.b().putInt(tupleData.b().remaining() - 4);
            tupleData.b().position(0);
        }

        m_outstandingWriteTasks.incrementAndGet();
        ListenableFuture<?> writeTask = m_es.submit(new Callable<Object>() {
View Full Code Here

            return null;
        }

        if (prependLength) {
            tupleData.b().putInt(tupleData.b().remaining() - 4);
            tupleData.b().position(0);
        }

        m_outstandingWriteTasks.incrementAndGet();
        ListenableFuture<?> writeTask = m_es.submit(new Callable<Object>() {
            @Override
View Full Code Here

                        if (m_simulateFullDiskWritingChunk) {
                            throw new IOException("Disk full");
                        }
                    }

                    m_bytesAllowedBeforeSync.acquire(tupleData.b().remaining());

                    int totalWritten = 0;
                    while (tupleData.b().hasRemaining()) {
                        totalWritten += m_channel.write(tupleData.b());
                    }
View Full Code Here

                    }

                    m_bytesAllowedBeforeSync.acquire(tupleData.b().remaining());

                    int totalWritten = 0;
                    while (tupleData.b().hasRemaining()) {
                        totalWritten += m_channel.write(tupleData.b());
                    }
                    m_bytesWritten += totalWritten;
                    m_bytesWrittenSinceLastSync.addAndGet(totalWritten);
                } catch (IOException e) {
View Full Code Here

                    m_bytesAllowedBeforeSync.acquire(tupleData.b().remaining());

                    int totalWritten = 0;
                    while (tupleData.b().hasRemaining()) {
                        totalWritten += m_channel.write(tupleData.b());
                    }
                    m_bytesWritten += totalWritten;
                    m_bytesWrittenSinceLastSync.addAndGet(totalWritten);
                } catch (IOException e) {
                    m_writeException = e;
View Full Code Here

                BBContainer cont = input.call();
                if (cont == null) {
                    return null;
                }
                try {
                    ByteBuffer buf = ByteBuffer.allocate(m_schemaBytes.length + cont.b().remaining() - 4);
                    buf.put(m_schemaBytes);
                    cont.b().position(4);
                    buf.put(cont.b());

                    VoltTable vt = PrivateVoltTableFactory.createVoltTableFromBuffer(buf, true);
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.