deniskuzZ commented on a change in pull request #2702:
URL: https://github.com/apache/hive/pull/2702#discussion_r723961927
##########
File path:
ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/CompactorUtil.java
##########
@@ -18,14 +18,19 @@
package org.apache.hadoop.hive.ql.txn.compactor;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
+import org.apache.hadoop.hive.common.StringableMap;
import org.apache.hadoop.hive.conf.HiveConf;
+import org.apache.hadoop.hive.metastore.api.Table;
+import org.apache.hadoop.hive.metastore.txn.CompactionInfo;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;
public class CompactorUtil {
public static final String COMPACTOR = "compactor";
+ static final String COMPACTOR_PREFIX = "compactor.";
+ static final String MAPRED_QUEUE_NAME = "mapred.job.queue.name";
Review comment:
should it be MR specific or we can change to some generic name to be
reused for query-based compaction?
##########
File path: ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/Worker.java
##########
@@ -215,29 +216,11 @@ void gatherStats() {
sb.setLength(sb.length() - 1); //remove trailing ,
LOG.info(ci + ": running '" + sb.toString() + "'");
conf.setVar(HiveConf.ConfVars.METASTOREURIS,"");
-
- //todo: use DriverUtils.runOnDriver() here
- QueryState queryState = new
QueryState.Builder().withGenerateNewQueryId(true).withHiveConf(conf).build();
- SessionState localSession = null;
- try (Driver d = new Driver(queryState)) {
- if (SessionState.get() == null) {
- localSession = new SessionState(conf);
- SessionState.start(localSession);
- }
- try {
- d.run(sb.toString());
- } catch (CommandProcessorException e) {
- LOG.warn(ci + ": " + sb.toString() + " failed due to: " + e);
- }
- } finally {
- if (localSession != null) {
- try {
- localSession.close();
- } catch (IOException ex) {
- LOG.warn(ci + ": localSession.close() failed due to: " +
ex.getMessage(), ex);
- }
- }
+ if (compactionQueueName != null && compactionQueueName.length() > 0) {
+ conf.set(TezConfiguration.TEZ_QUEUE_NAME, compactionQueueName);
}
+ SessionState sessionState = DriverUtils.setUpSessionState(conf,
userName, true);
Review comment:
shouldn't we close the session at the end?
##########
File path: ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/Worker.java
##########
@@ -215,29 +216,11 @@ void gatherStats() {
sb.setLength(sb.length() - 1); //remove trailing ,
LOG.info(ci + ": running '" + sb.toString() + "'");
conf.setVar(HiveConf.ConfVars.METASTOREURIS,"");
-
- //todo: use DriverUtils.runOnDriver() here
- QueryState queryState = new
QueryState.Builder().withGenerateNewQueryId(true).withHiveConf(conf).build();
- SessionState localSession = null;
- try (Driver d = new Driver(queryState)) {
- if (SessionState.get() == null) {
- localSession = new SessionState(conf);
- SessionState.start(localSession);
- }
- try {
- d.run(sb.toString());
- } catch (CommandProcessorException e) {
- LOG.warn(ci + ": " + sb.toString() + " failed due to: " + e);
- }
- } finally {
- if (localSession != null) {
- try {
- localSession.close();
- } catch (IOException ex) {
- LOG.warn(ci + ": localSession.close() failed due to: " +
ex.getMessage(), ex);
- }
- }
+ if (compactionQueueName != null && compactionQueueName.length() > 0) {
+ conf.set(TezConfiguration.TEZ_QUEUE_NAME, compactionQueueName);
}
+ SessionState sessionState = DriverUtils.setUpSessionState(conf,
userName, true);
Review comment:
oh, I can see it's closed inside of runOnDriver
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]