This is an automated email from the ASF dual-hosted git repository.

ctubbsii pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/main by this push:
     new bbc18e3  Fix External Compaction status percentage in logs (#2310)
bbc18e3 is described below

commit bbc18e37c58f3b24cea6e7a6f3913d501b364b6b
Author: Mark Owens <jmar...@apache.org>
AuthorDate: Mon Oct 11 11:47:12 2021 -0400

    Fix External Compaction status percentage in logs (#2310)
    
    Cast one of the percentComplete variables to float to prevent result
    always being 0.0.
    
    This fixes #2308
---
 .../src/main/java/org/apache/accumulo/compactor/Compactor.java        | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/server/compactor/src/main/java/org/apache/accumulo/compactor/Compactor.java 
b/server/compactor/src/main/java/org/apache/accumulo/compactor/Compactor.java
index 305de7f..633e109 100644
--- 
a/server/compactor/src/main/java/org/apache/accumulo/compactor/Compactor.java
+++ 
b/server/compactor/src/main/java/org/apache/accumulo/compactor/Compactor.java
@@ -235,7 +235,6 @@ public class Compactor extends AbstractServer implements 
CompactorService.Iface
    *
    * @param clientAddress
    *          address of this Compactor
-   *
    * @throws KeeperException
    *           zookeeper error
    * @throws InterruptedException
@@ -679,7 +678,8 @@ public class Compactor extends AbstractServer implements 
CompactorService.Iface
               CompactionInfo info = running.get(0);
               if (info != null) {
                 if (inputEntries > 0) {
-                  percentComplete = Float.toString((info.getEntriesRead() / 
inputEntries) * 100);
+                  percentComplete =
+                      Float.toString((info.getEntriesRead() / (float) 
inputEntries) * 100);
                 }
                 String message = String.format(
                     "Compaction in progress, read %d of %d input entries ( %s 
%s ), written %d entries",

Reply via email to