Constructor and Description |
---|
PolyglotStewardAMQ()
Class constructor.
|
PolyglotStewardAMQ(boolean START)
Class constructor.
|
Modifier and Type | Method and Description |
---|---|
String |
checkin(String host,
int job_id,
String result)
Update status of job task (TODO: needs to do some checks to ensure validity of result!)
|
void |
close()
Close anything that needs to be closed.
|
String |
convert(String input,
String output_path,
String output_format)
Convert a files format.
|
String |
convert(String application,
String input,
String output_path,
String output_format)
Convert a files format.
|
String |
convertAndEmail(int job_id,
String input,
String output_path,
String output_format,
String email)
Convert a files format and email result.
|
String |
convertAndEmail(int job_id,
String application,
String input,
String output_path,
String output_format,
String email)
Convert a files format and email result.
|
String |
convertAndEmail(String input,
String output_path,
String output_format,
String email)
Convert a files format and email result.
|
String |
convertAndEmail(String application,
String input,
String output_path,
String output_format,
String email)
Convert a files format and email result.
|
void |
discoveryAMQ_pull()
Discover Software Servers consuming on the given RabbitMQ bus (adds them to I/O-graph).
|
void |
discoveryAMQ_push()
Discover Software Servers pushing info to a seperate regristration RabbitMQ bus (adds them to I/O-graph).
|
IOGraph<String,String> |
getDistributedInputOutputGraph()
Get a string only version of this IOGraph encoded with host machines.
|
IOGraph<String,String> |
getInputOutputGraph()
Get the available inputs, outputs, and conversions.
|
TreeSet<String> |
getInputs()
Get the inputs available.
|
TreeSet<String> |
getInputs(String output)
Get the inputs available for the given output type.
|
TreeSet<String> |
getOutputs()
Get the outputs available.
|
TreeSet<String> |
getOutputs(String input)
Get the outputs available for the given input type.
|
TreeSet<String> |
getOutputs(String input,
int n)
Get the outputs available for the given input type.
|
TreeSet<String> |
getOutputs(TreeSet<String> inputs)
Get the common outputs available for the given input types.
|
Vector<String> |
getServers()
Get a list of connected software servers.
|
TreeSet<String> |
getSoftware()
Get the software available.
|
TreeSet<String> |
getSoftwareHosts()
Get the software available, with the hosts they run on.
|
void |
heartbeat_pull()
Checks on Software Servers to see if they are still alive by hitting their 'alive' andpoint (removes them from I/O-graph if not).
|
void |
heartbeat_push()
Checks on Software Servers leaving heartbeats on the regristration queue to see if they are still alive (removes them from I/O-graph if not).
|
int |
incrementAndGetJobID()
Atomically increase current value of job_counter by one and return new jobid
|
void |
loadConfiguration(String filename)
Initialize based on parameters within the given configuration file.
|
static void |
main(String[] args)
Start the Polyglot Steward.
|
void |
process_jobs()
Process jobs pending in mongo.
|
static void |
purgeJobs()
Purge current and previous jobs.
|
static com.fasterxml.jackson.databind.JsonNode |
queryEndpoint(String url)
Query an endpoint.
|
void |
run()
The main thread.
|
void |
setAuthentication(String username,
String password)
Set the username and password to use when others communicate back to polyglot.
|
void |
setJobCounter(String path)
Set job counter based on a previous execution.
|
void |
start()
Start the main thread (as a separate function so can be called externally, e.g.
|
convertLater, waitOnPending
public PolyglotStewardAMQ()
public PolyglotStewardAMQ(boolean START)
START
- start immediatelypublic int incrementAndGetJobID()
incrementAndGetJobID
in class Polyglot
public void loadConfiguration(String filename)
filename
- the file name of the configuration filepublic void start()
public TreeSet<String> getSoftware()
getSoftware
in class Polyglot
public TreeSet<String> getSoftwareHosts()
public TreeSet<String> getOutputs()
getOutputs
in class Polyglot
public TreeSet<String> getOutputs(String input)
getOutputs
in class Polyglot
input
- the input typepublic TreeSet<String> getOutputs(String input, int n)
getOutputs
in class Polyglot
input
- the input typen
- the maximum number of hopspublic TreeSet<String> getOutputs(TreeSet<String> inputs)
getOutputs
in class Polyglot
inputs
- the input typespublic TreeSet<String> getInputs(String output)
public IOGraph<String,String> getInputOutputGraph()
getInputOutputGraph
in class Polyglot
public String convert(String input, String output_path, String output_format)
public String convert(String application, String input, String output_path, String output_format)
public String convertAndEmail(String input, String output_path, String output_format, String email)
convertAndEmail
in class Polyglot
input
- the absolute name of the input fileoutput_path
- the output pathoutput_format
- the output formatemail
- address to send result topublic String convertAndEmail(int job_id, String input, String output_path, String output_format, String email)
convertAndEmail
in class Polyglot
input
- the absolute name of the input fileoutput_path
- the output pathoutput_format
- the output formatemail
- address to send result topublic String convertAndEmail(String application, String input, String output_path, String output_format, String email)
convertAndEmail
in class Polyglot
application
- the specific application to useinput
- the absolute name of the input fileoutput_path
- the output pathoutput_format
- the output formatemail
- address to send result topublic String convertAndEmail(int job_id, String application, String input, String output_path, String output_format, String email)
convertAndEmail
in class Polyglot
application
- the specific application to useinput
- the absolute name of the input fileoutput_path
- the output pathoutput_format
- the output formatemail
- address to send result topublic Vector<String> getServers()
getServers
in class Polyglot
public IOGraph<String,String> getDistributedInputOutputGraph()
getDistributedInputOutputGraph
in class Polyglot
public void close()
public void setJobCounter(String path)
path
- the artifact path to examine for previous job IDspublic void setAuthentication(String username, String password)
public void discoveryAMQ_pull()
public void discoveryAMQ_push()
public void heartbeat_pull()
public void heartbeat_push()
public void process_jobs()
public String checkin(String host, int job_id, String result)
host
- the host checking in (should be a Software Server)job_id
- the job id being worked onpublic static com.fasterxml.jackson.databind.JsonNode queryEndpoint(String url)
url
- the URL of the endpointpublic static void purgeJobs()
public static void main(String[] args)
args
- command line argumentsCopyright © 2021. All rights reserved.