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

How to use
HiveClientCache$HiveClientCacheKey
in
org.apache.hive.hcatalog.common

Best Java code snippets using org.apache.hive.hcatalog.common.HiveClientCache$HiveClientCacheKey (Showing top 15 results out of 315)

origin: apache/hive

/**
 * Returns a cached client if exists or else creates one, caches and returns it. It also checks that the client is
 * healthy and can be reused
 * @param hiveConf
 * @return the hive client
 * @throws MetaException
 * @throws IOException
 * @throws LoginException
 */
public IMetaStoreClient get(final HiveConf hiveConf) throws MetaException, IOException, LoginException {
 final HiveClientCacheKey cacheKey = HiveClientCacheKey.fromHiveConf(hiveConf, getThreadId());
 ICacheableMetaStoreClient cacheableHiveMetaStoreClient = null;
 // the hmsc is not shared across threads. So the only way it could get closed while we are doing healthcheck
 // is if removalListener closes it. The synchronization takes care that removalListener won't do it
 synchronized (CACHE_TEARDOWN_LOCK) {
  cacheableHiveMetaStoreClient = getOrCreate(cacheKey);
  cacheableHiveMetaStoreClient.acquire();
 }
 if (!cacheableHiveMetaStoreClient.isOpen()) {
  synchronized (CACHE_TEARDOWN_LOCK) {
   hiveCache.invalidate(cacheKey);
   cacheableHiveMetaStoreClient.close();
   cacheableHiveMetaStoreClient = getOrCreate(cacheKey);
   cacheableHiveMetaStoreClient.acquire();
  }
 }
 return cacheableHiveMetaStoreClient;
}
origin: apache/hive

 @Override
 public ICacheableMetaStoreClient call() throws MetaException {
  // This is called from HCat, so always allow embedded metastore (as was the default).
  return
    (ICacheableMetaStoreClient) RetryingMetaStoreClient.getProxy(cacheKey.getHiveConf(),
      new Class<?>[]{HiveConf.class, Integer.class, Boolean.class},
      new Object[]{cacheKey.getHiveConf(), timeout, true},
      CacheableHiveMetaStoreClient.class.getName());
 }
});
origin: com.github.hyukjinkwon.hcatalog/hive-hcatalog-core

/**
 * Returns a cached client if exists or else creates one, caches and returns it. It also checks that the client is
 * healthy and can be reused
 * @param hiveConf
 * @return the hive client
 * @throws MetaException
 * @throws IOException
 * @throws LoginException
 */
public ICacheableMetaStoreClient get(final HiveConf hiveConf) throws MetaException, IOException, LoginException {
 final HiveClientCacheKey cacheKey = HiveClientCacheKey.fromHiveConf(hiveConf, getThreadId());
 ICacheableMetaStoreClient cacheableHiveMetaStoreClient = null;
 // the hmsc is not shared across threads. So the only way it could get closed while we are doing healthcheck
 // is if removalListener closes it. The synchronization takes care that removalListener won't do it
 synchronized (CACHE_TEARDOWN_LOCK) {
  cacheableHiveMetaStoreClient = getOrCreate(cacheKey);
  cacheableHiveMetaStoreClient.acquire();
 }
 if (!cacheableHiveMetaStoreClient.isOpen()) {
  synchronized (CACHE_TEARDOWN_LOCK) {
   hiveCache.invalidate(cacheKey);
   cacheableHiveMetaStoreClient.close();
   cacheableHiveMetaStoreClient = getOrCreate(cacheKey);
   cacheableHiveMetaStoreClient.acquire();
  }
 }
 return cacheableHiveMetaStoreClient;
}
origin: org.spark-project.hive.hcatalog/hive-hcatalog-core

/**
 * Returns a cached client if exists or else creates one, caches and returns it. It also checks that the client is
 * healthy and can be reused
 * @param hiveConf
 * @return the hive client
 * @throws MetaException
 * @throws IOException
 * @throws LoginException
 */
public ICacheableMetaStoreClient get(final HiveConf hiveConf) throws MetaException, IOException, LoginException {
 final HiveClientCacheKey cacheKey = HiveClientCacheKey.fromHiveConf(hiveConf, getThreadId());
 ICacheableMetaStoreClient cacheableHiveMetaStoreClient = null;
 // the hmsc is not shared across threads. So the only way it could get closed while we are doing healthcheck
 // is if removalListener closes it. The synchronization takes care that removalListener won't do it
 synchronized (CACHE_TEARDOWN_LOCK) {
  cacheableHiveMetaStoreClient = getOrCreate(cacheKey);
  cacheableHiveMetaStoreClient.acquire();
 }
 if (!cacheableHiveMetaStoreClient.isOpen()) {
  synchronized (CACHE_TEARDOWN_LOCK) {
   hiveCache.invalidate(cacheKey);
   cacheableHiveMetaStoreClient.close();
   cacheableHiveMetaStoreClient = getOrCreate(cacheKey);
   cacheableHiveMetaStoreClient.acquire();
  }
 }
 return cacheableHiveMetaStoreClient;
}
origin: com.facebook.presto.hive/hive-apache

/**
 * Returns a cached client if exists or else creates one, caches and returns it. It also checks that the client is
 * healthy and can be reused
 * @param hiveConf
 * @return the hive client
 * @throws MetaException
 * @throws IOException
 * @throws LoginException
 */
public ICacheableMetaStoreClient get(final HiveConf hiveConf) throws MetaException, IOException, LoginException {
 final HiveClientCacheKey cacheKey = HiveClientCacheKey.fromHiveConf(hiveConf, getThreadId());
 ICacheableMetaStoreClient cacheableHiveMetaStoreClient = null;
 // the hmsc is not shared across threads. So the only way it could get closed while we are doing healthcheck
 // is if removalListener closes it. The synchronization takes care that removalListener won't do it
 synchronized (CACHE_TEARDOWN_LOCK) {
  cacheableHiveMetaStoreClient = getOrCreate(cacheKey);
  cacheableHiveMetaStoreClient.acquire();
 }
 if (!cacheableHiveMetaStoreClient.isOpen()) {
  synchronized (CACHE_TEARDOWN_LOCK) {
   hiveCache.invalidate(cacheKey);
   cacheableHiveMetaStoreClient.close();
   cacheableHiveMetaStoreClient = getOrCreate(cacheKey);
   cacheableHiveMetaStoreClient.acquire();
  }
 }
 return cacheableHiveMetaStoreClient;
}
origin: org.apache.hive.hcatalog/hive-hcatalog-core

/**
 * Returns a cached client if exists or else creates one, caches and returns it. It also checks that the client is
 * healthy and can be reused
 * @param hiveConf
 * @return the hive client
 * @throws MetaException
 * @throws IOException
 * @throws LoginException
 */
public IMetaStoreClient get(final HiveConf hiveConf) throws MetaException, IOException, LoginException {
 final HiveClientCacheKey cacheKey = HiveClientCacheKey.fromHiveConf(hiveConf, getThreadId());
 ICacheableMetaStoreClient cacheableHiveMetaStoreClient = null;
 // the hmsc is not shared across threads. So the only way it could get closed while we are doing healthcheck
 // is if removalListener closes it. The synchronization takes care that removalListener won't do it
 synchronized (CACHE_TEARDOWN_LOCK) {
  cacheableHiveMetaStoreClient = getOrCreate(cacheKey);
  cacheableHiveMetaStoreClient.acquire();
 }
 if (!cacheableHiveMetaStoreClient.isOpen()) {
  synchronized (CACHE_TEARDOWN_LOCK) {
   hiveCache.invalidate(cacheKey);
   cacheableHiveMetaStoreClient.close();
   cacheableHiveMetaStoreClient = getOrCreate(cacheKey);
   cacheableHiveMetaStoreClient.acquire();
  }
 }
 return cacheableHiveMetaStoreClient;
}
origin: org.spark-project.hive.hcatalog/hive-hcatalog-core

public static HiveClientCacheKey fromHiveConf(HiveConf hiveConf, final int threadId) throws IOException, LoginException {
 return new HiveClientCacheKey(hiveConf, threadId);
}
origin: com.github.hyukjinkwon.hcatalog/hive-hcatalog-core

public static HiveClientCacheKey fromHiveConf(HiveConf hiveConf, final int threadId) throws IOException, LoginException {
 return new HiveClientCacheKey(hiveConf, threadId);
}
origin: com.facebook.presto.hive/hive-apache

public static HiveClientCacheKey fromHiveConf(HiveConf hiveConf, final int threadId) throws IOException, LoginException {
 return new HiveClientCacheKey(hiveConf, threadId);
}
origin: org.apache.hive.hcatalog/hive-hcatalog-core

public static HiveClientCacheKey fromHiveConf(HiveConf hiveConf, final int threadId) throws IOException, LoginException {
 return new HiveClientCacheKey(hiveConf, threadId);
}
origin: com.github.hyukjinkwon.hcatalog/hive-hcatalog-core

 @Override
 public ICacheableMetaStoreClient call() throws MetaException {
  return
    (ICacheableMetaStoreClient) RetryingMetaStoreClient.getProxy(cacheKey.getHiveConf(),
      new Class<?>[]{HiveConf.class, Integer.class},
      new Object[]{cacheKey.getHiveConf(), timeout},
      CacheableHiveMetaStoreClient.class.getName());
 }
});
origin: org.apache.hive.hcatalog/hive-hcatalog-core

 @Override
 public ICacheableMetaStoreClient call() throws MetaException {
  // This is called from HCat, so always allow embedded metastore (as was the default).
  return
    (ICacheableMetaStoreClient) RetryingMetaStoreClient.getProxy(cacheKey.getHiveConf(),
      new Class<?>[]{HiveConf.class, Integer.class, Boolean.class},
      new Object[]{cacheKey.getHiveConf(), timeout, true},
      CacheableHiveMetaStoreClient.class.getName());
 }
});
origin: org.spark-project.hive.hcatalog/hive-hcatalog-core

 @Override
 public ICacheableMetaStoreClient call() throws MetaException {
  return
    (ICacheableMetaStoreClient) RetryingMetaStoreClient.getProxy(cacheKey.getHiveConf(),
      new Class<?>[]{HiveConf.class, Integer.class},
      new Object[]{cacheKey.getHiveConf(), timeout},
      CacheableHiveMetaStoreClient.class.getName());
 }
});
origin: com.facebook.presto.hive/hive-apache

 @Override
 public ICacheableMetaStoreClient call() throws MetaException {
  return
    (ICacheableMetaStoreClient) RetryingMetaStoreClient.getProxy(cacheKey.getHiveConf(),
      new Class<?>[]{HiveConf.class, Integer.class},
      new Object[]{cacheKey.getHiveConf(), timeout},
      CacheableHiveMetaStoreClient.class.getName());
 }
});
origin: apache/hive

public static HiveClientCacheKey fromHiveConf(HiveConf hiveConf, final int threadId) throws IOException, LoginException {
 return new HiveClientCacheKey(hiveConf, threadId);
}
org.apache.hive.hcatalog.commonHiveClientCache$HiveClientCacheKey

Javadoc

A class to wrap HiveConf and expose equality based only on UserGroupInformation and the metaStoreURIs. This becomes the key for the cache and this way the same HiveMetaStoreClient would be returned if UserGroupInformation and metaStoreURIs are same. This function can evolve to express the cases when HiveConf is different but the same hiveMetaStoreClient can be used

Most used methods

  • <init>
  • fromHiveConf
  • getHiveConf

Popular in Java

  • Reading from database using SQL prepared statement
  • findViewById (Activity)
  • setScale (BigDecimal)
  • runOnUiThread (Activity)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • JTextField (javax.swing)
  • Top PhpStorm 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