@Override public String getMetaConf(String key) throws MetaException { ConfVars confVar = MetastoreConf.getMetaConf(key); if (confVar == null) { throw new MetaException("Invalid configuration key " + key); } return getConf().get(key, confVar.getDefaultVal().toString()); }
@Override public void setMetaConf(String key, String value) throws MetaException { ConfVars confVar = MetastoreConf.getMetaConf(key); if (confVar == null) { throw new MetaException("Invalid configuration key " + key); } try { confVar.validate(value); } catch (IllegalArgumentException e) { throw new MetaException("Invalid configuration value " + value + " for key " + key + " by " + e.getMessage()); } Configuration configuration = getConf(); String oldValue = MetastoreConf.get(configuration, key); // Save prev val of the key on threadLocal Map<String, String> modifiedConf = getModifiedConf(); if (!modifiedConf.containsKey(key)) { modifiedConf.put(key, oldValue); } // Set invoking HMSHandler on threadLocal, this will be used later to notify // metaListeners in HiveMetaStore#cleanupRawStore setHMSHandler(this); configuration.set(key, value); notifyMetaListeners(key, oldValue, value); if (ConfVars.TRY_DIRECT_SQL == confVar) { HMSHandler.LOG.info("Direct SQL optimization = {}", value); } }
private boolean doesClientHaveCapability(ClientCapabilities client, ClientCapability value) { if (!MetastoreConf.getBoolVar(getConf(), ConfVars.CAPABILITY_CHECK)) { return true; } return (client != null && client.isSetValues() && client.getValues().contains(value)); }
@Override public void setMetaConf(String key, String value) throws MetaException { ConfVars confVar = HiveConf.getMetaConf(key); if (confVar == null) { throw new MetaException("Invalid configuration key " + key); } String validate = confVar.validate(value); if (validate != null) { throw new MetaException("Invalid configuration value " + value + " for key " + key + " by " + validate); } Configuration configuration = getConf(); String oldValue = configuration.get(key); configuration.set(key, value); for (MetaStoreEventListener listener : listeners) { listener.onConfigChange(new ConfigChangeEvent(this, key, oldValue, value)); } }
@Override public void setMetaConf(String key, String value) throws MetaException { ConfVars confVar = HiveConf.getMetaConf(key); if (confVar == null) { throw new MetaException("Invalid configuration key " + key); } String validate = confVar.validate(value); if (validate != null) { throw new MetaException("Invalid configuration value " + value + " for key " + key + " by " + validate); } Configuration configuration = getConf(); String oldValue = configuration.get(key); configuration.set(key, value); for (MetaStoreEventListener listener : listeners) { listener.onConfigChange(new ConfigChangeEvent(this, key, oldValue, value)); } }
private final void logAuditEvent(String cmd) { if (!ShimLoader.getHadoopShims().isSecureShimImpl() || cmd == null) { return; } UserGroupInformation ugi; try { ugi = ShimLoader.getHadoopShims().getUGIForConf(getConf()); } catch (Exception ex) { throw new RuntimeException(ex); } InetAddress addr = TLoggingProcessor.getRemoteAddress(); final Formatter fmt = auditFormatter.get(); ((StringBuilder)fmt.out()).setLength(0); auditLog.info(fmt.format(AUDIT_FORMAT, ugi.getUserName(), addr == null ? "unknown-ip-addr" : addr.toString(), cmd).toString()); }
@Override public void setMetaStoreHandler(HMSHandler handler) { setConf(handler.getConf()); }
private boolean doesClientHaveCapability(ClientCapabilities client, ClientCapability value) { if (!MetastoreConf.getBoolVar(getConf(), ConfVars.CAPABILITY_CHECK)) { return true; } return (client != null && client.isSetValues() && client.getValues().contains(value)); }
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()); }
private RawStore newRawStore() throws MetaException { LOG.info(addPrefix("Opening raw store with implemenation class:" + rawStoreClassName)); Configuration conf = getConf(); return RetryingRawStore.getProxy(hiveConf, conf, rawStoreClassName, threadLocalId.get()); }
@Override public String getMetaConf(String key) throws MetaException { ConfVars confVar = MetastoreConf.getMetaConf(key); if (confVar == null) { throw new MetaException("Invalid configuration key " + key); } return getConf().get(key, confVar.getDefaultVal().toString()); }
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()); }
@Override public String getMetaConf(String key) throws MetaException { ConfVars confVar = HiveConf.getMetaConf(key); if (confVar == null) { throw new MetaException("Invalid configuration key " + key); } return getConf().get(key); }
/** * Get a cached RawStore. * * @return the cached RawStore * @throws MetaException */ @Override public RawStore getMS() throws MetaException { Configuration conf = getConf(); return getMSForConf(conf); }
@Override public String getMetaConf(String key) throws MetaException { ConfVars confVar = HiveConf.getMetaConf(key); if (confVar == null) { throw new MetaException("Invalid configuration key " + key); } return getConf().get(key); }
tConfig.set(context.getHandler().getConf());
} else { StorageSchemaReader schemaReader = getStorageSchemaReader(); ret = schemaReader.readSchema(tbl, envContext, getConf());
FileSystem fs = location.getFileSystem(getConf()); if (!org.apache.hadoop.hive.metastore.utils.HdfsUtils.isPathEncrypted(getConf(), fs.getUri(), location) && !FileUtils.pathHasSnapshotSubDir(location, fs)) { HdfsUtils.HadoopFileStatus status = new HdfsUtils.HadoopFileStatus(getConf(), fs, location); FileStatus targetStatus = fs.getFileStatus(location); String targetGroup = targetStatus == null ? null : targetStatus.getGroup(); wh.deleteDir(location, true, isAutopurge, db); fs.mkdirs(location); HdfsUtils.setFullFileStatus(getConf(), status, targetGroup, fs, location, false); } else { FileStatus[] statuses = fs.listStatus(location, FileUtils.HIDDEN_FILES_PATH_FILTER);
@Override public void setMetaStoreHandler(HMSHandler handler) { setConf(handler.getConf()); }
/** * Get a cached RawStore. * * @return the cached RawStore * @throws MetaException */ @Override public RawStore getMS() throws MetaException { Configuration conf = getConf(); return getMSForConf(conf); }