marton-bod commented on a change in pull request #2817:
URL: https://github.com/apache/hive/pull/2817#discussion_r760953400
##########
File path: ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/Worker.java
##########
@@ -233,39 +234,36 @@ void gatherStats() {
private final CompactionTxn compactionTxn;
private final String tableName;
private final HiveConf conf;
- private final long txnTimeout;
+ private final AtomicBoolean shouldLogError;
public CompactionHeartbeater(CompactionTxn compactionTxn, String
tableName, HiveConf conf) {
this.tableName = Objects.requireNonNull(tableName);
this.compactionTxn = Objects.requireNonNull(compactionTxn);
this.conf = Objects.requireNonNull(conf);
-
- this.txnTimeout = MetastoreConf.getTimeVar(conf,
MetastoreConf.ConfVars.TXN_TIMEOUT, TimeUnit.MILLISECONDS);
+ this.shouldLogError = new AtomicBoolean(true);
setDaemon(true);
setPriority(MIN_PRIORITY);
setName("CompactionHeartbeater-" + compactionTxn.getTxnId());
}
+ public void shouldLogError(boolean shouldLogError) {
+ this.shouldLogError.set(shouldLogError);
+ }
+
@Override
public void run() {
LOG.debug("Heartbeating compaction transaction id {} for table: {}",
compactionTxn, tableName);
-
IMetaStoreClient msc = null;
try {
// Create a metastore client for each thread since it is not thread
safe
msc = HiveMetaStoreUtils.getHiveMetastoreClient(conf);
Review comment:
it wouldn't be closed in the finally block if it's cached as an object
field. In that case, we'd need the `CompactionHeartbeater` to have a close()
method, and invoke it somewhere, for it to close its cached client.
Or did you mean some other way of reusing the client instance?
--
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]