Skip to content
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

HBASE-22774 [WAL] RegionGroupingStrategy loses its function after split #460

Merged
merged 2 commits into from
Aug 14, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -7177,8 +7177,9 @@ HRegion createDaughterRegionFromSplits(final HRegionInfo hri) throws IOException
fs.commitDaughterRegion(hri);

// Create the daughter HRegion instance
HRegion r = HRegion.newHRegion(this.fs.getTableDir(), this.getWAL(), fs.getFileSystem(),
this.getBaseConf(), hri, this.getTableDesc(), rsServices);
HRegion r = HRegion.newHRegion(this.fs.getTableDir(),
rsServices == null ? getWAL() :rsServices.getWAL(hri), // rsServices can be null in UT
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please extract this expression to a variable.

fs.getFileSystem(), this.getBaseConf(), hri, this.getTableDesc(), rsServices);
r.readRequestsCount.set(this.getReadRequestsCount() / 2);
r.writeRequestsCount.set(this.getWriteRequestsCount() / 2);
return r;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public void init(Configuration config, String providerId) {
int regionGroupNumber = config.getInt(NUM_REGION_GROUPS, DEFAULT_NUM_REGION_GROUPS);
groupNames = new String[regionGroupNumber];
for (int i = 0; i < regionGroupNumber; i++) {
groupNames[i] = providerId + GROUP_NAME_DELIMITER + "regiongroup-" + i;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GROUP_NAME_DELIMITER is unused from now on. Can it be removed? It is in IA.Private class.

groupNames[i] = "regiongroup-" + i;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
*/
@InterfaceAudience.Private
public class NamespaceGroupingStrategy implements RegionGroupingStrategy {
private String providerId;

@Override
public String group(byte[] identifier, byte[] namespace) {
Expand All @@ -41,12 +40,10 @@ public String group(byte[] identifier, byte[] namespace) {
} else {
namespaceString = Bytes.toString(namespace);
}
return providerId + GROUP_NAME_DELIMITER + namespaceString;
return namespaceString;
}

@Override
public void init(Configuration config, String providerId) {
this.providerId = providerId;
}
public void init(Configuration config, String providerId) {}

}
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ static class IdentityGroupingStrategy implements RegionGroupingStrategy {
public void init(Configuration config, String providerId) {}
@Override
public String group(final byte[] identifier, final byte[] namespace) {
return Bytes.toString(identifier);
return "identity-" + Bytes.toString(identifier);
}
}

Expand Down
Loading