Package titan
Class Main
java.lang.Object
titan.Main
The main entry point for the Titan distributed system application.
This class allows the application to be started in one of two primary modes:
- SCHEDULER: Runs the Titan Scheduler component, responsible for coordinating tasks and resources.
- WORKER: Runs a Titan Worker component, which executes tasks assigned by the Scheduler.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidThe main method, serving as the application's entry point.private static voidPrints the correct command-line usage instructions for running the Titan application.
-
Constructor Details
-
Main
public Main()
-
-
Method Details
-
main
The main method, serving as the application's entry point. It parses command-line arguments to determine whether to start the Titan application as a Scheduler or a Worker, and initializes the respective components with the provided parameters. If no arguments are provided or an unknown mode is specified, it prints usage instructions.- Parameters:
args- Command-line arguments specifying the operational mode and configuration parameters. Expected formats:SCHEDULER [port]: Starts the Scheduler. `port` is optional, defaults to 9090.WORKER [myPort] [schedHost] [schedPort] [capability] [isPermanent]: Starts a Worker. `myPort` is optional, defaults to 8081. `schedHost` is optional, defaults to "localhost". `schedPort` is optional, defaults to 9090. `capability` is optional, defaults to "GENERAL". `isPermanent` is optional, defaults to false, indicating if the worker should re-register on disconnect.
-
printUsage
private static void printUsage()Prints the correct command-line usage instructions for running the Titan application. This method is called when no arguments are provided or an invalid mode is specified, guiding the user on how to start the application in SCHEDULER or WORKER mode with their respective parameters.
-