private NamespaceDescriptor getNamespaceDescriptor(String namespaceAsString) { try { return this.master.getClusterSchema().getNamespace(namespaceAsString); } catch (IOException e) { LOG.error("Error while fetching namespace descriptor for namespace : " + namespaceAsString); return null; } }
protected static TableNamespaceManager getTableNamespaceManager(MasterProcedureEnv env) { return env.getMasterServices().getClusterSchema().getTableNamespaceManager(); }
/** * Initialize namespace state cache by scanning meta table. */ private void initialize() throws IOException { List<NamespaceDescriptor> namespaces = this.master.getClusterSchema().getNamespaces(); for (NamespaceDescriptor namespace : namespaces) { addNamespace(namespace.getName()); List<TableName> tables = this.master.listTableNamesByNamespace(namespace.getName()); for (TableName table : tables) { if (table.isSystemTable()) { continue; } List<RegionInfo> regions = MetaTableAccessor.getTableRegions(this.master.getConnection(), table, true); addTable(table, regions.size()); } } LOG.info("Finished updating state of " + nsStateCache.size() + " namespaces. "); initialized = true; }
"the RSGroup can be removed."); for (NamespaceDescriptor ns : master.getClusterSchema().getNamespaces()) { String nsGroup = ns.getConfigurationValue(RSGroupInfo.NAMESPACE_DESC_PROP_GROUP); if (nsGroup != null && nsGroup.equals(name)) {
boolean rsgroupHasServersOnline(TableDescriptor desc) throws IOException { String groupName; try { groupName = master.getClusterSchema().getNamespace(desc.getTableName().getNamespaceAsString()) .getConfigurationValue(RSGroupInfo.NAMESPACE_DESC_PROP_GROUP); if (groupName == null) { groupName = RSGroupInfo.DEFAULT_GROUP; } } catch (MasterNotRunningException | PleaseHoldException e) { LOG.info("Master has not initialized yet; temporarily using default RSGroup '" + RSGroupInfo.DEFAULT_GROUP + "' for deploy of system table"); groupName = RSGroupInfo.DEFAULT_GROUP; } RSGroupInfo rsGroupInfo = groupAdminServer.getRSGroupInfo(groupName); if (rsGroupInfo == null) { throw new ConstraintException( "Default RSGroup (" + groupName + ") for this table's " + "namespace does not exist."); } for (ServerName onlineServer : master.getServerManager().createDestinationServersList()) { if (rsGroupInfo.getServers().contains(onlineServer.getAddress())) { return true; } } return false; }
void assignTableToGroup(TableDescriptor desc) throws IOException { String groupName = master.getClusterSchema().getNamespace(desc.getTableName().getNamespaceAsString()) .getConfigurationValue(RSGroupInfo.NAMESPACE_DESC_PROP_GROUP); if (groupName == null) { groupName = RSGroupInfo.DEFAULT_GROUP; } RSGroupInfo rsGroupInfo = groupAdminServer.getRSGroupInfo(groupName); if (rsGroupInfo == null) { throw new ConstraintException("Default RSGroup (" + groupName + ") for this table's " + "namespace does not exist."); } if (!rsGroupInfo.containsTable(desc.getTableName())) { LOG.debug("Pre-moving table " + desc.getTableName() + " to RSGroup " + groupName); groupAdminServer.moveTables(Sets.newHashSet(desc.getTableName()), groupName); } }
boolean rsgroupHasServersOnline(TableDescriptor desc) throws IOException { String groupName; try { groupName = master.getClusterSchema().getNamespace(desc.getTableName().getNamespaceAsString()) .getConfigurationValue(RSGroupInfo.NAMESPACE_DESC_PROP_GROUP); if (groupName == null) { groupName = RSGroupInfo.DEFAULT_GROUP; } } catch (MasterNotRunningException | PleaseHoldException e) { LOG.info("Master has not initialized yet; temporarily using default RSGroup '" + RSGroupInfo.DEFAULT_GROUP + "' for deploy of system table"); groupName = RSGroupInfo.DEFAULT_GROUP; } RSGroupInfo rsGroupInfo = groupAdminServer.getRSGroupInfo(groupName); if (rsGroupInfo == null) { throw new ConstraintException( "Default RSGroup (" + groupName + ") for this table's " + "namespace does not exist."); } for (ServerName onlineServer : master.getServerManager().createDestinationServersList()) { if (rsGroupInfo.getServers().contains(onlineServer.getAddress())) { return true; } } return false; }
"the RSGroup can be removed."); for (NamespaceDescriptor ns: master.getClusterSchema().getNamespaces()) { String nsGroup = ns.getConfigurationValue(rsGroupInfo.NAMESPACE_DESC_PROP_GROUP); if (nsGroup != null && nsGroup.equals(name)) {
boolean rsgroupHasServersOnline(TableDescriptor desc) throws IOException { String groupName = master.getClusterSchema().getNamespace(desc.getTableName().getNamespaceAsString()) .getConfigurationValue(RSGroupInfo.NAMESPACE_DESC_PROP_GROUP); if (groupName == null) { groupName = RSGroupInfo.DEFAULT_GROUP; } RSGroupInfo rsGroupInfo = groupAdminServer.getRSGroupInfo(groupName); if (rsGroupInfo == null) { throw new ConstraintException( "Default RSGroup (" + groupName + ") for this table's " + "namespace does not exist."); } for (ServerName onlineServer : master.getServerManager().createDestinationServersList()) { if (rsGroupInfo.getServers().contains(onlineServer.getAddress())) { return true; } } return false; }
void assignTableToGroup(TableDescriptor desc) throws IOException { String groupName = master.getClusterSchema().getNamespace(desc.getTableName().getNamespaceAsString()) .getConfigurationValue(RSGroupInfo.NAMESPACE_DESC_PROP_GROUP); if (groupName == null) { groupName = RSGroupInfo.DEFAULT_GROUP; } RSGroupInfo rsGroupInfo = groupAdminServer.getRSGroupInfo(groupName); if (rsGroupInfo == null) { throw new ConstraintException("Default RSGroup (" + groupName + ") for this table's " + "namespace does not exist."); } if (!rsGroupInfo.containsTable(desc.getTableName())) { LOG.debug("Pre-moving table " + desc.getTableName() + " to RSGroup " + groupName); groupAdminServer.moveTables(Sets.newHashSet(desc.getTableName()), groupName); } }
void assignTableToGroup(TableDescriptor desc) throws IOException { String groupName = master.getClusterSchema().getNamespace(desc.getTableName().getNamespaceAsString()) .getConfigurationValue(RSGroupInfo.NAMESPACE_DESC_PROP_GROUP); if (groupName == null) { groupName = RSGroupInfo.DEFAULT_GROUP; } RSGroupInfo rsGroupInfo = groupAdminServer.getRSGroupInfo(groupName); if (rsGroupInfo == null) { throw new ConstraintException("Default RSGroup (" + groupName + ") for this table's " + "namespace does not exist."); } if (!rsGroupInfo.containsTable(desc.getTableName())) { LOG.debug("Pre-moving table " + desc.getTableName() + " to RSGroup " + groupName); groupAdminServer.moveTables(Sets.newHashSet(desc.getTableName()), groupName); } }
"the RSGroup can be removed."); for (NamespaceDescriptor ns: master.getClusterSchema().getNamespaces()) { String nsGroup = ns.getConfigurationValue(rsGroupInfo.NAMESPACE_DESC_PROP_GROUP); if (nsGroup != null && nsGroup.equals(name)) {