Package org.apache.hadoop.hbase.hbql.client

Examples of org.apache.hadoop.hbase.hbql.client.HStatement.execute()


        // Get a connection with an HTablePool size of 10
        HConnectionManager.setMaxPoolReferencesPerTablePerConnection(10);
        HConnection conn = HConnectionManager.newConnection();

        HStatement stmt = conn.createStatement();
        stmt.execute("CREATE TABLE table12 (f1(), f3()) IF NOT tableexists('table12')");

        stmt.execute("CREATE TEMP MAPPING sch9 FOR TABLE table12"
                     + "("
                     + "keyval key, "
                     + "f1 ("
View Full Code Here


        HConnection conn = HConnectionManager.newConnection();

        HStatement stmt = conn.createStatement();
        stmt.execute("CREATE TABLE table12 (f1(), f3()) IF NOT tableexists('table12')");

        stmt.execute("CREATE TEMP MAPPING sch9 FOR TABLE table12"
                     + "("
                     + "keyval key, "
                     + "f1 ("
                     + "    val1 string alias val1, "
                     + "    val2 string alias val2 "
View Full Code Here

            System.out.print(", val6: " + val6);
            System.out.print(", val1: " + val1);
            System.out.println(", val2: " + val2);
        }

        stmt.execute("DISABLE TABLE table12");
        stmt.execute("DROP TABLE table12");
        stmt.close();

        conn.close();
View Full Code Here

            System.out.print(", val1: " + val1);
            System.out.println(", val2: " + val2);
        }

        stmt.execute("DISABLE TABLE table12");
        stmt.execute("DROP TABLE table12");
        stmt.close();

        conn.close();

        // END SNIPPET: hbqlapi1
View Full Code Here

        // START SNIPPET: hbqlapi3

        HConnection conn = HConnectionManager.newConnection();

        HStatement stmt = conn.createStatement();
        stmt.execute("CREATE TABLE table12 (f1(), f3()) IF NOT tableexists('table12')");

        stmt.execute("CREATE TEMP MAPPING sch9 FOR TABLE table12"
                     + "("
                     + "keyval key, "
                     + "f1 ("
View Full Code Here

        HConnection conn = HConnectionManager.newConnection();

        HStatement stmt = conn.createStatement();
        stmt.execute("CREATE TABLE table12 (f1(), f3()) IF NOT tableexists('table12')");

        stmt.execute("CREATE TEMP MAPPING sch9 FOR TABLE table12"
                     + "("
                     + "keyval key, "
                     + "f1 ("
                     + "    val1 string alias val1, "
                     + "    val2 string alias val2 "
View Full Code Here

    @Test
    public void simpleSelect1() throws HBqlException {

        HStatement stmt = connection.createStatement();
        // stmt.execute("DROP INDEX foo1 ON MAPPING tab4 if indexexistsfortable('table21', 'foo1')");
        stmt.execute("CREATE INDEX foo1 ON MAPPING tab4 (f1:val1) if not indexexistsformapping('foo1', 'tab4')");

        final String q1 = "select * from tab4";
        final int rec_cnt = showValues(q1, false);
        assertTrue(rec_cnt == 10);
    }
View Full Code Here

    @Test
    public void simpleSelect9a() throws HBqlException {

        HStatement stmt = connection.createStatement();
        System.out.println(stmt.execute("CREATE QUERY EXECUTOR POOL threadPool1 " +
                                        "(max_executor_pool_size: 5, max_thread_count: 2, " +
                                        "threads_read_results: true, completion_queue_size: 100) " +
                                        "if not queryExecutorPoolExists('threadPool1')"));

        // ExecutorPoolManager.newExecutorPool("threadPool1", 2, 10);
View Full Code Here

    @Test
    public void simpleSelect10() throws HBqlException {

        HStatement stmt = connection.createStatement();

        System.out.println(stmt.execute("CREATE QUERY EXECUTOR POOL threadPool1 " +
                                        "(max_executor_pool_size: 5, max_thread_count: 4, " +
                                        "threads_read_results: true, completion_queue_size: 100) " +
                                        "if not queryExecutorPoolExists('threadPool1')"));
        System.out
                .println(stmt.execute("DROP QUERY EXECUTOR POOL threadPool1 if queryExecutorPoolExists('threadPool1')"));
View Full Code Here

        System.out.println(stmt.execute("CREATE QUERY EXECUTOR POOL threadPool1 " +
                                        "(max_executor_pool_size: 5, max_thread_count: 4, " +
                                        "threads_read_results: true, completion_queue_size: 100) " +
                                        "if not queryExecutorPoolExists('threadPool1')"));
        System.out
                .println(stmt.execute("DROP QUERY EXECUTOR POOL threadPool1 if queryExecutorPoolExists('threadPool1')"));
        System.out.println(stmt.execute("CREATE QUERY EXECUTOR POOL threadPool1 " +
                                        "(max_executor_pool_size: 5, max_thread_count: 4, " +
                                        "threads_read_results: true, completion_queue_size: 100)"));

        connection.setQueryExecutorPoolName("threadPool1");
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.