@VisibleForTesting protected void initClusterSchemaService() throws IOException, InterruptedException { this.clusterSchemaService = new ClusterSchemaServiceImpl(this); this.clusterSchemaService.startAsync(); try { this.clusterSchemaService.awaitRunning(getConfiguration().getInt( HBASE_MASTER_WAIT_ON_SERVICE_IN_SECONDS, DEFAULT_HBASE_MASTER_WAIT_ON_SERVICE_IN_SECONDS), TimeUnit.SECONDS); } catch (TimeoutException toe) { throw new IOException("Timedout starting ClusterSchemaService", toe); } }
/** * Get a Namespace * @param name Name of the Namespace * @return Namespace descriptor for <code>name</code> */ NamespaceDescriptor getNamespace(String name) throws IOException { checkInitialized(); if (this.cpHost != null) this.cpHost.preGetNamespaceDescriptor(name); NamespaceDescriptor nsd = this.clusterSchemaService.getNamespace(name); if (this.cpHost != null) this.cpHost.postGetNamespaceDescriptor(nsd); return nsd; }
/** * Get all Namespaces * @return All Namespace descriptors */ List<NamespaceDescriptor> getNamespaces() throws IOException { checkInitialized(); final List<NamespaceDescriptor> nsds = new ArrayList<>(); if (cpHost != null) { cpHost.preListNamespaceDescriptors(nsds); } nsds.addAll(this.clusterSchemaService.getNamespaces()); if (this.cpHost != null) { this.cpHost.postListNamespaceDescriptors(nsds); } return nsds; }
if (this.clusterSchemaService != null) { this.clusterSchemaService.stopAsync(); try { this.clusterSchemaService.awaitTerminated( getConfiguration().getInt(HBASE_MASTER_WAIT_ON_SERVICE_IN_SECONDS, DEFAULT_HBASE_MASTER_WAIT_ON_SERVICE_IN_SECONDS), TimeUnit.SECONDS);
if (namespace != null && namespace.length() > 0) { this.clusterSchemaService.getNamespace(namespace); allHtds = tableDescriptors.getByNamespace(namespace).values(); } else {
this.clusterSchemaService.getNamespace(namespace);