jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dpfis...@apache.org
Subject svn commit: r703479 - in /jackrabbit/sandbox/jackrabbit-journalwalker: README.txt src/main/java/org/apache/jackrabbit/journalwalker/JournalWalker.java
Date Fri, 10 Oct 2008 13:57:20 GMT
Author: dpfister
Date: Fri Oct 10 06:57:20 2008
New Revision: 703479

URL: http://svn.apache.org/viewvc?rev=703479&view=rev
Log:
When specifying a revision together with multiple record log files, display only the one containing
that revision.

Modified:
    jackrabbit/sandbox/jackrabbit-journalwalker/README.txt
    jackrabbit/sandbox/jackrabbit-journalwalker/src/main/java/org/apache/jackrabbit/journalwalker/JournalWalker.java

Modified: jackrabbit/sandbox/jackrabbit-journalwalker/README.txt
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-journalwalker/README.txt?rev=703479&r1=703478&r2=703479&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-journalwalker/README.txt (original)
+++ jackrabbit/sandbox/jackrabbit-journalwalker/README.txt Fri Oct 10 06:57:20 2008
@@ -72,8 +72,9 @@
 Displaying journal contents
 ===========================
 
-Usage: directory [revision]
+Usage: [ -r revision ] directory | files
 
-directory: is the directory where journal files are located
 revision: is an optional argument specifying the revision to start with
+directory: is the directory where journal files are located
+files: journal log files (named journal.log or journal.log.N)
 

Modified: jackrabbit/sandbox/jackrabbit-journalwalker/src/main/java/org/apache/jackrabbit/journalwalker/JournalWalker.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-journalwalker/src/main/java/org/apache/jackrabbit/journalwalker/JournalWalker.java?rev=703479&r1=703478&r2=703479&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-journalwalker/src/main/java/org/apache/jackrabbit/journalwalker/JournalWalker.java
(original)
+++ jackrabbit/sandbox/jackrabbit-journalwalker/src/main/java/org/apache/jackrabbit/journalwalker/JournalWalker.java
Fri Oct 10 06:57:20 2008
@@ -18,7 +18,6 @@
 
 import java.io.File;
 import java.io.IOException;
-import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
@@ -88,6 +87,11 @@
     private FileRecordLog recordLog;
 
     /**
+     * File containing record log.
+     */
+    private File f;
+
+    /**
      * Revision.
      */
     private long revision;
@@ -113,8 +117,9 @@
     /**
      * Create a new instance of this class.
      */
-    public JournalWalker(FileRecordLog recordLog, long revision) {
+    public JournalWalker(FileRecordLog recordLog, File f, long revision) {
         this.recordLog = recordLog;
+        this.f = f;
 
         if (revision == 0) {
             revision = recordLog.getPreviousRevision();
@@ -128,6 +133,9 @@
      * @throws IOException if an I/O error occurs
      */
     public void walk() throws IOException {
+        log("---" + f.getPath());
+        log("");
+
         recordLog.seek(revision);
 
         NamePathResolver npResolver = new DefaultNamePathResolver(this, true);
@@ -198,10 +206,6 @@
         return revision;
     }
 
-    /**
-     * Walk
-     */
-
     //--------------------------------------------------- ClusterRecordProcessor
 
     /**
@@ -476,8 +480,10 @@
                 journal.sync();
             } else if (f.isFile()) {
                 FileRecordLog recordLog = new FileRecordLog(f);
-
-                JournalWalker walker = new JournalWalker(recordLog, revision);
+                if (revision != 0 && !recordLog.contains(revision)) {
+                    continue;
+                }
+                JournalWalker walker = new JournalWalker(recordLog, f, revision);
                 walker.walk();
             }
         }



Mime
View raw message