Skip to content

Fix protobuf unkown protocol. #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions hbase/client/region.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,15 +245,16 @@ def _remove_from_cache(self, region_or_meta_key):
pass

def _region_lookup(self, meta_key):
#Fix from https://github.com/3601314/hbase-python/issues/3
column = protobuf.Column()
column.family = b'info'
req = protobuf.GetRequest()
req.get.row = meta_key.encode()
req.get.column.extend([column])
req.get.closest_row_before = True
req = protobuf.ScanRequest()
req.scan.column.extend([column])
req.scan.start_row = meta_key.encode()
req.scan.reversed = True
req.region.type = 1
req.region.value = b'hbase:meta,,1'

req.number_of_rows = 1
try:
resp = self._meta_service.request(req)
except exceptions.RegionError:
Expand All @@ -264,7 +265,10 @@ def _region_lookup(self, meta_key):
break
except exceptions.RegionError:
continue
cells = resp.result.cell
cells = []
for result in resp.results:
cells = result.cell
break
if len(cells) == 0:
return None

Expand Down