deniskuzZ commented on code in PR #3513:
URL: https://github.com/apache/hive/pull/3513#discussion_r950294331
##########
ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java:
##########
@@ -5822,25 +5824,43 @@ public void compact(String dbname, String tableName,
String partName, String com
* @param tblproperties the list of tblproperties to overwrite for this
compaction
* @return id of new request or id already existing request for specified
resource
* @throws HiveException
+ * @deprecated use {@link #compact3(CompactionRequest)}
*/
+ @Deprecated
public CompactionResponse compact2(String dbname, String tableName, String
partName, String compactType,
Map<String, String> tblproperties)
throws HiveException {
- try {
- CompactionType cr = null;
+ CompactionType cr;
if ("major".equalsIgnoreCase(compactType)) {
cr = CompactionType.MAJOR;
} else if ("minor".equalsIgnoreCase(compactType)) {
cr = CompactionType.MINOR;
} else {
throw new RuntimeException("Unknown compaction type " + compactType);
}
- return getMSC().compact2(dbname, tableName, partName, cr, tblproperties);
+ CompactionRequest request = new CompactionRequest(dbname, tableName, cr);
+ request.setPartitionname(partName);
+ request.setProperties(tblproperties);
+ return compact3(request);
+ }
+
+ /**
+ * Enqueue a compaction request. Only 1 compaction for a given resource
(db/table/partSpec) can
+ * be scheduled/running at any given time.
+ * @param request The {@link CompactionRequest} object containing the
details required to enqueue
+ * a compaction request.
+ * @throws HiveException
+ */
+ public CompactionResponse compact3(CompactionRequest request)
Review Comment:
rename to simply `compact`
--
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]