public static void main(String [] args) throws Exception { LOG.info("***** STARTING service '" + ThriftServer.class.getSimpleName() + "' *****"); VersionInfo.logVersion(); final Configuration conf = HBaseConfiguration.create(); // for now, only time we return is on an argument error. final int status = ToolRunner.run(conf, new ThriftServer(conf), args); LOG.info("***** STOPPING service '" + ThriftServer.class.getSimpleName() + "' *****"); System.exit(status); } }
protected ThriftServer createThriftServer() { return new ThriftServer(TEST_UTIL.getConfiguration()); }
protected ThriftServer createThriftServer() { return new ThriftServer(TEST_UTIL.getConfiguration()); }
@Test public void testExceptionThrownWhenMisConfigured() throws Exception { Configuration conf = new Configuration(TEST_UTIL.getConfiguration()); conf.set("hbase.thrift.security.qop", "privacy"); conf.setBoolean("hbase.thrift.ssl.enabled", false); ThriftServer server = null; ExpectedException thrown = ExpectedException.none(); try { thrown.expect(IllegalArgumentException.class); thrown.expectMessage("Thrift HTTP Server's QoP is privacy, " + "but hbase.thrift.ssl.enabled is false"); server = new ThriftServer(conf); server.run(); fail("Thrift HTTP Server starts up even with wrong security configurations."); } catch (Exception e) { } }
/** * @param args * @throws Exception */ public static void main(String [] args) throws Exception { LOG.info("***** STARTING service '" + ThriftServer.class.getSimpleName() + "' *****"); VersionInfo.logVersion(); int exitCode = 0; try { new ThriftServer(HBaseConfiguration.create()).doMain(args); } catch (ExitCodeException ex) { exitCode = ex.getExitCode(); } LOG.info("***** STOPPING service '" + ThriftServer.class.getSimpleName() + "' *****"); System.exit(exitCode); } }
/** * @param args * @throws Exception */ public static void main(String [] args) throws Exception { LOG.info("***** STARTING service '" + ThriftServer.class.getSimpleName() + "' *****"); VersionInfo.logVersion(); int exitCode = 0; try { new ThriftServer(HBaseConfiguration.create()).doMain(args); } catch (ExitCodeException ex) { exitCode = ex.getExitCode(); } LOG.info("***** STOPPING service '" + ThriftServer.class.getSimpleName() + "' *****"); System.exit(exitCode); } }
/** * @param args * @throws Exception */ public static void main(String [] args) throws Exception { VersionInfo.logVersion(); try { new ThriftServer(HBaseConfiguration.create()).doMain(args); } catch (ExitCodeException ex) { System.exit(ex.getExitCode()); } } }
private void runThriftServer(int customHeaderSize) throws Exception { List<String> args = new ArrayList<>(3); port = HBaseTestingUtility.randomFreePort(); args.add("-" + ThriftServer.PORT_OPTION); args.add(String.valueOf(port)); args.add("start"); thriftServer = new ThriftServer(TEST_UTIL.getConfiguration()); startHttpServerThread(args.toArray(new String[args.size()])); // wait up to 10s for the server to start for (int i = 0; i < 100 && ( thriftServer.serverRunner == null || thriftServer.serverRunner.httpServer == null); i++) { Thread.sleep(100); } try { talkToThriftServer(customHeaderSize); } catch (Exception ex) { clientSideException = ex; } finally { stopHttpServerThread(); } if (clientSideException != null) { LOG.error("Thrift client threw an exception " + clientSideException); if (clientSideException instanceof TTransportException) { throw clientSideException; } else { throw new Exception(clientSideException); } } }
args.add("start"); thriftServer = new ThriftServer(TEST_UTIL.getConfiguration()); startHttpServerThread(args.toArray(new String[args.size()]));
thriftServer = new ThriftServer(TEST_UTIL.getConfiguration()); startCmdLineThread(args.toArray(new String[args.size()]));
thriftServer = new ThriftServer(TEST_UTIL.getConfiguration()); startCmdLineThread(args.toArray(new String[args.size()]));