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

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


    public void describeMapping() throws HBqlException {

        // START SNIPPET: describe-mapping

        HConnection conn = HConnectionManager.newConnection();
        System.out.println(conn.execute("DESCRIBE MAPPING fooMapping"));

        // END SNIPPET: describe-mapping

    }
View Full Code Here


    public void enableTable() throws HBqlException {

        // START SNIPPET: enable-table

        HConnection conn = HConnectionManager.newConnection();
        System.out.println(conn.execute("ENABLE TABLE foo"));

        // Or using the API
        conn.enableTable("foo");

        // END SNIPPET: enable-table
View Full Code Here

    public void disableTable() throws HBqlException {

        // START SNIPPET: disable-table

        HConnection conn = HConnectionManager.newConnection();
        conn.execute("DISABLE TABLE foo");

        // Or using the API
        conn.disableTable("foo");

        // END SNIPPET: disable-table
View Full Code Here

        // START SNIPPET: drop-mapping

        HConnection conn = HConnectionManager.newConnection();

        conn.execute("DROP MAPPING fooMapping");

        // Or using the API
        conn.dropMapping("fooMapping");

        // END SNIPPET: drop-mapping
View Full Code Here

    public void createTable() throws HBqlException {

        // START SNIPPET: create-table

        HConnection conn = HConnectionManager.newConnection();
        conn.execute("CREATE TABLE foo (family1 (MAX_VERSIONS: 10), family2(), family3 (MAX_VERSIONS: 15))");

        // END SNIPPET: create-table

    }
View Full Code Here

    public void createIndex() throws HBqlException {

        // START SNIPPET: create-index

        HConnection conn = HConnectionManager.newConnection();
        conn.execute("CREATE INDEX fooidx ON fooMapping (family1:col1) INCLUDE (family1:col2, family1:col3)");

        // END SNIPPET: create-index

    }
View Full Code Here

        // START SNIPPET: alter-table

        HConnection conn = HConnectionManager.newConnection();

        // Drop family family1
        conn.execute("ALTER TABLE foo DROP FAMILY family1, DROP FAMILY family2");

        // Add family family4
        conn.execute("ALTER TABLE foo ADD FAMILY family4 (MAX_VERSIONS: 10), ADD FAMILY family6()");

        // Rename family family4 to family5
View Full Code Here

        // Drop family family1
        conn.execute("ALTER TABLE foo DROP FAMILY family1, DROP FAMILY family2");

        // Add family family4
        conn.execute("ALTER TABLE foo ADD FAMILY family4 (MAX_VERSIONS: 10), ADD FAMILY family6()");

        // Rename family family4 to family5
        conn.execute("ALTER TABLE foo ALTER FAMILY family4 TO family5 (MAX_VERSIONS: 10)");

        // END SNIPPET: alter-table
View Full Code Here

        // Add family family4
        conn.execute("ALTER TABLE foo ADD FAMILY family4 (MAX_VERSIONS: 10), ADD FAMILY family6()");

        // Rename family family4 to family5
        conn.execute("ALTER TABLE foo ALTER FAMILY family4 TO family5 (MAX_VERSIONS: 10)");

        // END SNIPPET: alter-table

    }
View Full Code Here

    public void dropTable() throws HBqlException {

        // START SNIPPET: drop-table

        HConnection conn = HConnectionManager.newConnection();
        conn.execute("DROP TABLE foo");

        // Or using the API
        conn.dropTable("foo");

        // END SNIPPET: drop-table
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.