-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Conversation
f16bc8c
to
84b3732
Compare
ping~ @jackxu2011 @jacktao007 |
String clusterConnUniqueKey = generateUniqueConnectionKey(configuration); | ||
LOG.info("Start to get connection for cluster {}.", clusterConnUniqueKey); | ||
try { | ||
lock.lock(); |
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.
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); |
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.
Need to adapt Linkis's existing kerberos tools?
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.
I feel it is necessary to optimize it later.
public class HBaseEngineConnConstant { | ||
private HBaseEngineConnConstant() {} | ||
|
||
public static final String LINKIS_PREFIX = "wds.linkis."; |
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.
need to remove wds prefix
String sessionId = HBaseConnectionManager.getInstance().generateUniqueConnectionKey(prop); | ||
LOG.info("Start to create session {} for cluster.", sessionId); | ||
try { | ||
lock.lock(); |
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.
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"); |
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.
leojie should rename to hadoop
84b3732
to
7e0c253
Compare
19895af
to
8ea54a4
Compare
8ea54a4
to
bb4672e
Compare
|
||
while (times < KERBEROS_RE_LOGIN_MAX_RETRY) { | ||
if (runKerberosLogin()) { | ||
LOG.info("Ran kerberos re login command successfully."); |
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.
Ran ?
@@ -0,0 +1,759 @@ | |||
COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.1 |
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.
Is there a GPL LICENSE for this?
@@ -0,0 +1,759 @@ | |||
COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.1 | |||
|
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.
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) |
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.
remove wds prefix
if (!result.isSuccess) { | ||
return ErrorExecuteResponse(result.getResult, result.getThrowable) | ||
} | ||
engineExecutorContext.appendStdout(result.getResult) |
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.
Is it necessary to add a result set?
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.
The execution result of HBase Shell is a bunch of strings. Does it need to be packaged into a result set?
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.
If not table we need to write text result set
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.
|
||
override def killTask(taskId: String): Unit = { | ||
logger.info(s"Killing hbase query task $taskId") | ||
super.killTask(taskId) |
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.
need to support kill task
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.
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.
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.
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.
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.
Okay, I'll add this function.
751ef51
to
745699c
Compare
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.
LGTM.
Co-authored-by: Longping Jie <[email protected]>
Co-authored-by: Longping Jie <[email protected]>
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
Checklist