input stringlengths 10 828 | output stringlengths 5 107 |
|---|---|
public void run log info starting data node in data start data xceive server data xceive server start while should run try offer service catch exception ex log error exception string utils stringify exception ex if should run try thread sleep 5000 catch interrupted exception ie wait for data xceive server to terminate try this data xceive server join catch interrupted exception ie log info finishing data node in data | no matter what kind of exception we get keep retrying to offer service |
public boolean rename utf8 src utf8 dst throws ioexception check open return namenode rename src to string dst to string | make a direct connection to namenode and manipulate structures |
public boolean delete utf8 src throws ioexception check open return namenode delete src to string | make a direct connection to namenode and manipulate structures |
public file get fs image name throws ioexception return namesystem get fs image name | returns the name of the fs image file |
public file get fs edit name throws ioexception return namesystem get fs edit name | returns the name of the edits file |
public void localize configuration job conf conf throws ioexception super localize configuration conf conf set num map tasks num maps | localize the given job conf to be specific for this task |
private void purge task task in progress tip throws ioexception if tip null log info about to purge task tip get task get task id remove the task from running jobs removing the job if it s the last task remove task from job tip get task get job id tip tip job has finished | remove the tip and update all relevant state |
private datanode info best node datanode info nodes tree set dead nodes throws ioexception if nodes null for int i 0 i nodes length i if dead nodes contains nodes i return nodes i throw new ioexception no live nodes contain current block | pick the best node from which to stream the data |
private void add to invalidates block b datanode info n collection block invalidate set recent invalidate sets get n get storage id if invalidate set null invalidate set new array list block recent invalidate sets put n get storage id invalidate set invalidate set add b | adds block to list of blocks which will be invalidated on |
private void remove marked tasks string task tracker purge all the marked tasks which were running at task tracker tree set string marked task set tree set string tracker to marked tasks map get task tracker if marked task set null for string taskid marked task set remove task entry taskid log info removed completed task taskid from task tracker clear tracker to marked tasks map remove task tracker | remove all marked tasks running on a given |
public void update metrics counters counters get counters for string group name counters get group names counters group group counters get group group name job metrics set tag group group get display name for string counter group get counter names long value group get counter counter job metrics set tag counter group get display name counter job metrics set metric value float value job metrics update | called periodically by job tracker metrics to update the metrics for |
private void kill overflowing tasks throws ioexception if enough free space min space kill accept new tasks false we give up do not accept new tasks until all the ones running have finished and they re all cleared up synchronized this task in progress kill me find task to kill if kill me null string msg tasktracker running out of space killing task log info kill me get task get task id msg kill me report diagnostic info msg purge task kill me | check if were dangerously low on disk space |
private boolean enough free space long min space throws ioexception if min space 0 return true string local dirs f conf get local dirs for int i 0 i local dirs length i df df null if local dirs df contains key local dirs i df df local dirs df get local dirs i else df new df new file local dirs i f conf local dirs df put local dirs i df if df get available min space return false return true | check if all of the local directories have enough |
public void run while true try map output location loc null long size 1 synchronized scheduled copies while scheduled copies is empty scheduled copies wait loc map output location scheduled copies remove 0 try start loc size copy output loc catch ioexception e log warn reduce task get task id copy failed loc get map task id from loc get host log warn string utils stringify exception e finally finish size catch interrupted exception e return all done catch throwable th log error map output copy failure string utils stringify exception th | loop forever and fetch map outputs as they become available |
public void set map output compression type sequence file compression type style set map output compression type style to string | set the compression type for the map outputs |
public void set map output compressor class class codec class set compress map output true set class mapred output compression codec codec class compression codec class | set the given class as the compression codec for the map outputs |
public int get max tasks return max tasks | the maximum capacity for running tasks in the cluster |
public class get map output compressor class class default value string name get mapred output compression codec if name null return default value else try return get class by name name catch class not found exception e throw new illegal argument exception compression codec name was not found e | get the codec for compressing the map outputs |
public vector report tasks in progress boolean should be map boolean should be complete vector results new vector task in progress tips null if should be map tips maps else tips reduces for int i 0 i tips length i if tips i is complete should be complete results add tips i return results | return a treeset of completed task in progress objects |
public class get map output key class class retv get class mapred mapoutput key class null writable comparable class if retv null retv get output key class return retv | get the key class for the map output data |
public void set map output key class class the class set class mapred mapoutput key class the class writable comparable class | set the key class for the map output data |
public counters get counters return counters sum get map counters get reduce counters | returns the total job counters by adding together the map and the |
public class get map output value class class retv get class mapred mapoutput value class null writable class if retv null retv get output value class return retv | get the value class for the map output data |
private counters sum task counters task in progress tips counters counters new counters for task in progress tip tips counters incr all counters tip get counters return counters | returns a counters instance representing the sum of all the counters in |
public boolean expired hard limit if now last update lease hardlimit period return true return false | returns true if the hard limit timer has expired |
public void set map output value class class the class set class mapred mapoutput value class the class writable class | set the value class for the map output data |
public void close throws ioexception get task get progress set status closed this map output file remove all get task get task id | delete all of the temporary map output files |
public boolean expired soft limit if now last update lease softlimit period return true return false | returns true if the soft limit timer has expired |
public counters get counters throws ioexception return job submit client get job counters get job id | returns the counters for this job |
public string get display name return localize counter group name group name | returns localized name of the group |
public string get display name string counter return localize counter name counter | returns localized name of the specified counter |
public long get counter string counter long result group counters get counter return result null 0 l result | returns the value of the specified counter or 0 if the counter does |
public int size return group counters size | returns the number of counters in this group |
public datanode info get current datanode return dfsinput stream in stream get current datanode | returns the datanode from which the stream is currently reading |
public void log log log log info counters size collection string group names get group names for string group name group names group group get group group name log info group get display name for string counter name group get counter names log info group get display name counter name group get counter counter name | logs the current counter values |
public block get current block return dfsinput stream in stream get current block | returns the block containing the target position |
public task in progress get task in progress string tipid for int i 0 i maps length i if tipid equals maps i get tipid return maps i for int i 0 i reduces length i if tipid equals reduces i get tipid return reduces i return null | return the task in progress that matches the tipid |
public boolean get speculative execution return get boolean mapred speculative execution true | should speculative execution be used for this job |
public void remove all string task id throws ioexception conf delete local files task id | removes all of the files related to a task |
public void cleanup storage throws ioexception conf delete local files | removes all contents of temporary storage |
public void set speculative execution boolean new val set boolean mapred speculative execution new val | turn on or off speculative execution for this job |
public boolean prepare throws ioexception if super prepare return false this map output file remove all get task get task id return true | delete any temporary files from previous failed attempts |
public void close throws ioexception log info get task done removing files this map output file remove all get task get task id | delete all of the temporary map output files |
public void set run state int state this run state state | change the current run state of the job |
public long get total log size throws ioexception if initialized init return log file size | return the total logical log size written by the task including |
public raw key value iterator sort merge sort m new merge sort this int count super count if count 0 return null int pointers int super pointers int pointers copy new int count system arraycopy pointers 0 pointers copy 0 count m merge sort pointers pointers copy 0 count return new mrsort result iterator super key val buffer pointers copy super start offsets super key lengths super value lengths | the sort method derived from basic type sorter base and overridden here |
public int compare int writable i int writable j return super compare i get j get | the implementation of the compare method from comparator |
public string get job id return jobid | get the job id |
public url get url try return new url url to string catch ioexception ie return null | get the link to the web ui for details of the job |
private string make unique string string unique base string buffer result new string buffer result append unique base if is map task result append m else result append r result append id format format partition return result to string | make a unique name for this tip |
public void set mapred job id string mapred job id this job id mapred job id | set the mapred id for this job |
public string get tipid return this id | return an id for this task not its component taskid threads |
public boolean is map task return split null | whether this is a map task |
public boolean is complete return completes 0 | is this tip complete |
public boolean is complete string taskid task status status task status task statuses get taskid if status null return false return completes 0 status get run state task status state succeeded | is the given taskid in this tip complete |
private void check running state running job running null try running jc get job this mapred job id if running is complete if running is successful this state job success else this state job failed this message job failed try running kill job catch ioexception e1 try this jc close catch ioexception e2 catch ioexception ioe this state job failed this message string utils stringify exception ioe try running kill job catch ioexception e1 try this jc close catch ioexception e1 | check the state of this running job |
public void submit try if the job conf get boolean create empty dir if nonexist false file system fs file system get the job conf path input paths the job conf get input paths for int i 0 i input paths length i if fs exists input paths i try fs mkdirs input paths i catch ioexception e running job running jc submit job the job conf this mapred job id running get job id this state job running catch ioexception ioe this state job failed this message string utils stringify exception ioe | submit this job to mapred |
public void commit throws ioexception for path f path final name to file info key set commit f path false safe to clear map now final name to file info clear | commits files to their final locations as passed in create methods |
protected void set phase task status phase p this phase p | set current phase of the task |
public void abort path p throws ioexception abort p true | aborts a single file |
public void run try map pair to output multithreaded map runner this mapper map key value output reporter catch ioexception ex if there is an ioexception during the call it is set in an instance variable of the multithreaded map runner from where it will be rethrown synchronized multithreaded map runner this if multithreaded map runner this io exception null multithreaded map runner this io exception ex | executes a mapper |
public void localize configuration job conf conf throws ioexception conf set mapred tip id tip id conf set mapred task id task id conf set boolean mapred task is map is map task conf set int mapred task partition partition conf set mapred job id job id | localize the given job conf to be specific for this task |
public void abort throws ioexception for path f path final name to file info key set abort f path false safe to clean now final name to file info clear | aborts the file creation all uncommitted files created by this phased file system |
public boolean should close for closed job string taskid if the thing has never been closed and it belongs to this tip and this tip is somehow finished then true task status ts task status task statuses get taskid if ts null tasks reported closed contains taskid job get status get run state job status running tasks reported closed add taskid return true else if is map task is complete tasks reported closed contains taskid tasks reported closed add taskid return true else return false | returns whether a component task thread should be |
private task in progress get tip string jobid string tipid job in progress job job in progress jobs get jobid return job null null task in progress job get task in progress tipid | returns specified task in progress or null |
public void completed string taskid record that this taskid is complete completed task taskid now that the tip is complete the other speculative subtasks will be closed when the owning tasktracker reports in and calls should close on this object this completes recompute progress | indicate that one of the taskids in this task in progress |
public task status get task status string taskid return task statuses get taskid | get the status of the specified task |
private void internal release create utf8 src utf8 holder file under construction v pending creates remove src if v null name node state change log debug dir name system internal release create src is removed from pending creates for holder failure for iterator block it2 v get blocks iterator it2 has next block b it2 next pending create blocks remove b else name node state change log warn dir name system internal release create attempt to release a create lock on src to string that was not in peding creates | release a pending file creation lock |
public boolean has failed on machine string tracker return machines where failed contains tracker | has this task already failed on this machine |
public boolean has run on machine string tracker return this active tasks values contains tracker has failed on machine tracker | was this task ever scheduled to run on this machine |
public void renew lease utf8 holder throws ioexception synchronized leases if is in safe mode throw new safe mode exception cannot renew lease for holder safe mode lease lease leases get holder if lease null sorted leases remove lease lease renew sorted leases add lease | renew the lease s held by the given client |
public string get registration id return ns integer to string dir namespace id | get registration id for datanodes based on the namespace id |
private void proccess over replicated block block block short replication collection datanode descriptor containing nodes blocks map get block if containing nodes null return collection datanode descriptor non excess new array list datanode descriptor for iterator datanode descriptor it containing nodes iterator it has next datanode descriptor cur it next collection block excess blocks excess replicate map get cur get storage id if excess blocks null excess blocks contains block if cur is decommission in progress cur is decommissioned non excess add cur choose excess replicates non excess block replication | find how many of the containing nodes are extra if any |
public long total capacity synchronized heartbeats return total capacity | total raw bytes |
public long total remaining synchronized heartbeats return total remaining | total non used raw bytes |
public int total load synchronized heartbeats return total load | total number of connections |
private boolean check decommission state internal datanode descriptor node check to see if there are all blocks in this decommisioned node has reached their target replication factor if node is decommission in progress if is replication in progress node node set decommissioned log info decommission complete for node node name if node is decommissioned return true return false | change if appropriate the admin state of a datanode to |
public void cleanup throws ioexception close if preserve input fs delete segment path name | the default cleanup |
public datanode descriptor get datanode by name string name throws ioexception for iterator datanode descriptor it datanode map values iterator it has next datanode descriptor node it next if node get name equals name return node return null | find data node by its name |
private datanode info get datanode by index int index int i 0 for iterator datanode descriptor it datanode map values iterator it has next datanode info node it next if i index return node i return null | stop at and return the datanode at index used for content browsing |
public boolean is neighbor dt triangle triangle int count 0 for pnt vertex this if triangle contains vertex count return count 1 | true iff triangles are neighbors |
public triangulation dt triangle triangle tri graph new graph dt triangle tri graph add triangle most recent triangle | all sites must fall within the initial triangle |
public dt triangle neighbor opposite pnt site dt triangle triangle if triangle contains site throw new illegal argument exception bad vertex not in triangle for dt triangle neighbor tri graph neighbors triangle if neighbor contains site return neighbor return null | report neighbor opposite the given vertex of triangle |
public void delaunay place pnt site uses straightforward scheme rather than best asymptotic time locate containing triangle dt triangle triangle locate site give up if no containing triangle or if site is already in dt if triangle null throw new illegal argument exception no containing triangle if triangle contains site return determine the cavity and update the triangulation set dt triangle cavity get cavity site triangle most recent update site cavity | place a new site into the dt |
private int find max2 d int list int size1 int val list 0 0 for int i 0 i size1 i for int j 0 j size1 j if list i j val val list i j return val | maximum of an 2 d array |
public void evaluate cds for int i 0 i nodes array size i nodes array get i set dominator has two unconnected neighbors nodes array get i if is all unmarked as dominator nodes array get nodes array size 1 set dominator true else prune rule1 prune rule2 init dominator neighborhood attach dominees to closest dominators | evaluates minimum connected dominating set of the run |
private boolean is all unmarked as dominator for int i 0 i nodes array size i if nodes array get i is dominator return false return true | the algorithm we used to calculate cds is a distributed approach |
private void init dominator neighborhood array list gateway dominator list new array list gateway gateway tmp for int k 0 k nodes array size k if nodes array get k is dominator tmp nodes array get k dominator list add tmp for int i 0 i dominator list size i for int j 0 j dominator list size j if i j gateway ptr1 ptr1 dominator list get i gateway ptr2 ptr2 dominator list get j if is neighbor ptr1 ptr2 dominator list get i get neighbor dominator list add dominator list get j | connects neighbor dominators |
public boolean add message message m return add message m false | if the inbox contains the message m ignore it |
public message get next unread message if ptr message messages size message message messages get ptr message message mark as read ptr message return message else return null | retrieves next unread message |
public void empty messages clear | clears the message box |
private int find numberof cut vertices int result 0 for int i 0 i relay node array size i gateway gateway relay node array get i if is cut vertex gateway result return result | only looks at the relay network |
private void set edge pruned hash map edge integer pruned edge edge for edge edge1 pruned key set if edge u edge1 u edge v edge1 v edge u edge1 v edge v edge1 u pruned put edge1 1 | old version but still has some usages |
public void add url filter iurl filter filter f includes filters add filter | adds a new filter to this composite |
public void remove url filter iurl filter filter f includes filters remove filter | removes the given filter from this composite |
protected void copy children file dir throws ioexception file array dir list files if array null iwrf resource provider provider f resource get provider page link path f resource get path string type f resource get type for file child array page link child path path append path child get name iwrf resource child resource provider get resource type child path file adapter child adapter child resource get adapter file adapter class child adapter copy from child true | recursively copies all children of the specified directory in |
private void set metadata file file throws ioexception iproperty adapter properties f resource get adapter iproperty adapter class long date file last modified string formatted date date util format date date properties set property last modified formatted date | copies the metadata about the specified file in the properties of this |
public void write xhtml output stream out throws ioexception final output stream writer writer new output stream writer out utf 8 write xhtml1 writer | writes out the xhtml representation of the underlying resource in the |
protected string filter uri site url uri return uri to string | this method filters the representation of the given url and returns it |
private void normalize attributes named node map attributes if attributes null return for int i attributes get length 1 i 0 i attr attr attr attributes item i string name attr get name name name to lower case if style equals name name starts with on attributes remove named item name | normalizes attributes from the given map |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.