wbolster/happybase — pull request #63 by ov7a (2014-04-15 15:03:13+00:00)
Title: Multiple Thrift servers

I've encountered a problem that single Thrift server couldn't handle all connections, so I've started more instances of it. But there is only host can be provided as server in happybase API (as far as I understand). So, this is my suggestion.

Usage example:

import happybase

connection = happybase.Connection('localhost:9090,some.other.host:9091,another.host,192.168.1.2:9292')
connection = happybase.Connection('192.168.1.3')
connection = happybase.Connection('192.168.1.3', 9092)
connection = happybase.Connection('192.168.1.3:9090', 9092) #error
connection = happybase.Connection('localhost:9090,another.host,192.168.1.2:9292', 9834) # second param is ignored

Comma-separated hosts can now be provided as ThriftServer host. Random server is chosen and further all interactions use it. Port can be specified after semicolon.