Dicop::Data::Job

Dicop::Data::Job is a job in the Dicop system.
Download

Dicop::Data::Job Ranking & Summary

Advertisement

  • Rating:
  • License:
  • GPL
  • Price:
  • FREE
  • Publisher Name:
  • Bundesamt fr Sicherheit in der Informationstechnik
  • Publisher web site:
  • http://search.cpan.org/~bsi/Dicop-Server-3.04/lib/Dicop/Data.pm

Dicop::Data::Job Tags


Dicop::Data::Job Description

Dicop::Data::Job is a job in the Dicop system. Dicop::Data::Job is a job in the Dicop system.CHUNK LISTThe chunk list contains all the chunks that make up the key/password room of the job.Each chunk can have a status of ISSUED, DONE, TOBEDONE, SOLVED, or FAILED.Apart from creation, there are only two events that will change the chunklist.Client RequestWhen a client requests a piece of work, the following things will happen:Conversion to TOBEDONE Any chunk that is FAILED or ISSUED for too long will be converted to TOBEDONE so that it can be issued to a client again.Finding an appropriate sized TOBEDONE chunk The list is then searched for a chunk that fit's the clients wish for amount of work best. If the best fitting chunk is actually more than twice what the client requested, the chunk is split into two parts, and the smaller part is taken. If the chunk is smaller, it is used nonetheless to prevent small chunks from lingering in the system indefinitely.Thus due to a client request the chunk list may grow by zero or one chunk, which will always be of the type TOBEDONE.Client Returns ChunkThe chunk the client reported back is setto SOLVED, FAILED or DONE, depending on what the client reported.When the chunk is set to DONE, it will be tried to be merged with the chunk before and after it.Thus returning a DONE chunk may shrink the chunk list by 0-2 chunks. Returning a FAILED or SOLVED chunk will not shrink or grow the chunk list.The chunk list will be kept at the minimum size by this mechanism. The only way it could grow is by one client requesting lots of chunks without returning them. This is prevented by the server via a maximum number of chunks per client.For performance reasons the reporting back of a chunk will only look at this chunk and it's two neighbours. The algorithm to find a chunk for a client will only look as far as it needs to find a suitable chunk.CLOSING A JOB ^A job will be closed (set to STOPPED) when one of the following occurs:Solution found When a solution is found, and the jobs flags don't permit it running after that (e.g. you want only one solution).No more open chunks When there are no more open (ISSUED, FAILED or TOBEDONE) chunks. This is only checked at the time of finding a chunk to be issued to a client.METHODS ^extra_files() @files = $job->extra_files($architecture);Return list of extra filenames necc. for this job, including files neccessary due to the jobtype this job has.extra_fields() $txt = $job->extra_fields();If the jobtype for that job mandates extra fields, will return a text listing them in the following format: extra0=username,Biffy Baff extra1=nose,redThe strings are converted to hex like "444546,303132".This routine is used to include them into the chunk description file.extra_params() $txt = $job->extra_params();If the jobtype for that job mandates extra fields, will return a text listing them in the following format: username_Biffy+Baff;nose_redThis is suitable for returning them as a Dicop::Request.flush() $job->flush($base_dir):Write the chunk list of the job to the disk.check()Check internal data structures like the chunklist, and in case of error, return this error. Undef for "ok".chunk()Return the Nth chunk.chunks()Return number of chunks with a certain status. If no argument is given, returns number if all chunks.charset()Returns the jobs charset as a Math::String::Charset object.is_running()Returns true if the job is currently running, e.g. not suspended or done.status()Return status code of job.results()Return number of results.get_chunk()Return a chunk by it's id. This does also look in the checklist, so it will always return any chunk in the job, not only the "normal" ones.get_chunk_nr()Return a chunk's index number by it's id.report_chunk() $job->report_chunk($chunk,$took);Report a chunk back from a client, increase the results counter. Does not merge or split chunks, because the size of the chunk is needed later on.If the chunk was in the checklist, and is finally DONE, it will be removed from the checklist.merge_chunks()Given a chunk number (Nth chunk in array), tries to merge the next and previous chunks with that chunk until no longer both the next and the previous chunk are DONE.Returns number of merging operations (aka deleted chunks).size()Return jobs size (aka key-room size) as Math::BigInt.percent_done()Return the percent of already done keys in this job as float with two digits after the dot. See also keys_done.keys_todo()Return the number of keys still todo in this job as a big integer. See also percent_done and keys_done.keys_done()Return the number of already done keys in this job as a big integer. See also percent_done.find_chunk()Given a client's speed value, try to find a suitable chunk for him. If we find a chunk that's too big, split it in two smaller pieces. The first slice will match the speed of the client.As we walk the list, we will also convert ISSUED chunks to DONE, when they are over their age. When the job has no more chunks that are ISSUED, TOBEDONE or FAILED, it will be closed (set to DONE).This is _HOT_ code, and executed for nearly each client request. OTOH, walking a list of 10.000 chunks takes currently less time than the final splitting of the chunk.checklist() my $count = $job->checklist();Return number of chunks currently in checklist.checklist_empty()Clears the check list (empties it).new_chunk_id() $chunk->{id} = $self->new_chunk_id();Create a new, unique ID for a new chunk.check_also() $job->check_also($chunk);Makes a copy of the chunk (which contained a result), gives it a unique (for this job) ID, and adds it to the checklist.The new chunk's status is also set to TOBEDONE, also a flag telling that this chunk is part of the checklist is set.Returns reference to the new chunk.Requirements:· Perl Requirements: · Perl


Dicop::Data::Job Related Software