@Override public void delete() throws IOException { QuotaUtil.deleteUserQuota(masterServices.getConnection(), userName, namespace); } @Override
@Override public void delete() throws IOException { QuotaUtil.deleteTableQuota(masterServices.getConnection(), table); } @Override
@Override public GlobalQuotaSettingsImpl fetch() throws IOException { return new GlobalQuotaSettingsImpl(userName, table, null, null, QuotaUtil.getUserQuota(masterServices.getConnection(), userName, table)); } @Override
@Override public void update(GlobalQuotaSettingsImpl quotaPojo) throws IOException { QuotaUtil.addTableQuota(masterServices.getConnection(), table, quotaPojo.toQuotas()); } @Override
@Override public void update(GlobalQuotaSettingsImpl quotaPojo) throws IOException { QuotaUtil.addUserQuota(masterServices.getConnection(), userName, table, quotaPojo.toQuotas()); } @Override
@Override public GlobalQuotaSettingsImpl fetch() throws IOException { return new GlobalQuotaSettingsImpl(userName, null, namespace, null, QuotaUtil.getUserQuota(masterServices.getConnection(), userName, namespace)); } @Override
@Override public void update(GlobalQuotaSettingsImpl quotaPojo) throws IOException { QuotaUtil.addRegionServerQuota(masterServices.getConnection(), regionServer, ((GlobalQuotaSettingsImpl) quotaPojo).toQuotas()); }
@Override public void update(GlobalQuotaSettingsImpl quotaPojo) throws IOException { QuotaUtil.addUserQuota(masterServices.getConnection(), userName, quotaPojo.toQuotas()); } @Override
@Override public void update(GlobalQuotaSettingsImpl quotaPojo) throws IOException { QuotaUtil.addUserQuota(masterServices.getConnection(), userName, namespace, quotaPojo.toQuotas()); } @Override
@Override public GlobalQuotaSettingsImpl fetch() throws IOException { return new GlobalQuotaSettingsImpl(null, null, null, regionServer, QuotaUtil.getRegionServerQuota(masterServices.getConnection(), regionServer)); }
@Override public GlobalQuotaSettingsImpl fetch() throws IOException { return new GlobalQuotaSettingsImpl(null, null, namespace, null, QuotaUtil.getNamespaceQuota(masterServices.getConnection(), namespace)); } @Override
CatalogJanitor(final MasterServices services) { super("CatalogJanitor-" + services.getServerName().toShortString(), services, services.getConfiguration().getInt("hbase.catalogjanitor.interval", 300000)); this.services = services; this.connection = services.getConnection(); }
@Nullable private TableState readMetaState(TableName tableName) throws IOException { TableState.State state = tableName2State.get(tableName); if (state != null) { return new TableState(tableName, state); } TableState tableState = MetaTableAccessor.getTableState(master.getConnection(), tableName); if (tableState != null) { tableName2State.putIfAbsent(tableName, tableState.getState()); } return tableState; }
/** * Add the specified set of regions to the hbase:meta table. */ private static void addRegionsToMeta(final MasterProcedureEnv env, final TableDescriptor tableDescriptor, final List<RegionInfo> regionInfos) throws IOException { MetaTableAccessor.addRegionsToMeta(env.getMasterServices().getConnection(), regionInfos, tableDescriptor.getRegionReplication()); }
public void start() throws IOException { TableDescriptors tableDescriptors = master.getTableDescriptors(); migrateZooKeeper(); Connection connection = master.getConnection(); fixTableStates(tableDescriptors, connection); }
private static void addRegionsToMeta(final MasterProcedureEnv env, final TableDescriptor tableDescriptor, final List<RegionInfo> regionInfos) throws IOException { MetaTableAccessor.addRegionsToMeta(env.getMasterServices().getConnection(), regionInfos, tableDescriptor.getRegionReplication()); } /**
/** * Check whether a table is modifiable - exists and either offline or online with config set * @param env MasterProcedureEnv * @throws IOException */ @Override protected void checkTableModifiable(final MasterProcedureEnv env) throws IOException { // Checks whether the table exists if (!MetaTableAccessor.tableExists(env.getMasterServices().getConnection(), getTableName())) { throw new TableNotFoundException(getTableName()); } }
/** * Check whether a table is modifiable - exists and either offline or online with config set * @param env MasterProcedureEnv * @throws IOException */ protected void checkTableModifiable(final MasterProcedureEnv env) throws IOException { // Checks whether the table exists if (!MetaTableAccessor.tableExists(env.getMasterServices().getConnection(), getTableName())) { throw new TableNotFoundException(getTableName()); } }
public void splitRegion(RegionInfo parent, RegionInfo hriA, RegionInfo hriB, ServerName serverName) throws IOException { TableDescriptor htd = getTableDescriptor(parent.getTable()); long parentOpenSeqNum = HConstants.NO_SEQNUM; if (htd.hasGlobalReplicationScope()) { parentOpenSeqNum = getOpenSeqNumForParentRegion(parent); } MetaTableAccessor.splitRegion(master.getConnection(), parent, parentOpenSeqNum, hriA, hriB, serverName, getRegionReplication(htd)); }
public void mergeRegions(RegionInfo child, RegionInfo hriA, RegionInfo hriB, ServerName serverName) throws IOException { TableDescriptor htd = getTableDescriptor(child.getTable()); long regionAOpenSeqNum = -1L; long regionBOpenSeqNum = -1L; if (htd.hasGlobalReplicationScope()) { regionAOpenSeqNum = getOpenSeqNumForParentRegion(hriA); regionBOpenSeqNum = getOpenSeqNumForParentRegion(hriB); } MetaTableAccessor.mergeRegions(master.getConnection(), child, hriA, regionAOpenSeqNum, hriB, regionBOpenSeqNum, serverName, getRegionReplication(htd)); }