Package com.cloudera.cdk.data

Examples of com.cloudera.cdk.data.RandomAccessDatasetRepository


  @Test
  public void testHBaseURI() {
    String zkQuorum = HBaseTestUtils.getConf().get(HConstants.ZOOKEEPER_QUORUM);
    String zkClientPort = HBaseTestUtils.getConf().get(HConstants.ZOOKEEPER_CLIENT_PORT);
    String zk = zkQuorum + ":" + zkClientPort; // OK since zkQuorum is a single host
    RandomAccessDatasetRepository repo = DatasetRepositories.openRandomAccess("repo:hbase:" + zk);

    Assert.assertNotNull("Received a repository", repo);
    assertTrue("Repo is a HBase repo", repo instanceof HBaseDatasetRepository);
  }
View Full Code Here


  @Override
  public int run(String[] args) throws Exception {

    // Construct an HBase dataset repository using the local HBase database
    RandomAccessDatasetRepository repo =
        DatasetRepositories.openRandomAccess("repo:hbase:localhost.localdomain");

    // Load the users dataset
    RandomAccessDataset<User> users = repo.load("users");

    // Get an accessor for the dataset and write some users to it
    users.put(user("bill", "green"));
    users.put(user("alice", "blue"));
    users.put(user("cuthbert", "pink"));
View Full Code Here

  @Override
  public int run(String[] args) throws Exception {

    // Construct an HBase dataset repository using the local HBase database
    RandomAccessDatasetRepository repo =
        DatasetRepositories.openRandomAccess("repo:hbase:localhost.localdomain");

    // Load the users dataset
    RandomAccessDataset<User> users = repo.load("users");

    // Get an accessor for the dataset and look up a user by username
    Key key = new Key.Builder(users).add("username", "bill").build();
    System.out.println(users.get(key));
View Full Code Here

TOP

Related Classes of com.cloudera.cdk.data.RandomAccessDatasetRepository

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.