hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sean Busbey (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-15737) Remove use of Guava Stopwatch
Date Mon, 02 May 2016 17:34:12 GMT

    [ https://issues.apache.org/jira/browse/HBASE-15737?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15267041#comment-15267041

Sean Busbey commented on HBASE-15737:

Please follow the contributor guide when creating follow on patches (i.e. use {{format-patch}})

bq. Is the issue that it's annotated Beta?
See the comment above. Guava doesn't provide good backward compatibility.

In fairness to the Guava project, they provide fine backwards compatibility for classes that
aren't labeled Beta. This is more on us than it is on them. (ref [their big list of warnings
for downstream users|https://github.com/google/guava#important-warnings])

Replacing Guava Stopwatch with hadoop common's StopWatch would reduce the chance of incompatibilities
in case newer version of Guava is involved.

Unless I'm mistaken, we're switching to Apache Commons Lang and not Hadoop Common. I am much
more comfortable with increasing our reliance on Commons Lang than I am with Hadoop Common,
so please correct me if I'm wrong.

-    double throughput = (double)totalBytes / scanTimer.elapsedTime(TimeUnit.SECONDS);
-    double throughputRows = (double)numRows / scanTimer.elapsedTime(TimeUnit.SECONDS);
-    double throughputCells = (double)numCells / scanTimer.elapsedTime(TimeUnit.SECONDS);
+    double throughput = (double)totalBytes / scanTimer.getTime() * 1000;
+    double throughputRows = (double)numRows / scanTimer.getTime() * 1000;
+    double throughputCells = (double)numCells / scanTimer.getTime() * 1000;

In places where you need to convert time units, please either use TimeUnit or include a comment
explaining what is happening (e.g. "getTime returns millis and we need to provide seconds")
so that we have an easier time maintaining in the future.

> Remove use of Guava Stopwatch
> -----------------------------
>                 Key: HBASE-15737
>                 URL: https://issues.apache.org/jira/browse/HBASE-15737
>             Project: HBase
>          Issue Type: Improvement
>            Reporter: Ted Yu
>            Assignee: Ted Yu
>            Priority: Minor
>         Attachments: 15737.v1.txt
> HBASE-14963 removed reference to Guava Stopwatch from hbase-client module.
> However, there're still 3 classes referring to Guava Stopwatch :
> hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestClientNoCluster.java:import
> hbase-server/src/main/java/org/apache/hadoop/hbase/util/JvmPauseMonitor.java:import com.google.common.base.Stopwatch;
> hbase-server/src/test/java/org/apache/hadoop/hbase/ScanPerformanceEvaluation.java:import
> We should remove reference to Guava Stopwatch.
> hadoop is no longer referencing Guava Stopwatch.

This message was sent by Atlassian JIRA

View raw message