-
Notifications
You must be signed in to change notification settings - Fork 145
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-23180 hbck2 testing tool #47
Conversation
Refer to this link for build results (access rights to CI server needed): |
3f523e5
to
104e4d3
Compare
Refer to this link for build results (access rights to CI server needed): |
Refer to this link for build results (access rights to CI server needed): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some preliminary review comments.
|
||
# Replace the passed parameters in here [starting from --working-dir] with appropriate values | ||
./dev-support/testingtool/hbck2_test.sh --hbck2 "${SELF}/../../${hbase_hbck2_jar}" \ | ||
--single-process --working-dir /Users/sakthi/test/hbck2-testing-tool/output/hbck2 \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you change the directories here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure
} | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: extra lines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
private void deleteRegionFromMeta(String tname) throws IOException, InterruptedException { | ||
TableName tn = TableName.valueOf(tname); | ||
try (Connection connection = ConnectionFactory.createConnection(conf)) { | ||
Table MetaTable = connection.getTable(TableName.valueOf("hbase:meta")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: s/MetaTable/metaTable/
Thread.sleep(500); | ||
|
||
ris = MetaTableAccessor.getTableRegions(connection, tn); | ||
System.out.println(String.format("Current Regions of the table " + tn.getNameAsString() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might not need to use String.format in this case.
ris
is a List, do you want to print it out?
Thanks for your comments @petersomogyi . I have updated the PR. |
@saintstack , @busbey , @wchevreuil can I get any of your reviews as well here? |
@petersomogyi can I get your +1 here? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some minor cleanup requests on the handling of the hbck2 jar and a few nits that could go either way.
looking really close!
*/ | ||
package org.apache.hbase; | ||
|
||
import static java.lang.System.exit; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: we only use this once, just call System.exit there.
tool.deleteRegionFromMeta(tableName); | ||
} | ||
else { | ||
System.out.println("ERROR: Unknown option passed."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: System.err
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Took care of these as well.
} | ||
|
||
private static void printUsageAndExit() { | ||
System.out.println("hbckActions <options>"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: System.err
echo "ERROR: Instead of finding 1000 rows, we found ${assign_rowcount}." | ||
exit 2 | ||
else | ||
echo "SUCCESS: deleteRegionInMeta succedeed" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: "SUCCESS: deleteRegionInMeta recovery process succeeded"
3b1ab3a
to
2c039af
Compare
Thanks for your reviews @busbey . I have addressed them and updated the pr. |
This adds a new tool that spins up a hbase on hadoop minicluster and mimicks actions of hbck2 to verify it's functionalities
2c039af
to
95633e6
Compare
How does the PR look now, @busbey ? |
Looks great! Thanks for getting this done. |
Thanks for your reviews, Peter & Sean. Let me get this in. |
This adds a new tool that spins up a hbase on hadoop minicluster and
mimicks actions of hbck2 to verify it's functionalities