Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

Talker Class Reference

Reads and executes interactive user commands. More...

#include <talker.h>

Collaboration diagram for Talker:

Collaboration graph
[legend]
List of all members.

Public Methods

 Talker (const char *rippername, const char *tempdir, WebLinkGraph *ripperweb, GraphBuilder *rippergb, bool pvm_is_master, int pvm_numtasks) throw (exception)
 ~Talker ()
void Talk () throw (exception)
 Reads and executes commands through a couple of pipes. More...

void PropagateLeafCounts () throw (invalid_argument)
 Sends the LeafNode's occupation counts to other processes and clears the counts. More...

void PrintStatistics (ostream &o)
 prints out some memory usage statistics. More...

void PrintStatisticsGraph (ostream &o)
 prints out some link graph statistics. More...

bool BuildTags (ifstream &g)
 reads a file containing space separated urls and tags those which are found in the web link graph. More...

bool LoadLeaves (ifstream &g)
int GetToken (char *command, ostream &out, char *message, int n,...)
 In interactive mode, reads the next token from the command buffer, and returns the token's id number if recognized. More...

char * GetTokenVar (char *command, ostream &out, char *message)
 In interactive mode, reads the next token from the command buffer, and returns the token's string value for processing. More...

bool ProcessCommand (char *command, ostream &out)
void SetupFIFOs () throw (exception)
 Creates input/output FIFOs if they don't exist Also deletes nodes.equiv if it exists. More...

void RemoveFIFOs ()
 Unlinks the FIFO files. More...


Private Attributes

ostringstream inputfifo
ostringstream outputfifo
ostringstream nodequiv
const char * name
const char * tempdir
WebLinkGraphweb
GraphBuildergb
gsl_rng * r
PageRankSamplerprsampler
DateBiasedPageRankSamplerdbsampler
TruncatedKleinbergSamplertksampler
WebSamplerdefaultsampler
PVMInterfacepvminterface
LeafNodePtrListleaflist

Detailed Description

Reads and executes interactive user commands.

Definition at line 47 of file talker.h.


Constructor & Destructor Documentation

Talker::Talker const char *    rippername,
const char *    tempdir,
WebLinkGraph   ripperweb,
GraphBuilder   rippergb,
bool    pvm_is_master,
int    pvm_numtasks
throw (exception)
 

Definition at line 174 of file talker.cc.

References hubs, LeafNodePtrList, and NULL.

Talker::~Talker  
 

Definition at line 242 of file talker.cc.

References dbsampler, leaflist, prsampler, pvminterface, and RemoveFIFOs().


Member Function Documentation

bool Talker::BuildTags ifstream &    g
 

reads a file containing space separated urls and tags those which are found in the web link graph.

Definition at line 897 of file talker.cc.

References GraphBuilder::FindWebNode(), gb, and WebNode::SetTag().

Referenced by ProcessCommand().

int Talker::GetToken char *    command,
ostream &    out,
char *    message,
int    n,
...   
 

In interactive mode, reads the next token from the command buffer, and returns the token's id number if recognized.

Definition at line 921 of file talker.cc.

Referenced by ProcessCommand().

char * Talker::GetTokenVar char *    command,
ostream &    out,
char *    message
 

In interactive mode, reads the next token from the command buffer, and returns the token's string value for processing.

Definition at line 944 of file talker.cc.

References NULL.

Referenced by ProcessCommand().

bool Talker::LoadLeaves ifstream &    g
 

Definition at line 963 of file talker.cc.

References GraphBuilder::AddLeaf(), EQUIV_SIZE, GraphBuilder::FindLeafNodeKey(), GraphBuilder::FindWebNode(), gb, WebNode::ID(), leaflist, nodequiv, IDPair::one, LeafNode::SetDate(), GraphBuilder::SetupLeafTable(), IDPair::two, uint16, uint32, and GraphBuilder::UpdateLeafLinks().

Referenced by ProcessCommand().

void Talker::PrintStatistics ostream &    o
 

prints out some memory usage statistics.

Definition at line 881 of file talker.cc.

References gb, leaflist, num_docs_processed, and GraphBuilder::StatisticsMem().

Referenced by ProcessCommand().

void Talker::PrintStatisticsGraph ostream &    o
 

prints out some link graph statistics.

Definition at line 889 of file talker.cc.

References gb, and GraphBuilder::StatisticsGraph().

Referenced by ProcessCommand().

bool Talker::ProcessCommand char *    command,
ostream &    out
 

Definition at line 458 of file talker.cc.

References auth, PVMInterface::BroadcastCommand(), WebLinkGraph::BuildFromSets(), BuildTags(), WebSampler::ClearAllocForward(), WebSampler::ClearCounts(), WebLinkGraph::ClearTags(), dbsampler, defaultsampler, gb, PVMInterface::GetCommandWithTimeout(), WebLinkGraph::GetFromSetSizes(), PVMInterface::GetLeafCounts(), GetToken(), GetTokenVar(), helptext, GraphBuilder::HighestDate(), hubs, WebSampler::IncrementAllocForward(), PVMInterface::IsMaster(), ktype, PVMInterface::LastMessageOriginator(), WebSampler::LastRunSize(), WebSampler::LastTaggedRunSize(), leaflist, LoadLeaves(), GraphBuilder::LowestDate(), GraphBuilder::LowestID(), MAXLEAFMESSAGE_SIZE, WebLinkGraph::MeasureFromSets(), PVMInterface::MessagePending(), name, WebSampler::Name(), NULL, PVMInterface::NumberOfOtherTasks(), PVMInterface::NumberOfTasks(), LeafCountsStruct::occupation_count, WebSampler::PrintCounts(), PrintStatistics(), PrintStatisticsGraph(), WebSampler::PrintTagCounts(), WebLinkGraph::PrintWebGraph(), PropagateLeafCounts(), prsampler, pvminterface, r, PVMInterface::SendCommand(), TruncatedKleinbergSampler::SetParameters(), DateBiasedPageRankSampler::SetParameters(), PageRankSampler::SetParameters(), WebSampler::SetRandomSeed(), WebSampler::SimulateAllocForward(), WebSampler::SimulateForward(), PVMInterface::StartID(), WebLinkGraph::StatisticsFromSets(), PVMInterface::StopID(), WebSampler::TaggedSimulateForward(), tempdir, tksampler, uint32, undef, and web.

void Talker::PropagateLeafCounts   throw (invalid_argument)
 

Sends the LeafNode's occupation counts to other processes and clears the counts.

This procedure is interruptible by pending messages.

Exception caveat: Because we want to cast the structure LeafCountsStruct as a consecutive pair of unsigned integers, we throw an invalid_argument exception in case sizeof(unsigned int) != sizeof(uint32) for this compiler. Not very portable, but less work :-)

Definition at line 403 of file talker.cc.

References greater_LeafCountsStruct(), LeafCountsStruct::id, MAXLEAFMESSAGE_SIZE, LeafCountsStruct::occupation_count, and uint32.

Referenced by ProcessCommand().

void Talker::RemoveFIFOs  
 

Unlinks the FIFO files.

Definition at line 281 of file talker.cc.

References inputfifo, and outputfifo.

Referenced by ~Talker().

void Talker::SetupFIFOs   throw (exception)
 

Creates input/output FIFOs if they don't exist Also deletes nodes.equiv if it exists.

Definition at line 253 of file talker.cc.

void Talker::Talk   throw (exception)
 

Reads and executes commands through a couple of pipes.

This function executes interactive commands. Input is read from /tmp/ripper.input and resposes are written to /tmp/ripper.output

Definition at line 292 of file talker.cc.

Referenced by main().


Member Data Documentation

DateBiasedPageRankSampler* Talker::dbsampler [private]
 

Definition at line 84 of file talker.h.

Referenced by ProcessCommand(), and ~Talker().

WebSampler* Talker::defaultsampler [private]
 

Definition at line 86 of file talker.h.

Referenced by ProcessCommand().

GraphBuilder* Talker::gb [private]
 

Definition at line 79 of file talker.h.

Referenced by BuildTags(), LoadLeaves(), PrintStatistics(), PrintStatisticsGraph(), and ProcessCommand().

ostringstream Talker::inputfifo [private]
 

Definition at line 73 of file talker.h.

Referenced by RemoveFIFOs().

LeafNodePtrList* Talker::leaflist [private]
 

Definition at line 90 of file talker.h.

Referenced by LoadLeaves(), PrintStatistics(), ProcessCommand(), and ~Talker().

const char* Talker::name [private]
 

Definition at line 76 of file talker.h.

Referenced by ProcessCommand().

ostringstream Talker::nodequiv [private]
 

Definition at line 75 of file talker.h.

Referenced by LoadLeaves().

ostringstream Talker::outputfifo [private]
 

Definition at line 74 of file talker.h.

Referenced by RemoveFIFOs().

PageRankSampler* Talker::prsampler [private]
 

Definition at line 83 of file talker.h.

Referenced by ProcessCommand(), and ~Talker().

PVMInterface* Talker::pvminterface [private]
 

Definition at line 88 of file talker.h.

Referenced by ProcessCommand(), and ~Talker().

gsl_rng* Talker::r [private]
 

Definition at line 81 of file talker.h.

Referenced by ProcessCommand().

const char* Talker::tempdir [private]
 

Definition at line 77 of file talker.h.

Referenced by ProcessCommand().

TruncatedKleinbergSampler* Talker::tksampler [private]
 

Definition at line 85 of file talker.h.

Referenced by ProcessCommand().

WebLinkGraph* Talker::web [private]
 

Definition at line 78 of file talker.h.

Referenced by ProcessCommand().


Generated on Wed May 29 11:37:28 2002 for MarkovPR by doxygen1.2.15