tephra-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anew <...@git.apache.org>
Subject [GitHub] incubator-tephra pull request #53: (TEPHRA-243) Improve logging for slow log...
Date Wed, 13 Sep 2017 17:24:17 GMT
Github user anew commented on a diff in the pull request:

    https://github.com/apache/incubator-tephra/pull/53#discussion_r138684944
  
    --- Diff: tephra-core/src/main/java/org/apache/tephra/persist/AbstractTransactionLog.java
---
    @@ -165,26 +203,36 @@ private void sync() throws IOException {
           // prevent writer being dereferenced
           tmpWriter = writer;
     
    -      List<Entry> currentPending = getPendingWrites();
    -      if (!currentPending.isEmpty()) {
    -        tmpWriter.commitMarker(currentPending.size());
    -      }
    -
    -      // write out all accumulated entries to log.
    -      for (Entry e : currentPending) {
    -        tmpWriter.append(e);
    -        entryCount++;
    -        latestSeq = Math.max(latestSeq, e.getKey().get());
    +      Entry[] currentPending = getPendingWrites();
    +      if (currentPending != null) {
    +        entryCount = currentPending.length;
    +        startTimerIfNeeded(tmpWriter, entryCount);
    +        tmpWriter.commitMarker(entryCount);
    +        for (Entry e : currentPending) {
    +          tmpWriter.append(e);
    +          latestSeq = Math.max(latestSeq, e.getKey().get());
    --- End diff --
    
    yes, actually that has always been the case, even before these changes...


---

Mime
View raw message