|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectmyShell.MainClass
public class MainClass
The main class of the Crowd-Powered-Sort program.
This class contains the main method that parses command line arguments to call the right function. It also implements :
Field Summary | |
---|---|
static java.util.List<java.lang.Integer[]> |
allMedia
A list of array containing all the media to sort and the advancement of the sort. |
static Comparator |
comp
The Comparator instance that will perform the SplitSort along each specified axis. |
static java.util.Map<java.lang.String,java.lang.String> |
config
A map containing the data within the config.xml file. |
static MySQLbase |
hitBdd
The MySQLbase instance used to store the job results, both raw and refined. |
static Interpreter |
inter
This Interpreter will read the config.xml file and write the results.xml one. |
static java.lang.Boolean |
keepGoing
Is true if the sort must continue; is false when everything is over. |
static LogWriter |
log
A LogWriter instance used to... write a log file. |
static MediaBase |
mediaBdd
A MediaBase used to store the content of the media.xml file. |
static CrowdManager |
theBoss
The CrowdManager instance supposed to be the interface with Crowdflower and the Antechamber
during the splitsort. |
Constructor Summary | |
---|---|
MainClass()
|
Method Summary | |
---|---|
static void |
displayHelp()
Displays this program's help and exit. |
static void |
generateJob(java.lang.String dbPasswd)
Performs the first half of a quicksort iteration, generates the comparisons it requires and submits them in a new job at CrowdFlower. |
static void |
initialize(java.lang.String dbPasswd)
Initializes the classes necessary for a splitsort iteration and checks whether the sort must go on or not. |
static void |
main(java.lang.String[] args)
Main method of this program. |
static void |
save(java.lang.Boolean finished)
Saves the results, either intermediary ones if finished is false or final ones if it is true. |
static void |
sqlFile()
Creates a .sql file allowing the creation of the database and the tables necessary for CPS. |
static void |
useResults(java.lang.String dbPasswd)
Human made results are downloaded, interpreted, ameliorated and put in the MySQLbase instance
hitBdd allowing the second half of a quicksort iteration to be performed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static LogWriter log
LogWriter
instance used to... write a log file. Isn't it amazing ?
public static java.util.Map<java.lang.String,java.lang.String> config
public static MySQLbase hitBdd
MySQLbase
instance used to store the job results, both raw and refined.
public static MediaBase mediaBdd
MediaBase
used to store the content of the media.xml file.
public static java.util.List<java.lang.Integer[]> allMedia
public static CrowdManager theBoss
CrowdManager
instance supposed to be the interface with Crowdflower and the Antechamber
during the splitsort.
public static Interpreter inter
Interpreter
will read the config.xml file and write the results.xml one.
public static Comparator comp
Comparator
instance that will perform the SplitSort along each specified axis.
public static java.lang.Boolean keepGoing
Constructor Detail |
---|
public MainClass()
Method Detail |
---|
public static void main(java.lang.String[] args)
Parses command line option to launch the right function. If no argument is specified, help is displayed using the displayHelp() method. A description of what is done depending on the command line arguments is given in the body of the displayHelp() method.
args
- Arguments sent using the command line when the program is launched.public static void save(java.lang.Boolean finished)
If the finished parameter is false, then the current state of the splitsort iswritten in as much < axis>.xml files as there are axes, with < axis>'s value going through all the axes considered. Such results are formatted so as to be easily retrieved during the next iteration.
If finished is true, final results are saved in the ../results.xml file. It contains all the information in the media.xml file plus the coordinates of each one of them along each axis. When the file is written, it is sent to the Antechamber using . Such call should only be made when the sort is done.
finished
- If true, write definitive results ; if false, write temporary ones.Interpreter.generateIntermediaryXMLs(String, List)
,
Interpreter.generateFinalXML(String, Map)
,
CrowdManager.thisIsTheEnd(String, String)
public static void initialize(java.lang.String dbPasswd)
In this method, several classes are initialized using the content of the media.xml and config.xml files. They correspond to all of the MainClass attribute.
It also checks whether the sort should go on using the Comparator.notFinished( )
method.
dbPasswd
- The password of the MySQL database used.public static void generateJob(java.lang.String dbPasswd)
dbPasswd
- The password of the database matching the user specified in the config.xml file.public static void useResults(java.lang.String dbPasswd)
MySQLbase
instance
hitBdd allowing the second half of a quicksort iteration to be performed.
public static void sqlFile()
It contains the information necessary to create the hit and results table, each one having the fields necessary for the CPS to work as well as those added in the config.xml file. Each table is creating in a different way:
The file generated is ../data/mysql/createCPStables.sql.
public static void displayHelp()
The appearance of the help displayed is copied from typical UNIX man pages.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |