@@ -69,7 +69,7 @@ def request(self, pb_req):
6969
7070class MasterService (Service ):
7171
72- def __init__ (self , zkquorum ):
72+ def __init__ (self , zkquorum , zkpath = None ):
7373 """Master service.
7474
7575 Args:
@@ -83,16 +83,17 @@ def __init__(self, zkquorum):
8383
8484 """
8585 self ._zkquorum = zkquorum
86+ self ._zkpath = zkpath
8687 super (MasterService , self ).__init__ (None , None )
8788
8889 def _rebuild_request (self ):
89- self ._host , self ._port = zookeeper .get_master (self ._zkquorum )
90+ self ._host , self ._port = zookeeper .get_master (self ._zkquorum , self . _zkpath )
9091 self ._request = request .Request (self ._host , self ._port , 'MasterService' )
9192
9293
9394class MetaService (Service ):
9495
95- def __init__ (self , zkquorum ):
96+ def __init__ (self , zkquorum , zkpath ):
9697 """Meta region service.
9798
9899 Args:
@@ -106,10 +107,11 @@ def __init__(self, zkquorum):
106107
107108 """
108109 self ._zkquorum = zkquorum
110+ self ._zkpath = zkpath
109111 super (MetaService , self ).__init__ (None , None )
110112
111113 def _rebuild_request (self ):
112- self ._host , self ._port = zookeeper .get_region (self ._zkquorum )
114+ self ._host , self ._port = zookeeper .get_region (self ._zkquorum , self . _zkpath )
113115 self ._request = request .Request (self ._host , self ._port , 'ClientService' )
114116
115117
0 commit comments