public static void main(String[] args) throws Exception {
  try {
    SamzaRestConfig config=parseConfig(args);
    SamzaRestService restService=new SamzaRestService(config);
    SamzaRestApplication samzaRestApplication=new SamzaRestApplication(config);
    ServletContainer container=new ServletContainer(samzaRestApplication);
    restService.addServlet(container,"/*");
    ScheduledExecutorService schedulingService=Executors.newScheduledThreadPool(1);
    ScheduledExecutorSchedulingProvider schedulingProvider=new ScheduledExecutorSchedulingProvider(schedulingService);
    SamzaMonitorService monitorService=new SamzaMonitorService(config,new NoOpMetricsRegistry(),schedulingProvider);
    monitorService.start();
    restService.runBlocking();
    monitorService.stop();
  }
 catch (  Throwable t) {
    log.error("Exception in main.",t);
  }
}

public static void main ( String [ ] args ) throws Exception { try { SamzaRestConfig config = parseConfig ( args ) ; SamzaRestService restService = new SamzaRestService ( config ) ; SamzaRestApplication samzaRestApplication = new SamzaRestApplication ( config ) ; ServletContainer container = new ServletContainer ( samzaRestApplication ) ; restService . addServlet ( container , "/*" ) ; ScheduledExecutorService schedulingService = Executors . newScheduledThreadPool ( 1 ) ; ScheduledExecutorSchedulingProvider schedulingProvider = new ScheduledExecutorSchedulingProvider ( schedulingService ) ; SamzaMonitorService monitorService = new SamzaMonitorService ( config , new NoOpMetricsRegistry ( ) , schedulingProvider ) ; monitorService . start ( ) ; restService . runBlocking ( ) ; monitorService . stop ( ) ; } catch ( Throwable t ) { log . error ( "Exception in main." , t ) ; } }
command line interface to run the server .
