kgeisz commented on code in PR #7149:
URL: https://github.com/apache/hbase/pull/7149#discussion_r2243999422
##########
hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java:
##########
@@ -4543,4 +4544,61 @@ protected String getDescription() {
}
});
}
+
+ public Long refreshHfiles(final TableName tableName, final long nonceGroup,
final long nonce)
+ throws IOException {
+ // TODO Check if table exists otherwise send exception.
+ // return 121L;
+ return MasterProcedureUtil
+ .submitProcedure(new MasterProcedureUtil.NonceProcedureRunnable(this,
nonceGroup, nonce) {
+ @Override
+ protected void run() throws IOException {
+ LOG.info("Submitting RefreshHfilesTableProcedure for a table");
+ submitProcedure(
+ new
RefreshHFilesTableProcedure(procedureExecutor.getEnvironment(), tableName));
+ }
+
+ @Override
+ protected String getDescription() {
+ return "RefreshHfilesProcedure for a table";
+ }
+ });
+ }
+
+ public Long refreshHfiles(final String namespace, final long nonceGroup,
final long nonce)
+ throws IOException {
+ // TODO Check if namespace exists otherwise send exception.
+ // return 122L;
+ return MasterProcedureUtil
+ .submitProcedure(new MasterProcedureUtil.NonceProcedureRunnable(this,
nonceGroup, nonce) {
+ @Override
+ protected void run() throws IOException {
+ LOG.info("Submitting RefreshHfilesProcedure for namespace");
+ submitProcedure(
+ new
RefreshHFilesTableProcedure(procedureExecutor.getEnvironment(), namespace));
+ }
+
+ @Override
+ protected String getDescription() {
+ return "RefreshHfilesProcedure for namespace";
+ }
+ });
+ }
+
+ public Long refreshHfiles(final long nonceGroup, final long nonce) throws
IOException {
+ // return 123L;
+ return MasterProcedureUtil
+ .submitProcedure(new MasterProcedureUtil.NonceProcedureRunnable(this,
nonceGroup, nonce) {
+ @Override
+ protected void run() throws IOException {
+ LOG.info("Submitting RefreshHfilesProcedure for all tables");
+ submitProcedure(new
RefreshHFilesTableProcedure(procedureExecutor.getEnvironment()));
+ }
+
+ @Override
+ protected String getDescription() {
+ return "RefreshHfilesProcedure for all tables";
+ }
+ });
Review Comment:
Do you think it would be worth building this in it's own function? That may
help prevent some building this in three separate places. Something like:
`public long submitRefreshHfilesProcedure(final TableName tableName, final
String namespace, final long nonceGroup, final long nonce)`
Then you can build the log message and `RefreshHFilesTableProcedure` object
differently based on if `tableName`, `namespace`, or both are null.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]