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

[Feature] Add hbase engine to linkis #4891

Merged
merged 3 commits into from
Sep 26, 2023
Merged

Conversation

CCweixiao
Copy link
Contributor

What is the purpose of the change

Add hbase engine to linkis, The ruby command of hbase-shell can be executed through linkis.

Related issues

Related issues: #2533

Brief change log

  • Add hbase engine to linkis

Checklist

  • I have read the Contributing Guidelines on pull requests.
  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the Linkis mailing list first)
  • If this is a code change: I have written unit tests to fully verify the new behavior.

@CCweixiao CCweixiao force-pushed the dev-hbase branch 4 times, most recently from f16bc8c to 84b3732 Compare September 5, 2023 15:15
@peacewong
Copy link
Contributor

ping~ @jackxu2011 @jacktao007

String clusterConnUniqueKey = generateUniqueConnectionKey(configuration);
LOG.info("Start to get connection for cluster {}.", clusterConnUniqueKey);
try {
lock.lock();
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it better to first determine whether it contains the corresponding key and then lock it?


private void doKerberosLogin(Configuration configuration) {
String principal = configuration.get(KERBEROS_PRINCIPAL);
String keytab = configuration.get(KERBEROS_KEYTAB_FILE);
Copy link
Contributor

Choose a reason for hiding this comment

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

Need to adapt Linkis's existing kerberos tools?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I feel it is necessary to optimize it later.

public class HBaseEngineConnConstant {
private HBaseEngineConnConstant() {}

public static final String LINKIS_PREFIX = "wds.linkis.";
Copy link
Contributor

Choose a reason for hiding this comment

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

need to remove wds prefix

String sessionId = HBaseConnectionManager.getInstance().generateUniqueConnectionKey(prop);
LOG.info("Start to create session {} for cluster.", sessionId);
try {
lock.lock();
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as connection and can be optimized

properties.put(HBaseEngineConnConstant.KERBEROS_PRINCIPAL, "[email protected]");
properties.put(HBaseEngineConnConstant.KERBEROS_KEYTAB_FILE, "/etc/hbase/conf/hdfs.keytab");
// 设置kerberos代理用户
properties.put(HBaseEngineConnConstant.KERBEROS_PROXY_USER, "leojie");
Copy link
Contributor

Choose a reason for hiding this comment

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

leojie should rename to hadoop


while (times < KERBEROS_RE_LOGIN_MAX_RETRY) {
if (runKerberosLogin()) {
LOG.info("Ran kerberos re login command successfully.");
Copy link
Contributor

Choose a reason for hiding this comment

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

Ran ?

@@ -0,0 +1,759 @@
COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.1
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a GPL LICENSE for this?

@@ -0,0 +1,759 @@
COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.1

Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a GPL LICENSE for this?

import org.apache.linkis.common.conf.CommonVars

object HBaseConfiguration {
val HBASE_CONCURRENT_LIMIT = CommonVars[Int]("wds.linkis.engineconn.hbase.concurrent.limit", 100)
Copy link
Contributor

Choose a reason for hiding this comment

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

remove wds prefix

if (!result.isSuccess) {
return ErrorExecuteResponse(result.getResult, result.getThrowable)
}
engineExecutorContext.appendStdout(result.getResult)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it necessary to add a result set?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The execution result of HBase Shell is a bunch of strings. Does it need to be packaged into a result set?

Copy link
Contributor

Choose a reason for hiding this comment

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

If not table we need to write text result set

Copy link
Contributor Author

Choose a reason for hiding this comment

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

image ResultSetFactory.TEXT_TYPE?


override def killTask(taskId: String): Unit = {
logger.info(s"Killing hbase query task $taskId")
super.killTask(taskId)
Copy link
Contributor

Choose a reason for hiding this comment

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

need to support kill task

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Supports kill task, which will destroy the hbase-shell session. Every time you kill the task and rerun the task, the session will be restarted.

Copy link
Contributor

Choose a reason for hiding this comment

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

Supports kill task, which will destroy the hbase-shell session. Every time you kill the task and rerun the task, the session will be restarted.

If the task can only be killed by ending the session, I think it is also necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, I'll add this function.

Copy link
Contributor

@peacewong peacewong left a comment

Choose a reason for hiding this comment

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

LGTM.

@peacewong peacewong changed the title [WIP][Feature] Add hbase engine to linkis [Feature] Add hbase engine to linkis Sep 26, 2023
@peacewong peacewong merged commit 2efef01 into apache:master Sep 26, 2023
12 checks passed
CCweixiao pushed a commit to CCweixiao/linkis-website that referenced this pull request Oct 10, 2023
peacewong pushed a commit to apache/linkis-website that referenced this pull request Oct 27, 2023
CCweixiao pushed a commit to CCweixiao/linkis-website that referenced this pull request Nov 28, 2023
CCweixiao pushed a commit to CCweixiao/linkis-website that referenced this pull request Dec 1, 2023
CCweixiao added a commit to apache/linkis-website that referenced this pull request Dec 1, 2023
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.

3 participants