@Override public boolean apply(NamespaceMeta input) { return input.getName().equals(namespaceId.getNamespace()); } });
@Override public Collection<String> get() { List<String> namespaceIds = new ArrayList<>(); try { for (NamespaceMeta namespaceMeta : namespaceClient.list()) { namespaceIds.add(namespaceMeta.getName()); } } catch (Exception e) { return Lists.newArrayList(); } return namespaceIds; } });
@Override public boolean apply(NamespaceMeta input) { return input.getName().equals(namespaceId.getNamespace()); } });
@Override public Collection<String> get() { List<String> namespaceIds = new ArrayList<>(); try { for (NamespaceMeta namespaceMeta : namespaceClient.list()) { namespaceIds.add(namespaceMeta.getName()); } } catch (Exception e) { return Lists.newArrayList(); } return namespaceIds; } });
@Override public Void call() throws Exception { LOG.info("Upgrading queue state store: {}", tableId); DatasetId stateStoreId = createStateStoreDataset(namespaceMeta.getName()); DatasetAdmin datasetAdmin = datasetFramework.getAdmin(stateStoreId, null); if (datasetAdmin == null) { LOG.error("No dataset admin available for {}", stateStoreId); return null; } datasetAdmin.upgrade(); LOG.info("Upgraded queue state store: {}", tableId); return null; } };
/** * Create the namespace using the namespace meta * * @param metadata the namespace metadata for the namespace */ public void create(NamespaceMeta metadata) { write(getNamespaceKey(metadata.getName()), metadata); }
public void createNamespace(NamespaceMeta namespace) throws ExploreException, SQLException { if (!exploreEnabled) { return; } ListenableFuture<ExploreExecutionResult> futureSuccess = exploreClient.addNamespace(namespace); handleExploreFuture(futureSuccess, "add", "namespace", namespace.getName()); }
public void createNamespace(NamespaceMeta namespace) throws ExploreException, SQLException { if (!exploreEnabled) { return; } ListenableFuture<ExploreExecutionResult> futureSuccess = exploreClient.addNamespace(namespace); handleExploreFuture(futureSuccess, "add", "namespace", namespace.getName()); }
/** * Create the namespace using the namespace meta * * @param metadata the namespace metadata for the namespace */ public void create(NamespaceMeta metadata) { write(getNamespaceKey(metadata.getName()), metadata); }
public void createNamespace(NamespaceMeta metadata) { write(getNamespaceKey(metadata.getName()), metadata); }
public void createNamespace(NamespaceMeta metadata) { write(getNamespaceKey(metadata.getName()), metadata); }
@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 QueryHandle createNamespace(NamespaceMeta namespace) throws ExploreException, SQLException { HttpResponse response = doPut(String.format("data/explore/namespaces/%s", namespace.getName()), GSON.toJson(namespace), null); if (response.getResponseCode() == HttpURLConnection.HTTP_OK) { return QueryHandle.fromId(parseResponseAsMap(response, "handle")); } throw new ExploreException("Cannot add a namespace. Reason: " + response); }
@Override public QueryHandle createNamespace(NamespaceMeta namespace) throws ExploreException, SQLException { HttpResponse response = doPut(String.format("data/explore/namespaces/%s", namespace.getName()), GSON.toJson(namespace), null); if (response.getResponseCode() == HttpURLConnection.HTTP_OK) { return QueryHandle.fromId(parseResponseAsMap(response, "handle")); } throw new ExploreException("Cannot add a namespace. Reason: " + response); }
@Override public synchronized void create(NamespaceMeta metadata) throws Exception { NamespaceId id = new NamespaceId(metadata.getName()); NamespaceMeta existing = namespaces.putIfAbsent(id, metadata); if (existing != null) { throw new NamespaceAlreadyExistsException(id); } }
private static void verifyAlreadyExist(NamespaceMeta namespaceMeta, NamespaceId existingNamespace) throws Exception { try { namespaceAdmin.create(namespaceMeta); Assert.fail(String.format("Namespace '%s' should not have been created", namespaceMeta.getName())); } catch (BadRequestException e) { Assert.assertTrue(e.getMessage().contains(existingNamespace.getNamespace())); } }
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(); } }