static RawStore newRawStoreForConf(Configuration conf) throws MetaException { Configuration newConf = new Configuration(conf); String rawStoreClassName = MetastoreConf.getVar(newConf, ConfVars.RAW_STORE_IMPL); LOG.info(addPrefix("Opening raw store with implementation class:" + rawStoreClassName)); return RawStoreProxy.getProxy(newConf, conf, rawStoreClassName, threadLocalId.get()); }
public static RawStore getProxy(Configuration hiveConf, Configuration conf, String rawStoreClassName, int id) throws MetaException { Class<? extends RawStore> baseClass = JavaUtils.getClass(rawStoreClassName, RawStore.class); RawStoreProxy handler = new RawStoreProxy(hiveConf, conf, baseClass, id); // Look for interfaces on both the class and all base classes. return (RawStore) Proxy.newProxyInstance(RawStoreProxy.class.getClassLoader(), getAllInterfaces(baseClass), handler); }
private void init() throws MetaException { // Using the hook on startup ensures that the hook always has priority // over settings in *.xml. The thread local conf needs to be used because at this point // it has already been initialized using conf. MetaStoreInit.updateConnectionURL(hiveConf, getConf(), null, metaStoreInitData); }
@Test public void testExceptionDispatch() throws Throwable { Configuration conf = MetastoreConf.newMetastoreConf(); MetastoreConf.setTimeVar(conf, MetastoreConf.ConfVars.CLIENT_SOCKET_TIMEOUT, 10, TimeUnit.MILLISECONDS); RawStoreProxy rsp = new RawStoreProxy(conf, conf, TestStore.class, 1); try { rsp.invoke(null, TestStore.class.getMethod("exceptions"), new Object[] {}); fail("an exception is expected"); } catch (IllegalStateException ise) { // expected } Thread.sleep(20); // this shouldn't throw an exception rsp.invoke(null, TestStore.class.getMethod("noopMethod"), new Object[] {}); } }
protected RawStoreProxy(Configuration hiveConf, Configuration conf, Class<? extends RawStore> rawStoreClass, int id) throws MetaException { this.conf = conf; this.hiveConf = hiveConf; this.socketTimeout = MetastoreConf.getTimeVar(hiveConf, MetastoreConf.ConfVars.CLIENT_SOCKET_TIMEOUT, TimeUnit.MILLISECONDS); // This has to be called before initializing the instance of RawStore init(); this.base = ReflectionUtils.newInstance(rawStoreClass, conf); }
protected RawStoreProxy(HiveConf hiveConf, Configuration conf, Class<? extends RawStore> rawStoreClass, int id) throws MetaException { this.conf = conf; this.hiveConf = hiveConf; this.id = id; // This has to be called before initializing the instance of RawStore init(); this.base = ReflectionUtils.newInstance(rawStoreClass, conf); }
private static synchronized void init(Configuration conf) throws MetaException { if (cleaner == null) { cleaner = new CleanerThread(conf, RawStoreProxy.getProxy(conf, conf, MetastoreConf.getVar(conf, ConfVars.RAW_STORE_IMPL), 999999)); cleaner.start(); } }
public static RawStore getProxy(HiveConf hiveConf, Configuration conf, String rawStoreClassName, int id) throws MetaException { Class<? extends RawStore> baseClass = (Class<? extends RawStore>) MetaStoreUtils.getClass( rawStoreClassName); RawStoreProxy handler = new RawStoreProxy(hiveConf, conf, baseClass, id); // Look for interfaces on both the class and all base classes. return (RawStore) Proxy.newProxyInstance(RawStoreProxy.class.getClassLoader(), getAllInterfaces(baseClass), handler); }
private void init() throws MetaException { // Using the hook on startup ensures that the hook always has priority // over settings in *.xml. The thread local conf needs to be used because at this point // it has already been initialized using hiveConf. MetaStoreInit.updateConnectionURL(hiveConf, getConf(), null, metaStoreInitData); }
protected RawStoreProxy(HiveConf hiveConf, Configuration conf, Class<? extends RawStore> rawStoreClass, int id) throws MetaException { this.conf = conf; this.hiveConf = hiveConf; this.id = id; // This has to be called before initializing the instance of RawStore init(); this.base = ReflectionUtils.newInstance(rawStoreClass, conf); }
@Override public void init(AtomicBoolean stop, AtomicBoolean looped) throws Exception { super.init(stop, looped); // Get our own instance of the transaction handler txnHandler = TxnUtils.getTxnStore(conf); // Get our own connection to the database so we can get table and partition information. rs = RawStoreProxy.getProxy(conf, conf, MetastoreConf.getVar(conf, MetastoreConf.ConfVars.RAW_STORE_IMPL), threadId); }
public static RawStore getProxy(HiveConf hiveConf, Configuration conf, String rawStoreClassName, int id) throws MetaException { Class<? extends RawStore> baseClass = (Class<? extends RawStore>) MetaStoreUtils.getClass( rawStoreClassName); RawStoreProxy handler = new RawStoreProxy(hiveConf, conf, baseClass, id); // Look for interfaces on both the class and all base classes. return (RawStore) Proxy.newProxyInstance(RawStoreProxy.class.getClassLoader(), getAllInterfaces(baseClass), handler); }
private void init() throws MetaException { // Using the hook on startup ensures that the hook always has priority // over settings in *.xml. The thread local conf needs to be used because at this point // it has already been initialized using hiveConf. MetaStoreInit.updateConnectionURL(hiveConf, getConf(), null, metaStoreInitData); }
protected RawStoreProxy(Configuration hiveConf, Configuration conf, Class<? extends RawStore> rawStoreClass, int id) throws MetaException { this.conf = conf; this.hiveConf = hiveConf; this.socketTimeout = MetastoreConf.getTimeVar(hiveConf, MetastoreConf.ConfVars.CLIENT_SOCKET_TIMEOUT, TimeUnit.MILLISECONDS); // This has to be called before initializing the instance of RawStore init(); this.base = ReflectionUtils.newInstance(rawStoreClass, conf); }
@Override public void init(AtomicBoolean stop, AtomicBoolean looped) throws MetaException { this.stop = stop; this.looped = looped; setPriority(MIN_PRIORITY); setDaemon(true); String user = "anonymous"; try { user = UserGroupInformation.getCurrentUser().getShortUserName(); } catch (IOException e) { LOG.warn("Cannot determine the current user; executing as anonymous", e); } txnHandler = TxnUtils.getTxnStore(conf); rs = RawStoreProxy.getProxy(conf, conf, MetastoreConf.getVar(conf, MetastoreConf.ConfVars.RAW_STORE_IMPL), threadId); for (int i = 0; i < workers.length; ++i) { workers[i] = new Thread(new WorkerRunnable(conf, user)); workers[i].setDaemon(true); workers[i].setName("Stats updater worker " + i); } }
public static RawStore getProxy(Configuration hiveConf, Configuration conf, String rawStoreClassName, int id) throws MetaException { Class<? extends RawStore> baseClass = JavaUtils.getClass(rawStoreClassName, RawStore.class); RawStoreProxy handler = new RawStoreProxy(hiveConf, conf, baseClass, id); // Look for interfaces on both the class and all base classes. return (RawStore) Proxy.newProxyInstance(RawStoreProxy.class.getClassLoader(), getAllInterfaces(baseClass), handler); }
private void init() throws MetaException { // Using the hook on startup ensures that the hook always has priority // over settings in *.xml. The thread local conf needs to be used because at this point // it has already been initialized using conf. MetaStoreInit.updateConnectionURL(hiveConf, getConf(), null, metaStoreInitData); }
@Override public void init(AtomicBoolean stop, AtomicBoolean looped) throws MetaException { this.stop = stop; this.looped = looped; setPriority(MIN_PRIORITY); setDaemon(true); // this means the process will exit without waiting for this thread // Get our own instance of the transaction handler txnHandler = TxnUtils.getTxnStore(conf); // Get our own connection to the database so we can get table and partition information. rs = RawStoreProxy.getProxy(conf, conf, conf.getVar(HiveConf.ConfVars.METASTORE_RAW_STORE_IMPL), threadId); }
private void initMS() { base.setConf(getConf()); }
private RawStore newRawStore() throws MetaException { LOG.info(addPrefix("Opening raw store with implemenation class:" + rawStoreClassName)); Configuration conf = getConf(); return RawStoreProxy.getProxy(hiveConf, conf, rawStoreClassName, threadLocalId.get()); }