Skip to content

Commit 399d0ff

Browse files
author
Venu Reddy
committed
Rework of comments
1 parent c64d0b7 commit 399d0ff

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/handler/CompactionCleaner.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ private void clean(CompactionInfo ci, long minOpenTxn, boolean metricsEnabled) t
158158
cleanUsingAcidDir(ci, t, path, cleanerWaterMark);
159159
}
160160
} else {
161-
ci.setSoftDelete(true);
162161
cleanUsingLocation(ci, location, false);
163162
}
164163
} catch (Exception e) {
@@ -177,6 +176,7 @@ private void clean(CompactionInfo ci, long minOpenTxn, boolean metricsEnabled) t
177176

178177
private void cleanUsingLocation(CompactionInfo ci, String path, boolean requiresLock) throws MetaException {
179178
List<Path> deleted;
179+
ci.setSoftDelete(true);
180180
if (requiresLock) {
181181
LockRequest lockRequest = createLockRequest(ci);
182182
LockResponse res = null;

standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/jdbc/functions/MarkCleanedFunction.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,12 @@ public MarkCleanedFunction(CompactionInfo info) {
5050
public Void execute(MultiDataSourceJdbcResource jdbcResource) throws MetaException {
5151
NamedParameterJdbcTemplate jdbcTemplate = jdbcResource.getJdbcTemplate();
5252
MapSqlParameterSource param;
53-
if (!info.isAbortedTxnCleanup() && !info.isSoftDelete()) {
53+
if (info.isSoftDelete()) {
54+
// Remove compaction queue record and return
55+
removeCompactionAndAbortRetryEntries(info, jdbcTemplate);
56+
return null;
57+
}
58+
if (!info.isAbortedTxnCleanup()) {
5459
param = new MapSqlParameterSource()
5560
.addValue("id", info.id)
5661
.addValue("succeeded", Character.toString(SUCCEEDED_STATE), Types.CHAR);
@@ -85,10 +90,6 @@ public Void execute(MultiDataSourceJdbcResource jdbcResource) throws MetaExcepti
8590
*/
8691
removeCompactionAndAbortRetryEntries(info, jdbcTemplate);
8792

88-
if (info.isSoftDelete()) {
89-
return null;
90-
}
91-
9293
if (!info.isAbortedTxnCleanup()) {
9394
// Remove entries from completed_txn_components as well, so we don't start looking there
9495
// again but only up to the highest write ID include in this compaction job.

0 commit comments

Comments
 (0)