input
stringlengths
10
828
output
stringlengths
5
107
public void set last top level poll time long new poll time last top level poll new poll time
sets the last top level poll time to a new value
public void set clockss subscription status int new subscription status clockss subscription status new subscription status
sets the clockss subscription status to a new value
public boolean contains to repair cached url set cus string node url get the url list associated with that cus url if any array list url array array list cus to repair get cus get url if url array null return url array contains node url return false
checks if the url needs repair
public list get history beans return history beans
gets the collection of poll history beans
synchronized public boolean has damage cached url set cus check if the cus contains any of the other damaged nodes iterator damaged it nodes with damage iterator while damaged it has next string url string damaged it next if cus contains url url return true return false
returns true if the cus has damage
protected object serializer make poll histories serializer castor phase out with castor return make object serializer node history bean class
p builds a new serializer for poll histories
public void set history beans list history beans this history beans history beans
sets the collection of poll history beans
synchronized public void add to damage string node url if nodes with damage add node url repository store damaged node set this
add this url to the list of nodes with damage and write through
synchronized public void add to repair cached url set cus collection node urls all repairs are associated with a specific cus array list url array array list cus to repair get cus get url merge the urls with any already stored if url array null url array new array list node urls size iterator iter node urls iterator while iter has next object url iter next if url array contains url url array add url cus to repair put cus get url url array repository store damaged node set this
add the collection of url strings to the cuss repair list merging
synchronized public void remove from damage string node url if nodes with damage remove node url repository store damaged node set this
remove the url from the damage list
synchronized public void remove from repair cached url set cus string node url collection urls collection cus to repair get cus get url if urls null urls remove node url if urls is empty cus to repair remove cus get url repository store damaged node set this
remove the url from the to repair list
public iterator damage iterator return nodes with damage iterator
iterator of damaged url strings
public hash set get damaged nodes return nodes with damage
returns the set of damaged url strings
public void set damaged nodes hash set nodes if nodes null nodes with damage new hash set else this nodes with damage nodes
sets the set of damaged url strings
public hash map get nodes to repair return cus to repair
returns the map of cus list entries for nodes to repair
public ext map bean get repair node bean ext map bean bean new ext map bean cus to repair return bean
accessor for marshalling the repair map
public archival unit get archival unit return au
returns the au
public void set repair node bean ext map bean map bean cus to repair map bean get map
accessor for unmarshalling the repair map
protected void post unmarshal lockss app context if active v3 polls null active v3 polls new array list if completed v3 polls null completed v3 polls new array list
when unmarshalling this object check for any pre daemon 1
public long get au creation time try return history repo get au creation time catch lockss repository exception e logger error get au creation time lockss repository exception e get message return 1
returns the date time the au was created
public long get last crawl time return last crawl time
returns the last new content crawl time of the au
public long get last crawl attempt if is crawl active return previous crawl state get last crawl attempt return last crawl attempt
returns the last time a new content crawl was attempted
public int get last crawl result if is crawl active return previous crawl state get last crawl result return last crawl result
returns the result code of the last new content crawl
public string get last crawl result msg if is crawl active return previous crawl state get last crawl result msg if last crawl result msg null return crawler status get default message last crawl result return last crawl result msg
returns the result of the last new content crawl
public boolean has crawled return get last crawl time 0
returns true if the au has ever successfully completed a new content
public long get last top level poll time return last top level poll
returns the last time a top level poll completed
public long get last poll start if is poll active return previous poll state get last poll start return last poll start
returns the last time a poll started
public long get last poll attempt return last poll attempt
returns the last time a poll was attempted since the last daemon
public int get last poll result if is poll active return previous poll state get last poll result return last poll result
returns the result code of the last poll
public string get last poll result msg if is poll active return previous poll state get last poll result msg if last poll result msg null try return v3 poller get status string last poll result catch index out of bounds exception e return null return last poll result msg
returns the result of the last poll
public long get poll duration return poll duration
returns the running average poll duration or 0 if unknown
public long set poll duration long duration if poll duration 0 poll duration duration else poll duration poll duration duration 1 2 return poll duration
update the poll duration to the average of current and previous
public long get last tree walk time return last tree walk
returns the last treewalk time for the au
public string get type string string str switch type case new content crawl str new content break case repair crawl str repair break case background crawl str background break case node deleted str node deleted break default str none return str
return the crawl type as a string
public string get status string string str switch status case scheduled str scheduled break case running str running break case finished str finished break default str undefined return str
return the status of the crawl as a string
public void new crawl started save last crawl last crawl attempt time base now ms last crawl result crawler status running at crash last crawl result msg null history repo store au state this
sets the last time a crawl was attempted
public void new crawl finished int result string result msg last crawl result msg result msg switch result case crawler status successful last crawl time time base now ms fall through default last crawl result result last crawl result msg result msg break case crawler status active logger warning storing active state new throwable break previous crawl state null history repo store au state this
sets the last crawl time to the current time
public long length if end time 1 the poll has completed return end time start time else the poll is still active return duration
return the length of the poll
public void poll started save last poll last poll start time base now ms last poll result crawler status running at crash last poll result msg null history repo store au state this
sets the last time a poll was started
public void poll attempted last poll attempt time base now ms
sets the last time a poll was attempted
public void poll finished int result string result msg last poll result msg result msg switch result case v3 poller poller status complete last top level poll time base now ms fall through default last poll result result last poll result msg result msg break set poll duration time base ms since last poll attempt previous poll state null history repo store au state this
sets the last poll time to the current time
public void poll finished int result poll finished result null
sets the last poll time to the current time
public void poll finished poll finished v3 poller poller status complete null
sets the last poll time to the current time
public string get feature version plugin feature feat switch feat case substance return substance version case metadata return metadata version default return null
get the version string that was last set for the given feature
public void set feature version plugin feature feat string ver switch feat case substance substance version ver break case metadata metadata version ver break default store au state
set the version of the feature that was just used to process the
public hash set get crawl urls if crawl urls null crawl urls new hash set return crawl urls
gets the collection of crawl urls
public void updated crawl urls boolean force write url update cntr if force write url update cntr url update limit history repo store au state this url update cntr 0
alert the au state that the crawl url collection has been updated
public int get clockss subscription status return clockss subscription status
return the clockss subscription status clockss sub unknown
public string get type string switch type case 0 return n case 1 return c default return unknown
returns the poll type as a string
public string get lwr bound return lwr bound
returns the lower boundary for a ranged match this poll
public string get upr bound return upr bound
returns the upper boundary for a ranged match this poll
public string get range string if lwr bound null lwr bound equals poll spec single node lwrbound return single node if lwr bound null upr bound null return lwr bound upr bound return none
returns a human readable version of the range
public boolean is our poll return our poll
returns true if this poll was started by us
public string get status string switch status case scheduled return scheduled case running return running case repairing return repairing case won return won case lost return lost case repaired return repaired case unrepairable return unrepairable case err schedule hash return hash busy case err hashing return error hashing case err io return error i 0 case err undefined return undefined error case unfinished return unfinished case inconclusive return inconclusive default return undefined
returns the status of the poll as a string
public crawl state bean get crawl state bean return crawl bean
returns the crawl state bean
public deadline get deadline return deadline
returns the deadline for the poll absolute
public void set crawl state bean crawl state bean new bean this crawl bean new bean
sets the crawl state bean
public list get poll beans return poll beans
returns a list of poll state beans
public boolean is active return status running status repairing status scheduled
returns true if the poll is in an active state
public void set poll beans list new list poll beans new list
sets the list of poll state beans
public long get average hash duration return hash duration
returns the last hash duration
public boolean is error state return status err schedule hash status err hashing status err io status err undefined
returns true if the poll ended with an error state
public void set average hash duration long new duration hash duration new duration
sets the last hash duration
public int get state return cur state
returns the state
private int compare int int1 int int2 return int1 int2
return 0 if int1 int2 0 if int1 int2 0 otherwise
public void set state int new state cur state new state
sets the state
public int compare to object obj poll state ps2 poll state obj int return val 0 return val compare type ps2 type if return val 0 return return val return val string util compare to null low lwr bound ps2 lwr bound if return val 0 return return val return string util compare to null low upr bound ps2 upr bound
returns a string
private poll state get poll state node state state tallier results iterator polls state get active polls poll spec spec results get poll spec if logger is debug2 logger debug2 getting poll state for spec spec while polls has next poll state poll state poll state polls next if string util equal strings poll state get lwr bound spec get lwr bound string util equal strings poll state get upr bound spec get upr bound poll state get type results get type return poll state return null
finds a poll state in the node state which matches the results spec
public void delete node cached url set cus throws ioexception lockss repository repository get daemon get lockss repository managed au repository delete node cus get url node state extra state get node state cus extra state get crawl state type crawl state node deleted
deletes the node from the lockss repository
private void deactivate node cached url set cus throws ioexception lockss repository repository get daemon get lockss repository managed au repository deactivate node cus get url
deactivates the node in the lockss repository
public void set au config configuration au config
called between init service and start service then whenever the
public boolean has at least int that many if has not ok int size 0 for batch au status entry rs get status list if rs is ok if size that many return true return false else return get status list size that many
p returns true if there are at least a given number
private void call single node content poll cached url set cus create a single node cached url set archival unit au cus get archival unit cached url set new cus au make cached url set new single node cached url set spec cus get url poll spec spec new poll spec new cus poll v1 content poll call poll spec
calls a single node content poll on the cus
private void recurse consistency check repository node impl node logger debug2 checking node node get node url check consistency at each node correct deactivate as necessary check node consistency will repair if possible if node check node consistency logger debug3 node consistent recursing on children list children node get node list null false iterator iter children iterator while iter has next repository node impl child repository node impl iter next recurse consistency check child else logger debug3 node inconsistent deactivating deactivate inconsistent node node
checks the consistency of the node and continues with its children
private void call last poll poll spec spec poll state last poll if spec get poll type last poll type logger error re calling a poll poll name last poll type poll but spec is poll poll name spec get poll type if logger is debug2 logger debug2 re calling a poll poll name last poll type poll on spec if poll manager call poll spec null if logger is debug2 logger debug2 failed to re call a poll poll name last poll type poll on spec
recalls a poll matching the last poll given by the poll state
private void call poll poll spec spec if logger is debug2 logger debug2 calling a poll on spec if poll manager call poll spec null if logger is debug2 logger debug2 failed to call a poll on spec
calls a poll with the given spec
private void call name poll poll spec spec if spec get poll type poll v1 name poll logger error call name poll on spec for poll poll name spec get poll type call poll spec
calls a name poll with the given spec
private void call content poll poll spec spec if spec get poll type poll v1 content poll logger error calling a content poll on spec for poll poll name spec get poll type call poll spec
calls a content poll with the given spec
public class repository state exception extends runtime exception public repository state exception super public repository state exception string msg super msg public repository state exception throwable cause super cause public repository state exception string msg throwable cause super msg cause
thrown when an unexpected error is encountered while caching
public interface repository node contents return an input stream public input stream get input stream return the properties public properties get properties release resources close any cached open stream public void release
repository node contents is used to obtain properties and input stream
public void create node location ensure current info loaded if node root file exists logger debug3 creating root directory for cus url if node root file mkdirs throw new lockss repository repository state exception mkdirs node root file failed for node root file
creates the directory for the node location if non existent
public long get repo disk usage string repo au path boolean calc if unknown lockss repository repo get repository from path repo au path if repo null try repository node repo node repo get node au cached url set spec url if repo node instanceof au node impl return au node impl repo node get disk usage calc if unknown catch malformed urlexception ignore return 1
return the disk space used by the au including all overhead
public void queue size calc archival unit au queue size calc au util get au repo node au
engqueue a size calculation for the au
public void queue size calc repository node node synchronized size calc queue if size calc queue add node log debug2 queue size calc node start or kick thread
engqueue a size calculation for the node
public mail message add header string name string val try msg add header name val catch messaging exception e throw new runtime exception couldn t add header name val e return this
add a header value
public string get header string name try return msg get header name catch messaging exception e throw new runtime exception couldn t get header e
return value of header comma separated if more than one
public mime message add text part string text try mime body part text part new mime body part text part set content text text plain parts add body part text part catch messaging exception e throw new runtime exception couldn t add text part e return this
add a text part to the message
public void write data output stream ostrm throws ioexception try if msg get line count 0 finish msg write to ostrm catch messaging exception e throw new runtime exception write data e catch ioexception e throw new runtime exception write data e
write the message content rfc822 data to the stream
public void flush smtp data throws ioexception if done return ensure ending crlf if prev n prev r out write r out write n out write out write r out write n done true
finish writing the data write terminating newline dot newline
private void send string msg if log is debug3 log debug3 send msg server output print msg server output print r n server output flush
send a line
public string get name return member
return the member name
public void set full text cu cached url cu full text cu cu
set the primary full text url
public cached url get full text cu return full text cu
get the primary full text cu
public string get full text url return url or null full text cu
get the primary full text url
public void set role cu string key cached url cu roles put key cu
set the cached url associated with an article role
public cached url get role cu string key return cached url roles get key
get the cu associated with the role
public void set role string string key string str roles put key str
set the string associated with an article role
public string get role string string key return string roles get key
get the string associated with the role
public void set role string key object obj roles put key obj
set the object associated with an article role
public object get role string key return roles get key
get the object associated with the role