Package org.voltdb.client

Examples of org.voltdb.client.ProcedureCallback


    public void testExplicitErrorUDF() throws Exception
    {
        System.out.println("STARTING testExplicitErrorUDF");
        Client client = getClient();
        ProcedureCallback callback = new ProcedureCallback() {
            @Override
            public void clientCallback(ClientResponse clientResponse)
                    throws Exception {
                if (clientResponse.getStatus() != ClientResponse.SUCCESS) {
                    throw new RuntimeException("Failed with response: " + clientResponse.getStatusString());
View Full Code Here


                // Should never happened because the bulk conversion in PerPartitionProcessor
                // should have caught this
                continue;
            }

            ProcedureCallback callback = new ProcedureCallback() {
                @Override
                public void clientCallback(ClientResponse response) throws Exception {
                    row.m_loader.m_outstandingRowCount.decrementAndGet();
                    row.m_loader.m_loaderCompletedCnt.incrementAndGet();
View Full Code Here

            assert(table.getColumnType(0).isInteger());
        }

        final AtomicLong rss = new AtomicLong(0);

        ProcedureCallback insertCallback = new ProcedureCallback() {
            @Override
            public void clientCallback(ClientResponse clientResponse) throws Exception {
                if (clientResponse.getStatus() != ClientResponse.SUCCESS) {
                    System.out.println("Error in loader callback:");
                    System.out.println(((ClientResponseImpl)clientResponse).toJSONString());
View Full Code Here

        // track outstanding responses so 10k can be out at a time
        final AtomicInteger outstanding = new AtomicInteger(0);
        final AtomicLong deleteCount = new AtomicLong(0);

        ProcedureCallback callback = new ProcedureCallback() {
            @Override
            public void clientCallback(ClientResponse clientResponse) throws Exception {
                outstanding.decrementAndGet();
                if (clientResponse.getStatus() != ClientResponse.SUCCESS) {
                    System.out.println("Error in deleter callback:");
View Full Code Here

            final CountDownLatch latch = new CountDownLatch(t.getRowCount());
            int columns = t.getColumnCount();
            String procedureName = t.m_extraMetadata.name.toUpperCase() + ".insert";

            // callback for async row insertion tracks response count + failure
            final ProcedureCallback insertCallback = new ProcedureCallback() {
                @Override
                public void clientCallback(ClientResponse clientResponse) throws Exception {
                    latch.countDown();
                    if (clientResponse.getStatus() != ClientResponse.SUCCESS) {
                        failed.set(true);
View Full Code Here

            if (m_voltClient != null) {
                // XXX
                final int numPermits = 48;
                final Semaphore maxOutstandingInvocations = new Semaphore(numPermits);
                final int totalInvocations = customerNamesTables.size() * m_parameters.warehouses;
                final ProcedureCallback callback = new ProcedureCallback() {
                    private int invocationsCompleted = 0;

                    private double lastPercentCompleted = 0.0;
                    @Override
                    public synchronized void clientCallback(ClientResponse clientResponse) {
View Full Code Here

                Math.abs(rand.nextLong()) % poolSize :
                Math.abs(rand.nextLong()) % (totalPartitions * maxGroupsPerPartition);

        long rowid = Math.abs(rand.nextLong()) % 1000;

        Con.executeAsync(new ProcedureCallback()
        {
            @Override
            public void clientCallback(ClientResponse response) throws Exception
            {
                // Track the result of the request (Success, Failure)
View Full Code Here

    }

    private static void doLoader(final int poolSize) throws Exception {
        for (int i=0; i <= poolSize; i++) {
            for (int rowid = 0; rowid < 1000; rowid++) {
                Con.executeAsync(new ProcedureCallback()
                {
                    @Override
                    public void clientCallback(ClientResponse response) throws Exception
                    {
                        if (response.getStatus() != ClientResponse.SUCCESS) {
View Full Code Here

    static void insertNewHashtag(Client client, String hashtag, long time)
    {
        try
        {
            while (!client.callProcedure(new ProcedureCallback()
                {
                    @Override
                    public void clientCallback(ClientResponse response) {
                        if (response.getStatus() != ClientResponse.SUCCESS){
                            System.out.println("failed insert");
View Full Code Here

    static void insertNewTweet(Client client, String username, long time)
    {
        try
        {
            while (!client.callProcedure(new ProcedureCallback()
                {
                    @Override
                    public void clientCallback(ClientResponse response) {
                        if (response.getStatus() != ClientResponse.SUCCESS){
                            System.out.println("failed insert");
View Full Code Here

TOP

Related Classes of org.voltdb.client.ProcedureCallback

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.