congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
ThriftServerRunner
Code IndexAdd Tabnine to your IDE (free)

How to use
ThriftServerRunner
in
org.apache.hadoop.hbase.thrift

Best Java code snippets using org.apache.hadoop.hbase.thrift.ThriftServerRunner (Showing top 20 results out of 315)

origin: org.apache.hbase/hbase-thrift

/**
 * Start up or shuts down the Thrift server, depending on the arguments.
 * @param args
 */
 void doMain(final String[] args) throws Exception {
  processOptions(args);
  serverRunner = new ThriftServerRunner(conf);
  // Put up info server.
  int port = conf.getInt("hbase.thrift.info.port", 9095);
  if (port >= 0) {
   conf.setLong("startcode", System.currentTimeMillis());
   String a = conf.get("hbase.thrift.info.bindAddress", "0.0.0.0");
   infoServer = new InfoServer("thrift", a, port, false, conf);
   infoServer.setAttribute("hbase.conf", conf);
   infoServer.start();
  }
  serverRunner.run();
}
origin: co.cask.hbase/hbase

/**
 * Stop ThriftServer
 */
void shutdown() {
 serverRunner.shutdown();
}
origin: co.cask.hbase/hbase

  CallQueue callQueue =
    new CallQueue(new LinkedBlockingQueue<Call>(), metrics);
  ExecutorService executorService = createExecutor(
    callQueue, serverArgs.getWorkerThreads());
  serverArgs.executorService(executorService)
  CallQueue callQueue =
    new CallQueue(new LinkedBlockingQueue<Call>(), metrics);
  ExecutorService executorService = createExecutor(
    callQueue, serverArgs.getWorkerThreads());
  serverArgs.executorService(executorService)
} else if (implType == ImplType.THREAD_POOL) {
 InetAddress listenAddress = getBindAddress(conf);
registerFilters(conf);
origin: co.cask.hbase/hbase

/**
 * Create an instance of the glue object that connects the
 * RegionServer with the standard ThriftServer implementation
 */
HRegionThriftServer(HRegionServer regionServer, Configuration conf)
  throws IOException {
 super("Region Thrift Server");
 this.rs = regionServer;
 this.serverRunner =
   new ThriftServerRunner(conf, new HBaseHandlerRegion(conf));
}
origin: org.apache.hbase/hbase-thrift

public void doTestFilterRegistration() throws Exception {
 Configuration conf = UTIL.getConfiguration();
 conf.set("hbase.thrift.filters", "MyFilter:filterclass");
 ThriftServerRunner.registerFilters(conf);
 Map<String, String> registeredFilters = ParseFilter.getAllFilters();
 assertEquals("filterclass", registeredFilters.get("MyFilter"));
}
origin: org.apache.hbase/hbase-thrift

serverConnector.setHost(getBindAddress(conf).getHostAddress());
httpServer.addConnector(serverConnector);
httpServer.setStopAtShutdown(true);
origin: co.cask.hbase/hbase

@Override
public void run() {
 serverRunner.run();
}
origin: org.apache.hbase/hbase-thrift

            QualityOfProtection.PRIVACY.name()));
checkHttpSecurity(qop, conf);
if (!securityEnabled) {
 throw new IOException("Thrift server must run in secure mode to support authentication");
origin: com.aliyun.hbase/alihbase-thrift

 InetAddress listenAddress = getBindAddress(conf);
 TNonblockingServerTransport serverTransport = new TNonblockingServerSocket(
   new InetSocketAddress(listenAddress, listenPort));
  THsHaServer.Args serverArgs = new THsHaServer.Args(serverTransport);
  CallQueue callQueue = new CallQueue(new LinkedBlockingQueue<>(), metrics);
  ExecutorService executorService = createExecutor(
    callQueue, serverArgs.getMaxWorkerThreads(), serverArgs.getMaxWorkerThreads());
  serverArgs.executorService(executorService)
    new HThreadedSelectorServerArgs(serverTransport, conf);
  CallQueue callQueue = new CallQueue(new LinkedBlockingQueue<>(), metrics);
  ExecutorService executorService = createExecutor(
    callQueue, serverArgs.getWorkerThreads(), serverArgs.getWorkerThreads());
  serverArgs.executorService(executorService)
} else if (implType == ImplType.THREAD_POOL) {
 InetAddress listenAddress = getBindAddress(conf);
 int readTimeout = conf.getInt(THRIFT_SERVER_SOCKET_READ_TIMEOUT_KEY,
   THRIFT_SERVER_SOCKET_READ_TIMEOUT_DEFAULT);
registerFilters(conf);
origin: com.aliyun.hbase/alihbase-thrift

@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);
 ThriftServerRunner runner = 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");
  runner = new ThriftServerRunner(conf);
  fail("Thrift HTTP Server starts up even with wrong security configurations.");
 } catch (Exception e) {
 }
 assertNull(runner);
}
origin: com.aliyun.hbase/alihbase-thrift

public void doTestFilterRegistration() throws Exception {
 Configuration conf = UTIL.getConfiguration();
 conf.set("hbase.thrift.filters", "MyFilter:filterclass");
 ThriftServerRunner.registerFilters(conf);
 Map<String, String> registeredFilters = ParseFilter.getAllFilters();
 assertEquals("filterclass", registeredFilters.get("MyFilter"));
}
origin: com.aliyun.hbase/alihbase-thrift

String host = getBindAddress(conf).getHostAddress();
serverConnector.setHost(host);
httpServer.addConnector(serverConnector);
origin: com.aliyun.hbase/alihbase-thrift

            QualityOfProtection.PRIVACY.name()));
checkHttpSecurity(qop, conf);
if (!securityEnabled) {
 throw new IOException("Thrift server must"
origin: org.apache.hbase/hbase-thrift

 InetAddress listenAddress = getBindAddress(conf);
 TNonblockingServerTransport serverTransport = new TNonblockingServerSocket(
   new InetSocketAddress(listenAddress, listenPort));
  THsHaServer.Args serverArgs = new THsHaServer.Args(serverTransport);
  CallQueue callQueue = new CallQueue(new LinkedBlockingQueue<>(), metrics);
  ExecutorService executorService = createExecutor(
    callQueue, serverArgs.getMaxWorkerThreads(), serverArgs.getMaxWorkerThreads());
  serverArgs.executorService(executorService)
    new HThreadedSelectorServerArgs(serverTransport, conf);
  CallQueue callQueue = new CallQueue(new LinkedBlockingQueue<>(), metrics);
  ExecutorService executorService = createExecutor(
    callQueue, serverArgs.getWorkerThreads(), serverArgs.getWorkerThreads());
  serverArgs.executorService(executorService)
} else if (implType == ImplType.THREAD_POOL) {
 InetAddress listenAddress = getBindAddress(conf);
 int readTimeout = conf.getInt(THRIFT_SERVER_SOCKET_READ_TIMEOUT_KEY,
   THRIFT_SERVER_SOCKET_READ_TIMEOUT_DEFAULT);
registerFilters(conf);
origin: com.aliyun.hbase/alihbase-thrift

/**
 * Start up or shuts down the Thrift server, depending on the arguments.
 * @param args
 */
 void doMain(final String[] args) throws Exception {
  processOptions(args);
  serverRunner = new ThriftServerRunner(conf);
  // Put up info server.
  int port = conf.getInt("hbase.thrift.info.port", 9095);
  if (port >= 0) {
   conf.setLong("startcode", System.currentTimeMillis());
   String a = conf.get("hbase.thrift.info.bindAddress", "0.0.0.0");
   infoServer = new InfoServer("thrift", a, port, false, conf);
   infoServer.setAttribute("hbase.conf", conf);
   infoServer.start();
  }
  serverRunner.run();
}
origin: org.apache.hbase/hbase-thrift

@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);
 ThriftServerRunner runner = 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");
  runner = new ThriftServerRunner(conf);
  fail("Thrift HTTP Server starts up even with wrong security configurations.");
 } catch (Exception e) {
 }
 assertNull(runner);
}
origin: co.cask.hbase/hbase

public void stop() {
 if (this.infoServer != null) {
  LOG.info("Stopping infoServer");
  try {
   this.infoServer.stop();
  } catch (Exception ex) {
   ex.printStackTrace();
  }
 }
 serverRunner.shutdown();
}
origin: co.cask.hbase/hbase

/**
 * Start up or shuts down the Thrift server, depending on the arguments.
 * @param args
 */
 void doMain(final String[] args) throws Exception {
  processOptions(args);
  // login the server principal (if using secure Hadoop)
  if (User.isSecurityEnabled() && User.isHBaseSecurityEnabled(conf)) {
   String machineName = Strings.domainNamePointerToHostName(
    DNS.getDefaultHost(conf.get("hbase.thrift.dns.interface", "default"),
     conf.get("hbase.thrift.dns.nameserver", "default")));
   User.login(conf, "hbase.thrift.keytab.file",
     "hbase.thrift.kerberos.principal", machineName);
  }
  serverRunner = new ThriftServerRunner(conf);
  // Put up info server.
  int port = conf.getInt("hbase.thrift.info.port", 9095);
  if (port >= 0) {
   conf.setLong("startcode", System.currentTimeMillis());
   String a = conf.get("hbase.thrift.info.bindAddress", "0.0.0.0");
   infoServer = new InfoServer("thrift", a, port, false, conf);
   infoServer.setAttribute("hbase.conf", conf);
   infoServer.start();
  }
  serverRunner.run();
}
origin: org.apache.hbase/hbase-thrift

public void stop() {
 if (this.infoServer != null) {
  LOG.info("Stopping infoServer");
  try {
   this.infoServer.stop();
  } catch (Exception ex) {
   ex.printStackTrace();
  }
 }
 serverRunner.shutdown();
}
origin: com.aliyun.hbase/alihbase-thrift

public void stop() {
 if (this.infoServer != null) {
  LOG.info("Stopping infoServer");
  try {
   this.infoServer.stop();
  } catch (Exception ex) {
   ex.printStackTrace();
  }
 }
 serverRunner.shutdown();
}
org.apache.hadoop.hbase.thriftThriftServerRunner

Javadoc

ThriftServerRunner - this class starts up a Thrift server which implements the Hbase API specified in the Hbase.thrift IDL file.

Most used methods

  • <init>
  • registerFilters
  • createExecutor
  • getBindAddress
  • run
  • shutdown
  • checkHttpSecurity
  • setupServer
    Setting up the thrift TServer

Popular in Java

  • Making http requests using okhttp
  • getSystemService (Context)
  • startActivity (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • JCheckBox (javax.swing)
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now