Skip to content

Commit

Permalink
_close_old_regions now deletes regions not clients
Browse files Browse the repository at this point in the history
For issue #6. I added logic to the client's _close_old_regions to close
region objects instead of region servers. Also will close region servers
that have no regions
  • Loading branch information
abrandemuehl committed Sep 26, 2015
1 parent a1758d6 commit e533fc5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.pyc
*.sw*
9 changes: 7 additions & 2 deletions client.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,9 +405,14 @@ def _close_old_regions(self, overlapping_region_intervals):
# Loop over the regions to close and close whoever their
# attached client is.
#
# TODO: ...should we really be killing a client unneccessarily?
# TODO: Test this code
for reg in overlapping_region_intervals:
reg.data.region_client.close()
# Remove the invalid region
region_client = reg.data.region_client
region_client.regions.remove(reg)
# If the region_client is empty, destroy it
if len(region_client.regions) == 0:
region_client.close()

def _purge_client(self, region_client):
# Given a client to close, purge all of it's known hosted regions from
Expand Down

0 comments on commit e533fc5

Please sign in to comment.