com.bigdata.journal
Class DumpJournal

java.lang.Object
  extended by com.bigdata.journal.DumpJournal

public class DumpJournal
extends Object

A utility class that opens the journal in a read-only mode and dumps the root blocks and metadata about the indices on a journal file.

Version:
$Id: DumpJournal.java 2265 2009-10-26 12:51:06Z thompsonbry $
Author:
Bryan Thompson
TODO:
add an option to collect histograms over index records so that "fat" in the indices may be targetted. We can always report histograms for the raw key and value data. However, with either an extensible serializer or with some application aware logic we are also able to report type specific histograms., add an option to dump only as of a specified commitTime?, add an option to copy off data from one or more indices as of a specified commit time?, add an option to restrict the names of the indices to be dumped (-name=)., allow dump even on a journal that is open (e.g., only request a read lock or do not request a lock). An error is reported when you actually begin to read from the file once it is opened in a read-only mode if there is another process with an exclusive lock. In fact, since the root blocks must be consistent when they are read, a reader would have to have a lock at the moment that it read the root blocks...

Field Summary
protected static org.apache.log4j.Logger log
           
 
Constructor Summary
DumpJournal()
           
 
Method Summary
static void dumpIndex(AbstractBTree btree, boolean showTuples)
          Utility method using an ITupleIterator to dump the keys and values in an AbstractBTree.
static void dumpJournal(File file, boolean dumpHistory, boolean dumpIndices, boolean showTuples)
           
static void main(String[] args)
          Dump one or more journal files.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final org.apache.log4j.Logger log
Constructor Detail

DumpJournal

public DumpJournal()
Method Detail

main

public static void main(String[] args)
Dump one or more journal files.

Parameters:
args - The name(s) of the journal file to open.
-history
Dump metadata for indices in all commit records (default only dumps the metadata for the indices as of the most current committed state).
-indices
Dump the indices (does not show the tuples by default).
-tuples
Dump the records in the indices.

dumpJournal

public static void dumpJournal(File file,
                               boolean dumpHistory,
                               boolean dumpIndices,
                               boolean showTuples)

dumpIndex

public static void dumpIndex(AbstractBTree btree,
                             boolean showTuples)
Utility method using an ITupleIterator to dump the keys and values in an AbstractBTree.

Parameters:
btree -
showTuples - When true the data for the keys and values will be displayed. Otherwise the scan will simply exercise the iterator.


Copyright © 2006-2009 SYSTAP, LLC. All Rights Reserved.