@Override public String toString() { return "NamespaceMeta{" + "name='" + name + '\'' + ", description='" + description + '\'' + ", config=" + getConfig() + '}'; } }
@Override public String toString() { return "NamespaceMeta{" + "name='" + name + '\'' + ", description='" + description + '\'' + ", config=" + getConfig() + '}'; } }
private boolean hasCustomLocation(NamespaceMeta namespaceMeta) { return !Strings.isNullOrEmpty(namespaceMeta.getConfig().getRootDirectory()); }
private boolean hasCustomLocation(NamespaceMeta namespaceMeta) { return !Strings.isNullOrEmpty(namespaceMeta.getConfig().getRootDirectory()); }
@Override public boolean apply(NamespaceMeta input) { return principal.getName().equals(input.getConfig().getPrincipal()); } });
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())); }
private NamespaceConfig getNamespaceConfig(NamespacedEntityId entityId) throws IOException { try { if (entityId.getNamespaceId().equals(NamespaceId.SYSTEM)) { return NamespaceMeta.SYSTEM.getConfig(); } return namespaceQueryAdmin.get(entityId.getNamespaceId()).getConfig(); } catch (IOException e) { throw e; } catch (Exception e) { throw new IOException(e); } }
@Override public Location get(NamespaceMeta namespaceMeta) throws IOException { String rootDirectory = namespaceMeta.getConfig().getRootDirectory(); if (Strings.isNullOrEmpty(rootDirectory)) { // if no custom mapping was specified, then use the default namespaces location return get(namespaceMeta.getNamespaceId()); } return locationFactory.create(namespaceMeta.getConfig().getRootDirectory()); } }
@Override public Location get(NamespaceMeta namespaceMeta) throws IOException { String rootDirectory = namespaceMeta.getConfig().getRootDirectory(); if (Strings.isNullOrEmpty(rootDirectory)) { // if no custom mapping was specified, then use the default namespaces location return get(namespaceMeta.getNamespaceId()); } return locationFactory.create(namespaceMeta.getConfig().getRootDirectory()); } }
@Override public List<?> makeRow(NamespaceMeta object) { return Lists.newArrayList(object.getName(), object.getDescription(), NamespaceCommandUtils.prettyPrintNamespaceConfigCLI(object.getConfig())); } }).build();
@Override public List<?> makeRow(NamespaceMeta object) { return Lists.newArrayList(object.getName(), object.getDescription(), NamespaceCommandUtils.prettyPrintNamespaceConfigCLI(object.getConfig())); } }).build();
@Override public List<?> makeRow(NamespaceMeta object) { return Lists.newArrayList(object.getName(), object.getDescription(), NamespaceCommandUtils.prettyPrintNamespaceConfigCLI(object.getConfig())); } }).build();
@Override public List<?> makeRow(NamespaceMeta object) { return Lists.newArrayList(object.getName(), object.getDescription(), NamespaceCommandUtils.prettyPrintNamespaceConfigCLI(object.getConfig())); } }).build();
@Override public Location get(NamespaceMeta namespaceMeta) throws IOException { String rootDirectory = namespaceMeta.getConfig().getRootDirectory(); if (Strings.isNullOrEmpty(rootDirectory)) { // if no custom mapping was specified, then use the default namespaces location return getNonCustomMappedLocation(namespaceMeta.getNamespaceId()); } return Locations.getLocationFromAbsolutePath(locationFactory, rootDirectory); }
/** * Lists all namespaces * * @return a list of {@link NamespaceMeta} for all namespaces */ @Override public List<NamespaceMeta> list() throws Exception { List<NamespaceMeta> namespaces = nsStore.list(); final Principal principal = authenticationContext.getPrincipal(); //noinspection ConstantConditions return AuthorizationUtil.isVisible(namespaces, authorizationEnforcer, principal, NamespaceMeta::getNamespaceId, input -> principal.getName().equals(input.getConfig().getPrincipal())); }
@Override public Location get(NamespaceMeta namespaceMeta) throws IOException { String rootDirectory = namespaceMeta.getConfig().getRootDirectory(); if (isReservedNamespace(namespaceMeta.getNamespaceId()) || Strings.isNullOrEmpty(rootDirectory)) { // if no custom mapping was specified, then use the default namespaces location return getNonCustomMappedLocation(namespaceMeta.getNamespaceId()); } return Locations.getLocationFromAbsolutePath(locationFactory, rootDirectory); }
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(); } }