Tabnine Logo
SentryService
Code IndexAdd Tabnine to your IDE (free)

How to use
SentryService
in
org.apache.sentry.service.thrift

Best Java code snippets using org.apache.sentry.service.thrift.SentryService (Showing top 20 results out of 315)

origin: apache/incubator-sentry

public synchronized void stop() throws Exception{
 MultiException exception = null;
 LOGGER.info("Attempting to stop...");
 if (isRunning()) {
  LOGGER.info("Attempting to stop sentry thrift service...");
  try {
  } catch (Exception e) {
   LOGGER.error("Error while stopping sentry thrift service", e);
   exception = addMultiException(exception,e);
  LOGGER.info("Sentry thrift service is already stopped...");
 if (isWebServerRunning()) {
  try {
   LOGGER.info("Attempting to stop sentry web service...");
   stopSentryWebServer();
  } catch (Exception e) {
   LOGGER.error("Error while stopping sentry web service", e);
   exception = addMultiException(exception,e);
origin: apache/incubator-sentry

 @Override
 public void run() {
  LOGGER.info("ShutdownHook shutting down server");
  try {
   server.stop();
  } catch (Throwable t) {
   LOGGER.error("Error stopping SentryService", t);
  }
 }
});
origin: apache/sentry

 public static SentryService create(Configuration conf) throws Exception {
  return new SentryService(conf);
 }
}
origin: apache/sentry

/**
 * Add gauges for the SentryService class.
 * @param sentryservice
 */
public void addSentryServiceGauges(SentryService sentryservice) {
 if (!sentryServiceGaugesAdded) {
  addGauge(SentryService.class, "is_active", sentryservice.getIsActiveGauge());
  addGauge(SentryService.class, "activated", sentryservice.getBecomeActiveCount());
  sentryServiceGaugesAdded = true;
 }
}
origin: apache/sentry

LOGGER.info("Attempting to stop...");
leaderMonitor.close();
if (isRunning()) {
 LOGGER.info("Attempting to stop sentry thrift service...");
 try {
 } catch (Exception e) {
  LOGGER.error("Error while stopping sentry thrift service", e);
  exception = addMultiException(exception,e);
 LOGGER.info("Sentry thrift service is already stopped...");
if (isWebServerRunning()) {
 try {
  LOGGER.info("Attempting to stop sentry web service...");
  stopSentryWebServer();
 } catch (Exception e) {
  LOGGER.error("Error while stopping sentry web service", e);
  exception = addMultiException(exception,e);
stopHMSFollower(conf);
stopSentryStoreCleaner();
origin: apache/incubator-sentry

 throw new IllegalArgumentException("Cannot read configuration file " + configFile);
Configuration serverConf = loadConfig(configFileName);
final SentryService server = new SentryService(serverConf);
server.start();
Runtime.getRuntime().addShutdownHook(new Thread() {
 @Override
 server.waitOnFuture();
} finally {
 server.serviceExecutor.shutdown();
origin: apache/incubator-sentry

public static void startSentryService() throws Exception {
 server.start();
 final long start = System.currentTimeMillis();
 while(!server.isRunning()) {
  Thread.sleep(1000);
  if(System.currentTimeMillis() - start > 60000L) {
   throw new TimeoutException("Server did not start after 60 seconds");
  }
 }
}
origin: apache/sentry

 throw new IllegalArgumentException("Cannot read configuration file " + configFile);
Configuration serverConf = loadConfig(configFileName);
final SentryService server = new SentryService(serverConf);
server.start();
origin: apache/sentry

  .getInt(ServerConfig.RPC_PORT, ServerConfig.RPC_PORT_DEFAULT);
if (port == 0) {
 port = findFreePort();
 conf.setInt(ServerConfig.RPC_PORT, port);
  .build();
serviceExecutor = Executors.newSingleThreadExecutor(sentryServiceThreadFactory);
this.sentryStore = getSentryStore(conf);
sentryStore.setPersistUpdateDeltas(SentryServiceUtil.isHDFSSyncEnabled(conf));
this.leaderMonitor = LeaderStatusMonitor.getLeaderStatusMonitor(conf);
origin: apache/incubator-sentry

conf.set(ServerConfig.SENTRY_STORE_JDBC_PASS, "dummy");
server = new SentryServiceFactory().create(conf);
conf.set(ClientConfig.SERVER_RPC_ADDRESS, server.getAddress().getHostName());
conf.set(ClientConfig.SERVER_RPC_PORT, String.valueOf(server.getAddress().getPort()));
conf.set(ServerConfig.SENTRY_STORE_GROUP_MAPPING,
  ServerConfig.SENTRY_STORE_LOCAL_GROUP_MAPPING);
origin: apache/incubator-sentry

  .getInt(ServerConfig.RPC_PORT, ServerConfig.RPC_PORT_DEFAULT);
if (port == 0) {
 port = findFreePort();
 conf.setInt(ServerConfig.RPC_PORT, port);
origin: apache/incubator-sentry

SentryService.loadConfig(configFileName), dbType);
origin: apache/sentry

@Test
public void testSentryServiceGauges() throws Throwable {
 //More Cases to be added once Sentry HA is implemented
 //Check for gauges with the server handle.
 Assert.assertEquals(Boolean.TRUE,server.getIsActiveGauge().getValue());
}
origin: apache/sentry

public static void startSentryService() throws Exception {
 server.start();
 final long start = System.currentTimeMillis();
 while(!server.isRunning()) {
  Thread.sleep(1000);
  if(System.currentTimeMillis() - start > 60000L) {
   throw new TimeoutException("Server did not start after 60 seconds");
  }
 }
}
origin: apache/sentry

conf.set(ServerConfig.SENTRY_STORE_JDBC_PASS, "dummy");
server = SentryServiceFactory.create(conf);
conf.set(ApiConstants.ClientConfig.SERVER_RPC_ADDRESS, server.getAddress().getHostName());
conf.set(ApiConstants.ClientConfig.SERVER_RPC_PORT, String.valueOf(server.getAddress().getPort()));
conf.set(ServerConfig.SENTRY_STORE_GROUP_MAPPING,
  ServerConfig.SENTRY_STORE_LOCAL_GROUP_MAPPING);
origin: apache/sentry

 @Override
 public void run() {
  LOGGER.info("ShutdownHook shutting down server");
  try {
   server.stop();
  } catch (Throwable t) {
   LOGGER.error("Error stopping SentryService", t);
   System.exit(1);
  }
 }
}));
origin: apache/incubator-sentry

public SentryService create(Configuration conf) throws Exception {
 SentryService server = new SentryService(conf);
 return server;
}
origin: apache/incubator-sentry

public void stopSentryService() throws Exception {
 server.stop();
 Thread.sleep(30000);
}
origin: apache/sentry

public void stopSentryService() throws Exception {
 server.stop();
 Thread.sleep(30000);
}
origin: apache/sentry

@AfterClass
public static void tearDown() throws Exception {
 beforeTeardown();
 if(server != null) {
  server.stop();
 }
 if (dbDir != null) {
  FileUtils.deleteQuietly(dbDir);
 }
 SentryMiniKdcTestcase.stopMiniKdc();
 afterTeardown();
}
org.apache.sentry.service.thriftSentryService

Most used methods

  • isRunning
  • start
  • stop
  • <init>
  • addMultiException
  • findFreePort
  • getAddress
  • getIsActiveGauge
  • isWebServerRunning
  • loadConfig
  • runServer
  • startSentryWebServer
  • runServer,
  • startSentryWebServer,
  • stopSentryWebServer,
  • addSentryServiceGauge,
  • getBecomeActiveCount,
  • getSentryStore,
  • startHMSFollower,
  • startSentryStoreCleaner,
  • stopHMSFollower,
  • stopSentryStoreCleaner

Popular in Java

  • Creating JSON documents from java classes using gson
  • notifyDataSetChanged (ArrayAdapter)
  • getResourceAsStream (ClassLoader)
  • onRequestPermissionsResult (Fragment)
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • String (java.lang)
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • Reference (javax.naming)
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • Top Vim plugins
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