Examples of HConnection


Examples of org.apache.hadoop.hbase.client.HConnection

      }
    }
  }

  private static String getPeerQuorumAddress(final Configuration conf) throws IOException {
    HConnection conn = HConnectionManager.getConnection(conf);
    try {
      ReplicationZookeeper zk = new ReplicationZookeeper(conn, conf,
          conn.getZooKeeperWatcher());

      ReplicationPeer peer = zk.getPeer(peerId);
      if (peer == null) {
        throw new IOException("Couldn't get peer conf!");
      }

      Configuration peerConf = peer.getConfiguration();
      return ZKUtil.getZooKeeperClusterKey(peerConf);
    } catch (KeeperException e) {
      throw new IOException("Got a ZK exception", e);
    } finally {
      conn.close();
    }
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.client.HConnection

   * @throws TableNotFoundException if table does not yet exist
   */
  public void doBulkLoad(Path hfofDir, final HTable table)
    throws TableNotFoundException, IOException
  {
    final HConnection conn = table.getConnection();

    if (!conn.isTableAvailable(table.getTableName())) {
      throw new TableNotFoundException("Table " +
          Bytes.toStringBinary(table.getTableName()) +
          "is not currently available.");
    }

View Full Code Here

Examples of org.apache.hadoop.hbase.hbql.client.HConnection

        final byte[] family = Bytes.toBytes("family1");
        final byte[] author = Bytes.toBytes("author");
        final byte[] title = Bytes.toBytes("title");

        HConnection connection = HConnectionManager.newConnection();

        connection.execute("CREATE TEMP MAPPING testobjects alias testobjects2"
                           + "("
                           + "keyval key, "
                           + "family1 ("
                           + "  author string alias author, "
                           + "  title string  alias title"
                           + "))");

        HMapping mapping = connection.getMapping("testobjects");

        final RecordFilter filter = ((TableMapping)mapping)
                .newRecordFilter("title LIKE '.*3.*' OR family1:author LIKE '.*4.*'");

        Scan scan = new Scan();
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.