tephra-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From poornachandra <...@git.apache.org>
Subject [GitHub] incubator-tephra pull request #32: (TEPHRA-215) (TEPHRA-218) Use single thre...
Date Tue, 07 Feb 2017 17:43:49 GMT
Github user poornachandra commented on a diff in the pull request:

    https://github.com/apache/incubator-tephra/pull/32#discussion_r99881005
  
    --- Diff: tephra-hbase-compat-1.1-base/src/main/java/org/apache/tephra/hbase/txprune/PruneUpperBoundWriter.java
---
    @@ -79,15 +72,17 @@ public void run() {
             while (!isInterrupted()) {
               long now = System.currentTimeMillis();
               if (now > (lastChecked + pruneFlushInterval)) {
    -            if (shouldFlush.compareAndSet(true, false)) {
    +            if (!pruneEntries.isEmpty()) {
                   // should flush data
                   try {
    -                dataJanitorState.savePruneUpperBoundForRegion(regionName, pruneUpperBound.get());
    +                Iterator<PruneInfo> iterator = pruneEntries.iterator();
    --- End diff --
    
    Since we are doing concurrent operations here it would be good to use `peek()` and `poll()`,
rather than a iterator.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message