Package org.voltdb.client

Examples of org.voltdb.client.Client.createConnection()


            fail("Connection creation shouldn't fail: " + e.getMessage());
        }

        try {
            Client client = ClientFactory.createClient();
            client.createConnection("localhost", m_config.port(0));
            client.callProcedure("Insert", 13);
            client.close();

            String sql = "select count(*) from T WHERE A1 = ?;";
            PreparedStatement ps = conn.prepareStatement(sql);
View Full Code Here


            localServer = new ServerThread(config);
            localServer.start();
            localServer.waitForInitialization();

            client = ClientFactory.createClient();
            client.createConnection("localhost");

            // insert data
            ClientResponse cr = client.callProcedure("Insert", 5, new byte[] { 'a', 'b', 'c', 'd' }, "hi", new byte[] { 'a' });
            assertTrue(cr.getStatus() == ClientResponse.SUCCESS);
View Full Code Here

            System.out.printf("PRE:  %s\n", TableHelper.ddlForTable(t1));
            System.out.printf("POST: %s\n", TableHelper.ddlForTable(t2));

            ClientConfig clientConfig = new ClientConfig();
            client = ClientFactory.createClient(clientConfig);
            client.createConnection("localhost");

            TableHelper.loadTable(client, t1);

            ClientResponseImpl response = (ClientResponseImpl) client.callProcedure(
                    "@UpdateApplicationCatalog", catBytes2, null);
View Full Code Here

            TableHelper.migrateTable(t1, t2);
            t2 = TableHelper.sortTable(t2);

            ClientConfig clientConfig = new ClientConfig();
            client = ClientFactory.createClient(clientConfig);
            client.createConnection("localhost");

            TableHelper.loadTable(client, t1);

            if (alterText.trim().length() > 0) {
                ClientResponseImpl response = (ClientResponseImpl) client.callProcedure(
View Full Code Here

            localServer = new ServerThread(config);
            localServer.start();
            localServer.waitForInitialization();

            client = ClientFactory.createClient();
            client.createConnection("localhost");

            // insert data
            // long c_id, long c_d_id, long c_w_id, String c_first, String c_middle,
            // String c_last, String c_street_1, String c_street_2, String d_city,
            // String d_state, String d_zip, String c_phone, Date c_since, String
View Full Code Here

            localServer = new ServerThread(config);
            localServer.start();
            localServer.waitForInitialization();

            client = ClientFactory.createClient();
            client.createConnection("localhost");

            byte[] b = new byte[5000000];
            char[] c = new char[5000000];
            for (int i = 0; i < b.length; i++) {
                b[i] = (byte) (i % 256);
View Full Code Here

            localServer = new ServerThread(config);
            localServer.start();
            localServer.waitForInitialization();

            client = ClientFactory.createClient();
            client.createConnection("localhost");

            try {
                ByteBuffer buf = ByteBuffer.allocate(4);
                buf.order(ByteOrder.LITTLE_ENDIAN);
                buf.putInt(7);
View Full Code Here

                // trigger classloading a couple times
                {
                    ClientConfig config = new ClientConfig("program", "none");
                    Client client = ClientFactory.createClient(config);
                    client.createConnection("localhost");
                    for (int i = 0; i < 10000; i++)
                        client.callProcedure("EmptyProcedure", 0L);
                }

                ExecutorService executor = Executors
View Full Code Here

                    futures.add(executor.submit(new Callable<Integer>() {
                        public Integer call() {
                            try {
                                ClientConfig config = new ClientConfig("program", "none");
                                Client client = ClientFactory.createClient(config);
                                client.createConnection("localhost");

                                int count = 0;
                                barrier.await();

                                for (count = 0; count % 10 != 0
View Full Code Here

    static void connectToOneServerWithRetry(String server, int port) {
        Client client = clientRef.get();
        int sleep = 1000;
        while (true) {
            try {
                client.createConnection(server, port);
                break;
            }
            catch (Exception e) {
                System.err.printf("Connection to " + server + " failed - retrying in %d second(s).\n", sleep / 1000);
                try { Thread.sleep(sleep); } catch (Exception interruted) {}
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.