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-23180 hbck2 testing tool #47

Merged
merged 5 commits into from
Jan 28, 2020
Merged

Conversation

jatsakthi
Copy link
Member

This adds a new tool that spins up a hbase on hadoop minicluster and
mimicks actions of hbck2 to verify it's functionalities

@asf-ci
Copy link

asf-ci commented Dec 13, 2019

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/PreCommit-HBASE-OPERATOR-TOOLS-Build/125/

@asf-ci
Copy link

asf-ci commented Dec 17, 2019

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/PreCommit-HBASE-OPERATOR-TOOLS-Build/128/

@asf-ci
Copy link

asf-ci commented Dec 17, 2019

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/PreCommit-HBASE-OPERATOR-TOOLS-Build/129/

Copy link
Contributor

@petersomogyi petersomogyi left a 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.

dev-support/testingtool/hbck2_test.sh Show resolved Hide resolved

# 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 \
Copy link
Contributor

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?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure

}
}


Copy link
Contributor

Choose a reason for hiding this comment

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

nit: extra lines

Copy link
Member Author

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"));
Copy link
Contributor

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()
Copy link
Contributor

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?

@jatsakthi
Copy link
Member Author

Thanks for your comments @petersomogyi . I have updated the PR.

@jatsakthi
Copy link
Member Author

@saintstack , @busbey , @wchevreuil can I get any of your reviews as well here?

@jatsakthi
Copy link
Member Author

@petersomogyi can I get your +1 here?

Copy link
Contributor

@busbey busbey left a 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!

dev-support/testingtool/hbck2_test.sh Outdated Show resolved Hide resolved
dev-support/testingtool/hbck2_test.sh Show resolved Hide resolved
dev-support/testingtool/run_hbck2_test.sh Show resolved Hide resolved
*/
package org.apache.hbase;

import static java.lang.System.exit;
Copy link
Contributor

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.");
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: System.err

Copy link
Member Author

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>");
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: System.err

dev-support/testingtool/scripts/deleteRegionInMeta.sh Outdated Show resolved Hide resolved
echo "ERROR: Instead of finding 1000 rows, we found ${assign_rowcount}."
exit 2
else
echo "SUCCESS: deleteRegionInMeta succedeed"
Copy link
Contributor

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"

@jatsakthi
Copy link
Member Author

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
@jatsakthi
Copy link
Member Author

How does the PR look now, @busbey ?

@busbey
Copy link
Contributor

busbey commented Jan 28, 2020

Looks great! Thanks for getting this done.

@jatsakthi
Copy link
Member Author

Thanks for your reviews, Peter & Sean. Let me get this in.

@jatsakthi jatsakthi merged commit 5b26f20 into apache:master Jan 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants