public static void main(String[] args) throws Exception { final String app = "master"; ServerOpts opts = new ServerOpts(); opts.parseArgs(app, args); ServerContext context = new ServerContext(opts.getSiteConfiguration()); context.setupServer(app, Master.class.getName(), opts.getAddress()); try { Master master = new Master(context); master.run(); } finally { context.teardownServer(); } }
public static void main(String[] args) { final String app = "gc"; Opts opts = new Opts(); opts.parseArgs(app, args); ServerContext context = new ServerContext(opts.getSiteConfiguration()); context.setupServer(app, SimpleGarbageCollector.class.getName(), opts.getAddress()); try { SimpleGarbageCollector gc = new SimpleGarbageCollector(opts, context); gc.run(); } finally { context.teardownServer(); } }
public static void main(String[] args) { final String app = "monitor"; ServerOpts opts = new ServerOpts(); opts.parseArgs(app, args); Monitor.context = new ServerContext(opts.getSiteConfiguration()); context.setupServer(app, Monitor.class.getName(), opts.getAddress()); try { config = context.getServerConfFactory(); Monitor monitor = new Monitor(); // Servlets need access to limit requests when the monitor is not active, but Servlets are // instantiated via reflection. Expose the service this way instead. Monitor.HA_SERVICE_INSTANCE = monitor; monitor.run(); } finally { context.teardownServer(); } }
public static void main(String[] args) throws Exception { final String app = "tserver"; ServerOpts opts = new ServerOpts(); opts.parseArgs(app, args); ServerContext context = new ServerContext(opts.getSiteConfiguration()); context.setupServer(app, TabletServer.class.getSimpleName(), opts.getAddress()); context.setupCrypto(); try { final TabletServer server = new TabletServer(context); if (UserGroupInformation.isSecurityEnabled()) { UserGroupInformation loginUser = UserGroupInformation.getLoginUser(); loginUser.doAs((PrivilegedExceptionAction<Void>) () -> { server.run(); return null; }); } else { server.run(); } } finally { context.teardownServer(); } }