[ 
https://issues.apache.org/jira/browse/HBASE-4568?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Liyin Tang updated HBASE-4568:
------------------------------

    Description: 
For each zk dump, currently hbase will create a zk client instance every time. 
This is quite slow when any machines in the quorum is dead. Because it will 
connect to each machine in the zk quorum again.

  HMaster master = (HMaster)getServletContext().getAttribute(HMaster.MASTER);
  Configuration conf = master.getConfiguration();
  HBaseAdmin hbadmin = new HBaseAdmin(conf);
  HConnection connection = hbadmin.getConnection();
  ZooKeeperWatcher watcher = connection.getZooKeeperWatcher();


So we can simplify this:
  HMaster master = (HMaster)getServletContext().getAttribute(HMaster.MASTER);
  ZooKeeperWatcher watcher = master.getZooKeeperWatcher();


Also when hbase call getServerStats() for each machine in the zk quorum, it 
hard coded the default time out as 1 min. 
It would be nice to make this configurable and set it to a low time out.

When hbase tries to connect to each machine in the zk quorum, it will create 
the socket, and then set the socket time out, and read it with this time out.
It means hbase will create a socket and connect to the zk server with 0 time 
out at first, which will take a long time. 
Because a timeout of zero is interpreted as an infinite timeout. The connection 
will then block until established or an error occurs.




  was:
For each zk dump, currently hbase will create a zk client instance every time. 
This is quite slow when any machines in the quorum is dead. Because it will 
connect to each machine in the zk quorum again.

  HMaster master = (HMaster)getServletContext().getAttribute(HMaster.MASTER);
  Configuration conf = master.getConfiguration();
  HBaseAdmin hbadmin = new HBaseAdmin(conf);
  HConnection connection = hbadmin.getConnection();
  ZooKeeperWatcher watcher = connection.getZooKeeperWatcher();


So we can simplify this:
  HMaster master = (HMaster)getServletContext().getAttribute(HMaster.MASTER);
  ZooKeeperWatcher watcher = master.getZooKeeperWatcher();


Also when hbase call getServerStats() for each machine in the zk quorum, it 
hard coded the default time out as 1 min. 
It would be nice to make this configurable and set it to a low time out.


    
> Make zk dump jsp response more quickly
> --------------------------------------
>
>                 Key: HBASE-4568
>                 URL: https://issues.apache.org/jira/browse/HBASE-4568
>             Project: HBase
>          Issue Type: Improvement
>            Reporter: Liyin Tang
>            Assignee: Liyin Tang
>
> For each zk dump, currently hbase will create a zk client instance every 
> time. 
> This is quite slow when any machines in the quorum is dead. Because it will 
> connect to each machine in the zk quorum again.
>   HMaster master = (HMaster)getServletContext().getAttribute(HMaster.MASTER);
>   Configuration conf = master.getConfiguration();
>   HBaseAdmin hbadmin = new HBaseAdmin(conf);
>   HConnection connection = hbadmin.getConnection();
>   ZooKeeperWatcher watcher = connection.getZooKeeperWatcher();
> So we can simplify this:
>   HMaster master = (HMaster)getServletContext().getAttribute(HMaster.MASTER);
>   ZooKeeperWatcher watcher = master.getZooKeeperWatcher();
> Also when hbase call getServerStats() for each machine in the zk quorum, it 
> hard coded the default time out as 1 min. 
> It would be nice to make this configurable and set it to a low time out.
> When hbase tries to connect to each machine in the zk quorum, it will create 
> the socket, and then set the socket time out, and read it with this time out.
> It means hbase will create a socket and connect to the zk server with 0 time 
> out at first, which will take a long time. 
> Because a timeout of zero is interpreted as an infinite timeout. The 
> connection will then block until established or an error occurs.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to