Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-11518

doc update for how to create non-shared HConnection

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 0.96.2, 0.94.21, 0.98.4
    • Fix Version/s: 0.99.0, 0.98.5
    • Component/s: documentation
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      creation for non-shared connections has changed since hbase-3777, but the doc still remains the same...

      a simple test program:
      public class testHbase2{
      public static void main(String[] args) throws Exception

      { Configuration conf = HBaseConfiguration.create(); conf.set("hbase.zookeeper.quorum","localhost"); conf.set("hbase.zookeeper.property.clientPort", "2181"); conf.set("hbase.client.instance.id", "2"); HBaseAdmin admin = new HBaseAdmin(conf); conf.set("hbase.client.instance.id", "3"); HBaseAdmin admin2 = new HBaseAdmin(conf); }

      }

      public static HConnection getConnection(final Configuration conf)
      throws IOException {
      HConnectionKey connectionKey = new HConnectionKey(conf);
      LOG.info("###create new connectionkey: " + connectionKey);
      synchronized (CONNECTION_INSTANCES) {

      14/07/15 18:06:08 INFO client.HConnectionManager: ###create new connectionkey: HConnectionKey{properties=

      {hbase.rpc.timeout=600000, hbase.client.instance.id=2, hbase.zookeeper.quorum=localhost, hbase.client.pause=100, hbase.zookeeper.property.clientPort=2181, zookeeper.znode.parent=/hbase, hbase.client.retries.number=35}

      , username='tianq'}
      14/07/15 18:06:08 INFO client.HConnectionManager: ###create new connection###
      14/07/15 18:06:08 INFO zookeeper.RecoverableZooKeeper: Process identifier=hconnection-0x3d7c3d7c connecting to ZooKeeper ensemble=localhost:2181
      14/07/15 18:06:09 INFO client.HConnectionManager: ###create new connectionkey: HConnectionKey{properties=

      {hbase.rpc.timeout=600000, hbase.client.instance.id=3, hbase.zookeeper.quorum=localhost, hbase.client.pause=100, hbase.zookeeper.property.clientPort=2181, zookeeper.znode.parent=/hbase, hbase.client.retries.number=35}

      , username='tianq'}
      14/07/15 18:06:09 INFO client.HConnectionManager: ###create new connection###
      14/07/15 18:06:09 INFO zookeeper.RecoverableZooKeeper: Process identifier=hconnection-0xd460d46 connecting to ZooKeeper ensemble=localhost:2181

        Attachments

        1. HBASE-11518-master-v2.patch
          4 kB
          Qiang Tian
        2. HBASE-11518-master-v1.patch
          2 kB
          Qiang Tian
        3. hbase-11518-master.patch
          1 kB
          Qiang Tian

          Activity

            People

            • Assignee:
              tianq Qiang Tian
              Reporter:
              tianq Qiang Tian
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: