saihemanth-cloudera commented on code in PR #5851:
URL: https://github.com/apache/hive/pull/5851#discussion_r2612493617


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java:
##########
@@ -2961,25 +3134,36 @@ protected List<Void> getSqlResult(GetHelper<List<Void>> 
ctx) throws MetaExceptio
       }
       @Override
       protected List<Void> getJdoResult(GetHelper<List<Void>> ctx) throws 
MetaException {
-        dropPartitionsViaJdo(catName, dbName, tblName, partNames);
+        dropPartitionsViaJdo(catName, dbName, tblName, partNames, new 
StringBuffer());
         return Collections.emptyList();
       }
     }.run(false);
   }
 
   private void dropPartitionsViaJdo(String catName, String dbName, String 
tblName,
-      List<String> partNames) throws MetaException {
+      List<String> partNames, StringBuffer message) throws MetaException {
     boolean success = false;
 
     if (partNames.isEmpty()) {
       return;
     }
     openTransaction();
-
+    
+    int batch = batchSize == NO_BATCHING ? 1 : (partNames.size() + batchSize) 
/ batchSize;
+    AtomicLong batchIdx = new AtomicLong(1);
+    AtomicLong timeSpent = new AtomicLong(0);
+    String prefix = "Dropping partitions, batch: ";
     try {
       Batchable.runBatched(batchSize, partNames, new Batchable<String, Void>() 
{
         @Override
         public List<Void> run(List<String> input) throws MetaException {
+          long start = System.currentTimeMillis();
+          message.setLength(0);
+          
message.append(prefix).append(batchIdx.get()).append("/").append(batch);
+          if (batchIdx.get() > 1) {
+            long leftTime = (batch - batchIdx.get()) * timeSpent.get() / 
batchIdx.get();
+            message.append(", time left: ").append(leftTime).append("ms");

Review Comment:
   nit: log message?



-- 
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]

Reply via email to