[ 
https://issues.apache.org/jira/browse/ACCUMULO-3840?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14556521#comment-14556521
 ] 

Josh Elser commented on ACCUMULO-3840:
--------------------------------------

Thanks for putting up a patch, Ed.

{code}
private static enum Timers {
  ELAPSED
}
{code}

This ends up duplicated all over the place. The only place I see the enum being 
used well is in BulkImporter, where it actually does result in a nice 
simplification. Maybe it would make sense to consolidate the following case in 
a class that extends our StopWatch to simplify client code.

{code}
public class SingleStopWatch extends StopWatch<Timers> {
  private static enum Timers {
    ELAPSED
  }

  public void synchronized start() {
    super.start(ELAPSED);
  }

  public void synchronized stop() {
    super.stop(ELAPSED);
  }
}
{code}

I'd love to be working towards have the client API instrumented well so that 
it's really clear to just look at a client application and know what took long 
on the client (complements the recent HTrace work on the server -- we can 
hopefully get to a full picture of client+server timings).

I have some other irritations about our StopWatch class (synchronization should 
be removed and mark the class as not threadsafe, should try to avoid 
System.currentTimeMillis), but those don't need to be addressed now.

Thoughts?

> Refactor OpTimer so that it does not use log4j logger.
> ------------------------------------------------------
>
>                 Key: ACCUMULO-3840
>                 URL: https://issues.apache.org/jira/browse/ACCUMULO-3840
>             Project: Accumulo
>          Issue Type: Sub-task
>          Components: build
>    Affects Versions: 1.6.2, 1.7.0
>            Reporter: Ed Coleman
>            Assignee: Ed Coleman
>            Priority: Minor
>             Fix For: 1.8.0
>
>         Attachments: ACCUMULO-3840.patch
>
>
> OpTimer currently uses log4j specific classes. OpTimer and the callers can be 
> modified so that log4j dependencies are not required.
> The evaluation of timer consolidation raised in ACCUMULO-3329 can still be 
> performed.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to