|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.neeve.rog.log.RogLogUtil
public class RogLogUtil
This class contains utility methods that are useful for working with ROG transaction logs.
Nested Class Summary | |
---|---|
static interface |
RogLogUtil.FieldFilter
Allows field paths to the filter for a type. |
static class |
RogLogUtil.FileBasedFieldFilter
A field filter that can be configured with filter information from a text based input stream. |
Field Summary | |
---|---|
static String |
DIVERGENCE_FILTERS_RESOUCE_PATH
The search path used to lookup field filters on the class path. |
static String |
NEWLINE
|
Constructor Summary | |
---|---|
RogLogUtil()
|
Method Summary | |
---|---|
static boolean |
compareEntries(RogLog source,
RogLog target,
RogLogUtil.FieldFilter filter,
BufferedWriter summary,
int diffLimit,
boolean metadata,
boolean verbose,
com.neeve.util.UtlTableFormatter.Format format)
Compares entries between the given RogLog s. |
static boolean |
compareRogNodes(IRogNode node1,
IRogNode node2,
RogLogUtil.FieldFilter filter,
StringBuffer diffBuffer)
Compares two nodes to one another. |
static boolean |
compareState(RogLog source,
RogLog target,
RogLogUtil.FieldFilter filter,
BufferedWriter summary,
boolean metadata,
boolean verbose,
com.neeve.util.UtlTableFormatter.Format format)
Compares state for the given logs. |
static File |
createExecutableArchive(File archiveFolder,
String archiveName,
PrintStream out,
Tracer tracer,
RogLog... logs)
Creates an executable uber jar comprised of current classpath with the TransactionLogTool as the Main-Class, and bundled copies of the specified RogLog 's files. |
static void |
dumpLogEntryJson(RogLog.Entry entry,
boolean includeMetadata,
boolean includePayload,
Appendable a)
Dumps a log entry in json format. |
static void |
dumpObjectAsJson(IRogMetadata metadata,
IStoreObject object,
boolean dumpMetadata,
boolean dumpObject,
Appendable a)
Dumps an IStoreObject object or its metadata in json format. |
static List<File> |
extractArchivedLogs(PrintStream out,
File extractionFolder)
Extracts archived log files from the current classpath. |
static RogLogUtil.FileBasedFieldFilter |
loadComparisonFilter()
Loads the default field comparison filter from configuration files on the classpath. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String DIVERGENCE_FILTERS_RESOUCE_PATH
RogLogUtil.FileBasedFieldFilter
,
loadComparisonFilter()
,
Constant Field Valuespublic static final String NEWLINE
Constructor Detail |
---|
public RogLogUtil()
Method Detail |
---|
public static File createExecutableArchive(File archiveFolder, String archiveName, PrintStream out, Tracer tracer, RogLog... logs) throws Exception
RogLog
's files.
archiveFolder
- The directory under which to create the archivearchiveName
- The archive name (which will be suffixed with a timestamp).tracer
- The tracer to use to log output of the archiving operation.logs
- The RogLog
s to include in the archive.
IllegalArgumentException
- If no logs are specified.
IOException
- If the archive can't be created.
Exception
public static List<File> extractArchivedLogs(PrintStream out, File extractionFolder) throws IOException
IOException
- If there is an error extracting log filespublic static final boolean compareEntries(RogLog source, RogLog target, RogLogUtil.FieldFilter filter, BufferedWriter summary, int diffLimit, boolean metadata, boolean verbose, com.neeve.util.UtlTableFormatter.Format format) throws Exception
RogLog
s.
source
- The source logtarget
- The target logfilter
- A RogLogUtil.FieldFilter
for ignoring fields in the comparisonsummary
- If provided difference are written to this writerdiffLimit
- The maximum number of divergent entries to summarizemetadata
- Whether internal platform data should be considered.verbose
- Enables debug information on the comparison in the output.
Exception
- If there is an error comparing the state.public static final boolean compareState(RogLog source, RogLog target, RogLogUtil.FieldFilter filter, BufferedWriter summary, boolean metadata, boolean verbose, com.neeve.util.UtlTableFormatter.Format format) throws Exception
source
- The source logtarget
- The target logfilter
- A RogLogUtil.FieldFilter
for ignoring fields in the comparisonsummary
- If provided difference are written to this writermetadata
- Whether internal platform data should be considered.verbose
- Enables debug information on the comparison in the output.
Exception
- If there is an error comparing the state.public static final boolean compareRogNodes(IRogNode node1, IRogNode node2, RogLogUtil.FieldFilter filter, StringBuffer diffBuffer) throws Exception
node1
- The first node.node2
- The second node.filter
- The field filter to ignore fields. If null the default filter will be used.diffBuffer
- An optional buffer into which to dump differences.
Exception
- If a failure occurs comparing the nodes.public static final RogLogUtil.FileBasedFieldFilter loadComparisonFilter() throws IOException
This method searches for field filters on the classpath found at "META-INF/com/neeve/rog/divergence.filters"
IOException
- If there is an error loading the field filters.
IllegalArgumentException
- If there is an error parsing the discovered field filterspublic static final void dumpLogEntryJson(RogLog.Entry entry, boolean includeMetadata, boolean includePayload, Appendable a)
entry
- The entry to dump.includeMetadata
- Whether or not to include entry metadata.includePayload
- If false no payload information will be shown.a
- The target appendable.public static final void dumpObjectAsJson(IRogMetadata metadata, IStoreObject object, boolean dumpMetadata, boolean dumpObject, Appendable a)
IStoreObject
object or its metadata in json format.
metadata
- The IRogMetadata
for the object.object
- The object to dumpdumpMetadata
- Whether metadata should be dumped.dumpObject
- Whether object payload should be included in the dumpa
- The target Appendable
to which to dump.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |