Skip to content

Commit 50f513d

Browse files
wangyumGitHub Enterprise
authored andcommitted
[CARMEL-7402] [CARMEL-6525] Support tag different drivers in the queue (apache#141)
1 parent 1228f6d commit 50f513d

File tree

1 file changed

+6
-2
lines changed
  • sql/hive-thriftserver/src/main/java/org/apache/hive/service/server

1 file changed

+6
-2
lines changed

sql/hive-thriftserver/src/main/java/org/apache/hive/service/server/HiveServer2.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,13 @@ private void addServerInstanceToZooKeeper(HiveConf hiveConf) throws Exception {
203203
ZOOKEEPER_PATH_SEPARATOR + queue + ZOOKEEPER_PATH_SEPARATOR + ephemeralPath;
204204
LOG.info("Add server instance to zookeeper on {}", zkPath);
205205
try {
206+
String data = "{\"tag\":[]}";
207+
String queueTag = hiveConf.get("spark.yarn.queue.tag", "");
208+
if (StringUtils.isNotBlank(queueTag)) {
209+
data = "{\"tag\":[\"" + queueTag + "\"]}"; // schedule
210+
}
206211
znode = new PersistentEphemeralNode(zooKeeperClient,
207-
PersistentEphemeralNode.Mode.EPHEMERAL, zkPath,
208-
ephemeralPath.getBytes(StandardCharsets.UTF_8));
212+
PersistentEphemeralNode.Mode.EPHEMERAL, zkPath, data.getBytes(StandardCharsets.UTF_8));
209213
znode.start();
210214
// We'll wait for 120s for node creation
211215
long znodeCreationTimeout = 120;

0 commit comments

Comments
 (0)