accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ktur...@apache.org
Subject [accumulo] 01/01: Merge branch '1.9'
Date Thu, 10 Jan 2019 15:31:12 GMT
This is an automated email from the ASF dual-hosted git repository.

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

commit 6d60e3bc16d0b455cb8d035580212af7ffa040d4
Merge: d379b5f 577dd9a
Author: Keith Turner <kturner@apache.org>
AuthorDate: Thu Jan 10 10:19:21 2019 -0500

    Merge branch '1.9'

 .../org/apache/accumulo/tserver/TabletServer.java  |  2 +-
 .../accumulo/tserver/log/RecoveryLogsIterator.java | 10 +++-
 .../accumulo/tserver/log/SortedLogRecovery.java    | 62 ++++++++++++++++++++--
 3 files changed, 68 insertions(+), 6 deletions(-)

diff --cc server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
index a7ddcac,c30b443..a06284d
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
@@@ -3362,16 -3263,23 +3362,16 @@@ public class TabletServer implements Ru
      logger.minorCompactionStarted(tablet, lastUpdateSequence, newMapfileLocation, durability);
    }
  
 -  public void recover(VolumeManager fs, KeyExtent extent, TableConfiguration tconf,
 -      List<LogEntry> logEntries, Set<String> tabletFiles, MutationReceiver mutationReceiver)
 -      throws IOException {
 +  public void recover(VolumeManager fs, KeyExtent extent, List<LogEntry> logEntries,
 +      Set<String> tabletFiles, MutationReceiver mutationReceiver) throws IOException
{
      List<Path> recoveryLogs = new ArrayList<>();
      List<LogEntry> sorted = new ArrayList<>(logEntries);
 -    Collections.sort(sorted, new Comparator<LogEntry>() {
 -      @Override
 -      public int compare(LogEntry e1, LogEntry e2) {
 -        return (int) (e1.timestamp - e2.timestamp);
 -      }
 -    });
 +    Collections.sort(sorted, (e1, e2) -> (int) (e1.timestamp - e2.timestamp));
      for (LogEntry entry : sorted) {
        Path recovery = null;
 -      Path finished = RecoveryPath.getRecoveryPath(fs,
 -          fs.getFullPath(FileType.WAL, entry.filename));
 +      Path finished = RecoveryPath.getRecoveryPath(fs.getFullPath(FileType.WAL, entry.filename));
        finished = SortedLogState.getFinishedMarkerPath(finished);
-       TabletServer.log.info("Looking for " + finished);
+       TabletServer.log.debug("Looking for " + finished);
        if (fs.exists(finished)) {
          recovery = finished.getParent();
        }
diff --cc server/tserver/src/main/java/org/apache/accumulo/tserver/log/RecoveryLogsIterator.java
index 64c7af2,8912aeb..31ef699
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/log/RecoveryLogsIterator.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/log/RecoveryLogsIterator.java
@@@ -51,10 -52,23 +51,18 @@@ public class RecoveryLogsIterator imple
  
      try {
        for (Path log : recoveryLogPaths) {
-         iterators.add(new RecoveryLogReader(fs, log, start, end));
+         LOG.debug("Opening recovery log {}", log.getName());
+         RecoveryLogReader rlr = new RecoveryLogReader(fs, log, start, end);
+         if (rlr.hasNext()) {
+           LOG.debug("Write ahead log {} has data in range {} {}", log.getName(), start,
end);
+           iterators.add(rlr);
+         } else {
+           LOG.debug("Write ahead log {} has no data in range {} {}", log.getName(), start,
end);
+           rlr.close();
+         }
        }
  
 -      iter = Iterators.mergeSorted(iterators, new Comparator<Entry<LogFileKey,LogFileValue>>()
{
 -        @Override
 -        public int compare(Entry<LogFileKey,LogFileValue> o1, Entry<LogFileKey,LogFileValue>
o2) {
 -          return o1.getKey().compareTo(o2.getKey());
 -        }
 -      });
 +      iter = Iterators.mergeSorted(iterators, (o1, o2) -> o1.getKey().compareTo(o2.getKey()));
  
      } catch (RuntimeException | IOException e) {
        try {


Mime
View raw message