public static void main ( String [ ] args ) { if ( args . length != 0 ) { LOG . info ( "java -cp {} {}" , RuntimeConstants . ALLUXIO_JAR , AlluxioWorker . class . getCanonicalName ( ) ) ; System . exit ( - 1 ) ; } if ( ! ConfigurationUtils . masterHostConfigured ( ServerConfiguration . global ( ) ) ) { ProcessUtils . fatalError ( LOG , ConfigurationUtils . getMasterHostNotConfiguredMessage ( "Alluxio worker" ) ) ; } CommonUtils . PROCESS_TYPE . set ( CommonUtils . ProcessType . WORKER ) ; MasterInquireClient masterInquireClient = MasterInquireClient . Factory . create ( ServerConfiguration . global ( ) ) ; try { RetryUtils . retry ( "load cluster default configuration with master" , ( ) -> { InetSocketAddress masterAddress = masterInquireClient . getPrimaryRpcAddress ( ) ; ServerConfiguration . loadClusterDefaults ( masterAddress ) ; } , RetryUtils . defaultWorkerMasterClientRetry ( ServerConfiguration . getDuration ( PropertyKey . WORKER_MASTER_CONNECT_RETRY_TIMEOUT ) ) ) ; } catch ( IOException e ) { ProcessUtils . fatalError ( LOG , "Failed to load cluster default configuration for worker: %s" , e . getMessage ( ) ) ; } WorkerProcess process = WorkerProcess . Factory . create ( ) ; ProcessUtils . run ( process ) ; }
Starts the Alluxio worker .