sentry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amis...@apache.org
Subject [sentry] branch master updated: SENTRY-2528: Format exception when fetching a full snapshot (Arjun Mishra reviewed by Kalyan Kumar Kalvagadda)
Date Tue, 09 Jul 2019 19:31:48 GMT
This is an automated email from the ASF dual-hosted git repository.

amishra pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sentry.git


The following commit(s) were added to refs/heads/master by this push:
     new 943b3e0  SENTRY-2528: Format exception when fetching a full snapshot (Arjun Mishra
reviewed by Kalyan Kumar Kalvagadda)
943b3e0 is described below

commit 943b3e00ba4771e4005bc7eb25014b8bc640f0c8
Author: amishra <amishra@cloudera.com>
AuthorDate: Tue Jul 9 14:31:22 2019 -0500

    SENTRY-2528: Format exception when fetching a full snapshot (Arjun Mishra reviewed by
Kalyan Kumar Kalvagadda)
---
 .../org/apache/sentry/service/thrift/FullUpdateInitializer.java     | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/service/thrift/FullUpdateInitializer.java
b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/service/thrift/FullUpdateInitializer.java
index d4bca42..668a4ca 100644
--- a/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/service/thrift/FullUpdateInitializer.java
+++ b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/service/thrift/FullUpdateInitializer.java
@@ -545,9 +545,9 @@ public final class FullUpdateInitializer implements AutoCloseable {
         long totalNumberOfDatabases = SentryMetrics.getInstance().databaseCount.getCount();
         long totalNumberOfTables = SentryMetrics.getInstance().tableCount.getCount();
         long totalNumberOfPartitions = SentryMetrics.getInstance().partitionCount.getCount();
-        long percentageDatabasesFetched = totalNumberOfDatabases > 0? totalNumberOfDatabasesFetched%totalNumberOfDatabases:0;
-        long percentageTablesFetched = totalNumberOfTables > 0? totalNumberOfTablesFetched%totalNumberOfTables:0;
-        long percentagePartitionsFetched = totalNumberOfPartitions > 0? totalNumberOfPartitionsFetched%totalNumberOfPartitions:0;
+        double percentageDatabasesFetched = totalNumberOfDatabases > 0? ((double)totalNumberOfDatabasesFetched/totalNumberOfDatabases)*100:0;
+        double percentageTablesFetched = totalNumberOfTables > 0? ((double)totalNumberOfTablesFetched/totalNumberOfTables)*100:0;
+        double percentagePartitionsFetched = totalNumberOfPartitions > 0? ((double)totalNumberOfPartitionsFetched/totalNumberOfPartitions)*100:0;
 
         String snapshotFetchStatusString = String.format("Fetching full hms snapshot: databases
fetched=%d (%.2f%%); "
             + "tables fetched=%d (%.2f%%); partitions fetched=%d (%.2f%%); total number of
databases=%d; "


Mime
View raw message