-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-24648 Remove the legacy 'forceSplit' related code at region ser… #1990
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1837,35 +1837,30 @@ public GetOnlineRegionResponse getOnlineRegion(final RpcController controller, | |
@Override | ||
@QosPriority(priority=HConstants.ADMIN_QOS) | ||
public GetRegionInfoResponse getRegionInfo(final RpcController controller, | ||
final GetRegionInfoRequest request) throws ServiceException { | ||
final GetRegionInfoRequest request) throws ServiceException { | ||
try { | ||
checkOpen(); | ||
requestCount.increment(); | ||
HRegion region = getRegion(request.getRegion()); | ||
RegionInfo info = region.getRegionInfo(); | ||
byte[] bestSplitRow = null; | ||
boolean shouldSplit = true; | ||
byte[] bestSplitRow; | ||
if (request.hasBestSplitRow() && request.getBestSplitRow()) { | ||
HRegion r = region; | ||
region.startRegionOperation(Operation.SPLIT_REGION); | ||
r.forceSplit(null); | ||
// Even after setting force split if split policy says no to split then we should not split. | ||
shouldSplit = region.getSplitPolicy().shouldSplit() && !info.isMetaRegion(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After this change, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changed getSplitPolicy to package private and added a VisibleForTesting annotation. |
||
bestSplitRow = r.checkSplit(); | ||
bestSplitRow = region.checkSplit(true).orElse(null); | ||
// when all table data are in memstore, bestSplitRow = null | ||
// try to flush region first | ||
if(bestSplitRow == null) { | ||
r.flush(true); | ||
bestSplitRow = r.checkSplit(); | ||
if (bestSplitRow == null) { | ||
region.flush(true); | ||
bestSplitRow = region.checkSplit(true).orElse(null); | ||
} | ||
r.clearSplit(); | ||
} else { | ||
bestSplitRow = null; | ||
} | ||
GetRegionInfoResponse.Builder builder = GetRegionInfoResponse.newBuilder(); | ||
builder.setRegionInfo(ProtobufUtil.toRegionInfo(info)); | ||
if (request.hasCompactionState() && request.getCompactionState()) { | ||
builder.setCompactionState(ProtobufUtil.createCompactionState(region.getCompactionState())); | ||
} | ||
builder.setSplittable(region.isSplittable() && shouldSplit); | ||
builder.setSplittable(region.isSplittable()); | ||
builder.setMergeable(region.isMergeable()); | ||
if (request.hasBestSplitRow() && request.getBestSplitRow() && bestSplitRow != null) { | ||
builder.setBestSplitRow(UnsafeByteOperations.unsafeWrap(bestSplitRow)); | ||
|
Uh oh!
There was an error while loading. Please reload this page.