afs commented on a change in pull request #537: JENA-1676 , JENA-1677: Make the 
commit step more robust against external factors
URL: https://github.com/apache/jena/pull/537#discussion_r261578115
 
 

 ##########
 File path: 
jena-db/jena-dboe-transaction/src/main/java/org/apache/jena/dboe/transaction/txn/journal/JournalControl.java
 ##########
 @@ -18,280 +18,38 @@
 
 package org.apache.jena.dboe.transaction.txn.journal;
 
-import java.util.Iterator ;
+import java.util.Iterator;
 
 import org.apache.jena.dboe.base.file.BufferChannelFile;
-import org.slf4j.Logger ;
-import org.slf4j.LoggerFactory ;
 
-
-public class JournalControl
-{
-    private static Logger log = LoggerFactory.getLogger(JournalControl.class) ;
-
-    // In TransactionCoordinator
-//    // Interface
-//    public static void recovery(TransactionCoordinator txnCoord)
-//    {
-//        txnCoord.getJournal() ;
-//        
-//    }
-//    
-//    public static void replay(Transaction transaction)
-//    {}
-    
-    /** Dump a journal - debug support function - opens the journal specially 
- inconsistent views possible */
+public class JournalControl {
+    /**
+     * Dump a journal - debug support function - opens the journal specially -
+     * inconsistent views possible
+     */
     public static void print(String filename) {
-        BufferChannelFile chan = BufferChannelFile.createUnmanaged(filename, 
"r") ;
-        Journal journal = Journal.create(chan) ;
-        JournalControl.print(journal) ;
-        chan.close() ;
+        BufferChannelFile chan = BufferChannelFile.createUnmanaged(filename, 
"r");
+        Journal journal = Journal.create(chan);
+        try {
+            print(journal);
+        }
+        finally {
+            journal.close();
+        }
     }
-    
+
+    /**
+     * Dump a journal - debug support function.
+     */
     public static void print(Journal journal) {
-        System.out.println("Size: "+journal.size()) ;
-        Iterator<JournalEntry> iter = journal.entries() ; 
-        
-        for (  ; iter.hasNext() ; )
-        {
-            JournalEntry e = iter.next() ;
-            //System.out.println("Posn: "+journal.position()+" : 
("+(journal.size()-journal.position())+")") ;
-            System.out.println(JournalEntry.format(e)) ;
+        System.out.println("Size: " + journal.size());
+        Iterator<JournalEntry> iter = journal.entries();
+
+        for ( ; iter.hasNext() ; ) {
+            JournalEntry e = iter.next();
+            // System.out.println("Posn: "+journal.position()+" :
+            // ("+(journal.size()-journal.position())+")") ;
+            System.out.println(JournalEntry.format(e));
         }
     }
-
 
 Review comment:
   Yes - I found this large block of stuff that looks like it started in TDB1.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to