Package org.voltdb

Examples of org.voltdb.ClientResponseImpl


                                  Pair<Long, byte[]> currentHashinatorConfig) {
        m_mispartitioned = mispartitioned;
        m_invocation = invocation;
        m_currentHashinatorConfig = currentHashinatorConfig;
        m_commit = false;
        m_response = new ClientResponseImpl(ClientResponse.TXN_RESTART, new VoltTable[]{}, "Mispartitioned");
    }
View Full Code Here


        m_clientInterfaceHandle = buf.getLong();
        m_connectionId = buf.getLong();
        m_readOnly = buf.get() == 1;
        m_recovering = buf.get() == 1;
        m_mispartitioned = buf.get() == 1;
        m_response = new ClientResponseImpl();
        m_response.initFromBuffer(buf);
        m_commit = (m_response.getStatus() == ClientResponseImpl.SUCCESS);
        if (m_mispartitioned) {
            long hashinatorVersion = buf.getLong();
            byte[] hashinatorBytes = new byte[buf.getInt()];
View Full Code Here

    }


    public void pokeLastCallback(final byte status, final String message) throws Exception
    {
        ClientResponse clientResponse = new ClientResponseImpl(status, new VoltTable[0], message);
        m_lastCallback.clientCallback(clientResponse);
    }
View Full Code Here

        m_lastCallback.clientCallback(clientResponse);
    }

    public void pokeAllPendingCallbacks(final byte status, final String message) throws Exception
    {
        ClientResponse clientResponse = new ClientResponseImpl(status, new VoltTable[0], message);
        ProcedureCallback callback = null;
        while ((callback = m_callbacks.poll()) != null) {
            callback.clientCallback(clientResponse);
        }
    }
View Full Code Here

        }
        else
        {
            lastOrigTxnId = originalTxnId;
        }
        return new ClientResponseImpl(ClientResponse.SUCCESS, new VoltTable[0], "");
    }
View Full Code Here

        /**
         * Handle an incoming message
         * @throws IOException
         */
        public void handleInput(ByteBuffer message, Connection connection) throws IOException {
            ClientResponseImpl response = new ClientResponseImpl();
            response.initFromBuffer(message);
            ProcedureCallback cb = null;
            cb = m_callbacks.remove(response.getClientHandle());
            if (cb != null) {
                try {
                    cb.clientCallback(response);
                } catch (Throwable t) {
                    t.printStackTrace();
View Full Code Here

                new VoltTable.ColumnInfo("foobar", VoltType.STRING)
        );
        table.addRow("howmanylicksdoesittaketogettothecenterofatootsiepop");

        InitiateResponseMessage iresponse = new InitiateResponseMessage(itask);
        iresponse.setResults( new ClientResponseImpl(ClientResponse.GRACEFUL_FAILURE,
                new VoltTable[] { table, table }, "knockknockbananna"));
        iresponse.setClientHandle(99);

        InitiateResponseMessage iresponse2 = (InitiateResponseMessage) checkVoltMessage(iresponse);
View Full Code Here

                new VoltTable.ColumnInfo("foobar", VoltType.STRING)
        );
        table.addRow("howmanylicksdoesittaketogettothecenterofatootsiepop");

        InitiateResponseMessage iresponse = new InitiateResponseMessage(itask);
        iresponse.setResults( new ClientResponseImpl(ClientResponse.GRACEFUL_FAILURE,
                new VoltTable[] { table, table }, "knockknockbananna"));
        iresponse.setClientHandle(99);

        InitiateResponseMessage iresponse2 = (InitiateResponseMessage) checkVoltMessage(iresponse);
View Full Code Here

        // use it for response construction, etc.
        ArgumentCaptor<Iv2InitiateTaskMessage> replmsg = ArgumentCaptor.forClass(Iv2InitiateTaskMessage.class);
        verify(mbox, times(1)).send(eq(new long[] {2}), replmsg.capture());
        assertEquals(dut_hsid, replmsg.getValue().getInitiatorHSId());
        InitiateResponseMessage resp = new InitiateResponseMessage(sptask);
        ClientResponseImpl cr = mock(ClientResponseImpl.class);
        resp.setResults(cr);
        InitiateResponseMessage replresp = new InitiateResponseMessage(replmsg.getValue());
        replresp.setResults(cr);
        dut.deliver(resp);
        dut.deliver(replresp);
View Full Code Here

                    } else {
                        vt = new VoltTable[1];
                        vt[0] = new VoltTable(new VoltTable.ColumnInfo("Foo", VoltType.BIGINT));
                        vt[0].addRow(1);
                    }
                    ClientResponseImpl response;
                    if (sendProcTimeout.get()) {
                        response = new ClientResponseImpl(ClientResponseImpl.CONNECTION_TIMEOUT, vt,
                                "Timeout String", spi.getClientHandle());
                    } else {
                        response = new ClientResponseImpl(ClientResponseImpl.SUCCESS, vt,
                                "Extra String", spi.getClientHandle());
                    }
                    ByteBuffer buf = ByteBuffer.allocate(4 + response.getSerializedSize());
                    buf.putInt(buf.capacity() - 4);
                    response.flattenToBuffer(buf);
                    buf.clear();
                    c.writeStream().enqueue(buf);
                    roundTrips.incrementAndGet();
                    System.err.println("Sending response.");
                }
View Full Code Here

TOP

Related Classes of org.voltdb.ClientResponseImpl

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.