rice.pastry.wire.testing
Class WireFileProcessor

java.lang.Object
  extended byrice.pastry.wire.testing.WireFileProcessor

public class WireFileProcessor
extends java.lang.Object

This file interprets all of the files generated by wireDebug() calls throughout the wire package. It is used to test wether 100% of queued messages are received by some node. There are 2 phases. The first parses all the messages into a MessageDigest, and arranges them by node, then Enqueue, Sent, Received, Dropped (not yet implemented) The second phase analyzes those tables and makes sure that all sent messages are received.


Nested Class Summary
 class WireFileProcessor.ObjPair
           
 class WireFileProcessor.Pair
           
 
Field Summary
static java.lang.String DM_PREFIX
           
 java.util.Hashtable dropped
           
static java.lang.String dropPrefix
           
static java.lang.String enquePrefix
           
 java.util.Hashtable enqueued
          String nodeid -> HashTable of MessageDigest -> ObjPair
static int ID_LENGTH
           
static int NUM_TABLES
           
static int PREFIX_LENGTH
           
 java.util.Hashtable received
           
static java.lang.String receivedPrefix
           
 java.util.Hashtable sent
           
static java.lang.String sentPrefix
           
 java.util.Hashtable[] tables
           
static int TYPE_DRP
           
static int TYPE_ENQ
           
static int TYPE_REC
           
static int TYPE_SEN
           
static java.lang.String WNH_PREFIX
           
 
Constructor Summary
WireFileProcessor()
           
 
Method Summary
 int addToTable(int type, MessageDigest msg)
           
 void compareEnqRec()
           
 void compareEnqSnd()
           
 int compareSets(java.util.Hashtable sa, java.util.Hashtable sb)
           
 void compareTables(java.util.Hashtable ta, java.util.Hashtable tb)
           
 WireFileProcessor.Pair countItems(java.util.Hashtable t)
           
 WireFileProcessor.Pair countItems2(java.util.Hashtable set)
           
static java.io.BufferedReader getReader(java.io.File f)
           
static java.lang.String getType(int type)
           
static int getType(java.lang.String prefix)
           
static void main(java.lang.String[] args)
           
 void printTableTotals()
           
 void processDMFile(java.io.File f, boolean log)
           
 void processFile(java.lang.String fname)
           
 void processFiles()
           
 void processFiles(java.io.File workingDirectory)
           
 void processWNHFile(java.io.File f, boolean log)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WNH_PREFIX

public static final java.lang.String WNH_PREFIX
See Also:
Constant Field Values

DM_PREFIX

public static final java.lang.String DM_PREFIX
See Also:
Constant Field Values

PREFIX_LENGTH

public static final int PREFIX_LENGTH
See Also:
Constant Field Values

enquePrefix

public static final java.lang.String enquePrefix
See Also:
Constant Field Values

sentPrefix

public static final java.lang.String sentPrefix
See Also:
Constant Field Values

receivedPrefix

public static final java.lang.String receivedPrefix
See Also:
Constant Field Values

dropPrefix

public static final java.lang.String dropPrefix
See Also:
Constant Field Values

TYPE_ENQ

public static final int TYPE_ENQ
See Also:
Constant Field Values

TYPE_SEN

public static final int TYPE_SEN
See Also:
Constant Field Values

TYPE_REC

public static final int TYPE_REC
See Also:
Constant Field Values

TYPE_DRP

public static final int TYPE_DRP
See Also:
Constant Field Values

ID_LENGTH

public static final int ID_LENGTH
See Also:
Constant Field Values

NUM_TABLES

public static final int NUM_TABLES
See Also:
Constant Field Values

enqueued

public java.util.Hashtable enqueued
String nodeid -> HashTable of MessageDigest -> ObjPair


sent

public java.util.Hashtable sent

received

public java.util.Hashtable received

dropped

public java.util.Hashtable dropped

tables

public java.util.Hashtable[] tables
Constructor Detail

WireFileProcessor

public WireFileProcessor()
Method Detail

processFiles

public void processFiles()
                  throws java.io.IOException
Throws:
java.io.IOException

processFile

public void processFile(java.lang.String fname)
                 throws java.io.IOException
Throws:
java.io.IOException

processFiles

public void processFiles(java.io.File workingDirectory)
                  throws java.io.IOException
Throws:
java.io.IOException

processWNHFile

public void processWNHFile(java.io.File f,
                           boolean log)
                    throws java.io.IOException
Throws:
java.io.IOException

processDMFile

public void processDMFile(java.io.File f,
                          boolean log)
                   throws java.io.IOException
Throws:
java.io.IOException

addToTable

public int addToTable(int type,
                      MessageDigest msg)

getType

public static int getType(java.lang.String prefix)

getType

public static java.lang.String getType(int type)

getReader

public static java.io.BufferedReader getReader(java.io.File f)
                                        throws java.io.IOException
Throws:
java.io.IOException

countItems

public WireFileProcessor.Pair countItems(java.util.Hashtable t)

countItems2

public WireFileProcessor.Pair countItems2(java.util.Hashtable set)

printTableTotals

public void printTableTotals()

compareEnqSnd

public void compareEnqSnd()

compareEnqRec

public void compareEnqRec()

compareTables

public void compareTables(java.util.Hashtable ta,
                          java.util.Hashtable tb)

compareSets

public int compareSets(java.util.Hashtable sa,
                       java.util.Hashtable sb)

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception





Imprint-Dataprotection