Package org.voltdb.export

Examples of org.voltdb.export.ExportProtoMessage$AdvertisedDataSource


    public ExportProtoMessage exportAction(boolean ackAction, boolean pollAction,
            boolean resetAction, boolean syncAction,
            long ackTxnId, long seqNo, int partitionId, long tableId)
    {
        deserializer.clear();
        ExportProtoMessage result = null;
        try {
            long offset = nativeExportAction(this.pointer, ackAction, pollAction, resetAction,
                                             syncAction, ackTxnId, seqNo, tableId);
            if (offset < 0) {
                result = new ExportProtoMessage(partitionId, tableId);
                result.error();
            }
            else if (pollAction) {
                ByteBuffer b;
                int byteLen = deserializer.readInt();
                if (byteLen < 0) {
                    throw new IOException("Invalid length in Export poll response results.");
                }

                // need to keep the embedded length in the resulting buffer.
                // the buffer's embedded length prefix is not self-inclusive,
                // so add it back to the byteLen.
                deserializer.buffer().position(0);
                b = deserializer.readBuffer(byteLen + 4);
                result = new ExportProtoMessage(partitionId, tableId);
                result.pollResponse(offset, b);
            }
        }
        catch (IOException e) {
            // TODO: Not going to rollback here so EEException seems wrong?
            // Seems to indicate invalid Export data which should be hard error?
View Full Code Here


            while (results.remaining() > 0)
                m_connection.m_socketChannel.read(results);
            results.flip();
            long result_offset = results.getLong();
            if (result_offset < 0) {
                ExportProtoMessage reply = null;
                reply = new ExportProtoMessage(partitionId, mTableId);
                reply.error();
                return reply;
            }
            else {
                results = ByteBuffer.allocate(4);
                while (results.remaining() > 0)
                    m_connection.m_socketChannel.read(results);
                results.flip();
                int result_sz = results.getInt();
                data = ByteBuffer.allocate(result_sz + 4);
                data.putInt(result_sz);
                while (data.remaining() > 0)
                    m_connection.m_socketChannel.read(data);
                data.flip();

                ExportProtoMessage reply = null;
                if (pollAction) {
                    reply = new ExportProtoMessage(partitionId, mTableId);
                    reply.pollResponse(result_offset, data);
                }
                return reply;
            }

        } catch (final IOException e) {
View Full Code Here

TOP

Related Classes of org.voltdb.export.ExportProtoMessage$AdvertisedDataSource

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.