Preconditions.checkState(hiveConnectionFactory == null); hiveConnectionFactory = new HiveSimpleConnectionFactory(conf, new HiveConf()); hiveConnectionFactory.init(); hmsFollower = new HMSFollower(conf, sentryStore, leaderMonitor, hiveConnectionFactory); long initDelay = conf.getLong(ServerConfig.SENTRY_HMSFOLLOWER_INIT_DELAY_MILLS,
} finally { try { hiveConnectionFactory.close(); } catch (Exception e) { LOGGER.error("Can't close HiveConnectionFactory", e);
configuration.set(AUTHZ_SERVER_NAME.getVar(), serverName); HMSFollower hmsFollower = new HMSFollower(configuration, sentryStore, null, new HiveSimpleConnectionFactory(conf, new HiveConf()), null);
configuration.set(AUTHZ_SERVER_NAME.getVar(), serverName); HMSFollower hmsFollower = new HMSFollower(configuration, sentryStore, null, new HiveSimpleConnectionFactory(conf, new HiveConf()), null);
@BeforeClass public static void setup() throws IOException, LoginException { configuration.set(ServerConfig.PRINCIPAL, "sentry/_HOST@TEST.COM"); hiveConnectionFactory = new HiveSimpleConnectionFactory(configuration, new HiveConf()); hiveConnectionFactory.init(); configuration.set("sentry.hive.sync.create", "true"); configuration.set(SENTRY_SERVICE_FULL_UPDATE_PUBSUB, "true"); enableHdfsSyncInSentry(configuration); }