private boolean hasCustomMapping(NamespaceMeta metadata) { NamespaceConfig config = metadata.getConfig(); return !(Strings.isNullOrEmpty(config.getRootDirectory()) && Strings.isNullOrEmpty(config.getHbaseNamespace()) && Strings.isNullOrEmpty(config.getHiveDatabase())); }
private boolean hasCustomMapping(NamespaceMeta metadata) { NamespaceConfig config = metadata.getConfig(); return !(Strings.isNullOrEmpty(config.getRootDirectory()) && Strings.isNullOrEmpty(config.getHbaseNamespace()) && Strings.isNullOrEmpty(config.getHiveDatabase())); }
@Nullable // returns null iff the input is null private String getHiveDatabase(@Nullable String namespace) { // null namespace implies that the operation happens across all databases if (isNullOrDefault(namespace)) { return namespace; } try { String customHiveDb = namespaceQueryAdmin.get(new NamespaceId(namespace)).getConfig().getHiveDatabase(); if (!Strings.isNullOrEmpty(customHiveDb)) { return customHiveDb; } } catch (Exception e) { throw Throwables.propagate(e); } return getCDAPFormatDBName(namespace); }
@Nullable // returns null iff the input is null private String getHiveDatabase(@Nullable String namespace) { // null namespace implies that the operation happens across all databases if (isNullOrDefault(namespace)) { return namespace; } try { String customHiveDb = namespaceQueryAdmin.get(new NamespaceId(namespace)).getConfig().getHiveDatabase(); if (!Strings.isNullOrEmpty(customHiveDb)) { return customHiveDb; } } catch (Exception e) { throw Throwables.propagate(e); } return getCDAPFormatDBName(namespace); }
builder.append("='").append(namespaceConfig.getHbaseNamespace()).append("', "); if (namespaceConfig.getHiveDatabase() != null) { builder.append(ArgumentName.NAMESPACE_HIVE_DATABASE); builder.append("='").append(namespaceConfig.getHiveDatabase()).append("', ");
builder.append("='").append(namespaceConfig.getHbaseNamespace()).append("', "); if (namespaceConfig.getHiveDatabase() != null) { builder.append(ArgumentName.NAMESPACE_HIVE_DATABASE); builder.append("='").append(namespaceConfig.getHiveDatabase()).append("', ");
sessionHandle = openHiveSession(sessionConf); QueryHandle handle; if (Strings.isNullOrEmpty(namespaceMeta.getConfig().getHiveDatabase())) { String statement = String.format("USE %s", namespaceMeta.getConfig().getHiveDatabase()); "which does not exists. Please create the database in hive " + "for the user and try creating the namespace again.", namespaceMeta.getConfig().getHiveDatabase(), namespaceMeta.getName()), e); } else { namespaceMeta.getConfig().getHiveDatabase(), namespaceMeta.getName()), e); namespaceMeta.getConfig().getHiveDatabase()); LOG.debug("Custom database {} existence verified with handle {}", namespaceMeta.getConfig().getHiveDatabase(), handle);
if (!Strings.isNullOrEmpty(metadata.getConfig().getHiveDatabase()) && metadata.getConfig().getHiveDatabase().equals(existingConfig.getHiveDatabase())) { throw new BadRequestException(String.format("A namespace '%s' already exists with the given " + "namespace mapping for hive database '%s'", existingNamespaceMeta.getName(), existingConfig.getHiveDatabase()));
if (!Strings.isNullOrEmpty(metadata.getConfig().getHiveDatabase()) && metadata.getConfig().getHiveDatabase().equals(existingConfig.getHiveDatabase())) { throw new BadRequestException(String.format("A namespace '%s' already exists with the given " + "namespace mapping for hive database '%s'", existingNamespaceMeta.getName(), existingConfig.getHiveDatabase()));
sessionHandle = openHiveSession(sessionConf); QueryHandle handle; if (Strings.isNullOrEmpty(namespaceMeta.getConfig().getHiveDatabase())) { String statement = String.format("USE %s", namespaceMeta.getConfig().getHiveDatabase()); "which does not exists. Please create the database in hive " + "for the user and try creating the namespace again.", namespaceMeta.getConfig().getHiveDatabase(), namespaceMeta.getName()), e); } else { namespaceMeta.getConfig().getHiveDatabase(), namespaceMeta.getName()), e); namespaceMeta.getConfig().getHiveDatabase()); LOG.debug("Custom database {} existence verified with handle {}", namespaceMeta.getConfig().getHiveDatabase(), handle);
String customHiveDatabase; try { customHiveDatabase = namespaceQueryAdmin.get(namespace).getConfig().getHiveDatabase(); } catch (Exception e) { throw new ExploreException(String.format("Failed to get namespace meta for the namespace %s", namespace));
String customHiveDatabase; try { customHiveDatabase = namespaceQueryAdmin.get(namespace).getConfig().getHiveDatabase(); } catch (Exception e) { throw new ExploreException(String.format("Failed to get namespace meta for the namespace %s", namespace));
public Builder(NamespaceMeta meta) { this.name = meta.getName(); this.description = meta.getDescription(); NamespaceConfig config = meta.getConfig(); if (config != null) { this.schedulerQueueName = config.getSchedulerQueueName(); this.rootDirectory = config.getRootDirectory(); this.hbaseNamespace = config.getHbaseNamespace(); this.hiveDatabase = config.getHiveDatabase(); this.principal = config.getPrincipal(); this.groupName = config.getGroupName(); this.keytabURIWithoutVersion = config.getKeytabURIWithoutVersion(); this.keytabURIVersion = config.getKeytabURIVersion(); this.exploreAsPrincipal = config.isExploreAsPrincipal(); } }
public Builder(NamespaceMeta meta) { this.name = meta.getName(); this.description = meta.getDescription(); NamespaceConfig config = meta.getConfig(); if (config != null) { this.schedulerQueueName = config.getSchedulerQueueName(); this.rootDirectory = config.getRootDirectory(); this.hbaseNamespace = config.getHbaseNamespace(); this.hiveDatabase = config.getHiveDatabase(); this.principal = config.getPrincipal(); this.groupName = config.getGroupName(); this.keytabURIWithoutVersion = config.getKeytabURIWithoutVersion(); this.keytabURIVersion = config.getKeytabURIVersion(); this.exploreAsPrincipal = config.isExploreAsPrincipal(); } }