org.apache.hadoop.hbase.TableName.isSystemTable()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(7.0k)|赞(0)|评价(0)|浏览(257)

本文整理了Java中org.apache.hadoop.hbase.TableName.isSystemTable()方法的一些代码示例,展示了TableName.isSystemTable()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TableName.isSystemTable()方法的具体详情如下:
包路径:org.apache.hadoop.hbase.TableName
类名称:TableName
方法名:isSystemTable

TableName.isSystemTable介绍

暂无

代码示例

代码示例来源:origin: apache/hbase

  1. /**
  2. * @return true if this region is from a system table
  3. */
  4. public boolean isSystemTable() {
  5. return tableName.isSystemTable();
  6. }

代码示例来源:origin: apache/hbase

  1. @Override
  2. public void setPriority(final TableName tn) {
  3. setPriority(
  4. tn != null && tn.isSystemTable() ? HConstants.SYSTEMTABLE_QOS : HConstants.NORMAL_QOS);
  5. }

代码示例来源:origin: apache/hbase

  1. /**
  2. * @return the region name
  3. */
  4. @XmlAttribute
  5. public String getName() {
  6. byte [] tableNameAsBytes = Bytes.toBytes(this.table);
  7. TableName tableName = TableName.valueOf(tableNameAsBytes);
  8. byte [] nameAsBytes = HRegionInfo.createRegionName(
  9. tableName, this.startKey, this.id, !tableName.isSystemTable());
  10. return Bytes.toString(nameAsBytes);
  11. }

代码示例来源:origin: apache/hbase

  1. @Override
  2. protected boolean shouldWaitClientAck(MasterProcedureEnv env) {
  3. // system tables are created on bootstrap internally by the system
  4. // the client does not know about this procedures.
  5. return !getTableName().isSystemTable();
  6. }

代码示例来源:origin: apache/hbase

  1. /**
  2. * Check if a region belongs to some system table.
  3. * If so, the primary replica may be expected to be put on the master regionserver.
  4. */
  5. public boolean shouldBeOnMaster(RegionInfo region) {
  6. return (this.maintenanceMode || this.onlySystemTablesOnMaster)
  7. && region.getTable().isSystemTable();
  8. }

代码示例来源:origin: apache/hbase

  1. private void checkTableTypeAndThrowException(TableName name) throws IOException {
  2. if (name.isSystemTable()) {
  3. LOG.debug("Namespace auditor checks not performed for table " + name.getNameAsString());
  4. } else {
  5. throw new HBaseIOException(
  6. name + " is being created even before namespace auditor has been initialized.");
  7. }
  8. }

代码示例来源:origin: apache/hbase

  1. AccessControlFilter(AuthManager mgr, User ugi, TableName tableName,
  2. Strategy strategy, Map<ByteRange, Integer> cfVsMaxVersions) {
  3. authManager = mgr;
  4. table = tableName;
  5. user = ugi;
  6. isSystemTable = tableName.isSystemTable();
  7. this.strategy = strategy;
  8. this.cfVsMaxVersions = cfVsMaxVersions;
  9. this.prevFam = new SimpleMutableByteRange();
  10. this.prevQual = new SimpleMutableByteRange();
  11. }

代码示例来源:origin: apache/hbase

  1. protected static void deleteTableStates(final MasterProcedureEnv env, final TableName tableName)
  2. throws IOException {
  3. if (!tableName.isSystemTable()) {
  4. ProcedureSyncWait.getMasterQuotaManager(env).removeTableFromNamespaceQuota(tableName);
  5. }
  6. }
  7. }

代码示例来源:origin: apache/hbase

  1. @Override
  2. protected boolean waitInitialized(MasterProcedureEnv env) {
  3. if (getTableName().isSystemTable()) {
  4. // Creating system table is part of the initialization, so do not wait here.
  5. return false;
  6. }
  7. return super.waitInitialized(env);
  8. }

代码示例来源:origin: apache/hbase

  1. @Override
  2. public Entry filter(Entry entry) {
  3. if (entry.getKey().getTableName().isSystemTable()) {
  4. return null;
  5. }
  6. return entry;
  7. }
  8. }

代码示例来源:origin: apache/hbase

  1. @Override
  2. public void setPriority(TableName tn) {
  3. super.setPriority(tn);
  4. // ignore counts for system tables - it could change and we really only want to check on what
  5. // the client should change
  6. if (tn != null && !tn.isSystemTable()) {
  7. TABLE_PRIORITY.incrementAndGet();
  8. }
  9. }
  10. }

代码示例来源:origin: apache/hbase

  1. /**
  2. * Returns the limiter associated to the specified user/table.
  3. *
  4. * @param ugi the user to limit
  5. * @param table the table to limit
  6. * @return the limiter associated to the specified user/table
  7. */
  8. public QuotaLimiter getUserLimiter(final UserGroupInformation ugi, final TableName table) {
  9. if (table.isSystemTable()) {
  10. return NoopQuotaLimiter.get();
  11. }
  12. return getUserQuotaState(ugi).getTableLimiter(table);
  13. }

代码示例来源:origin: apache/hbase

  1. TableBuilderBase(TableName tableName, ConnectionConfiguration connConf) {
  2. if (tableName == null) {
  3. throw new IllegalArgumentException("Given table name is null");
  4. }
  5. this.tableName = tableName;
  6. this.operationTimeout = tableName.isSystemTable() ? connConf.getMetaOperationTimeout()
  7. : connConf.getOperationTimeout();
  8. this.rpcTimeout = connConf.getRpcTimeout();
  9. this.readRpcTimeout = connConf.getReadRpcTimeout();
  10. this.writeRpcTimeout = connConf.getWriteRpcTimeout();
  11. }

代码示例来源:origin: apache/hbase

  1. @Override
  2. public boolean preScannerNext(final ObserverContext<RegionCoprocessorEnvironment> e,
  3. final InternalScanner s, final List<Result> results,
  4. final int limit, final boolean hasMore) throws IOException {
  5. final TableName tableName = e.getEnvironment().getRegionInfo().getTable();
  6. if (!tableName.isSystemTable() && (faults++ % 2) == 0) {
  7. LOG.debug(" Injecting fault in table=" + tableName + " scanner");
  8. throw new IOException("injected fault");
  9. }
  10. return hasMore;
  11. }
  12. }

代码示例来源:origin: apache/hbase

  1. @Override
  2. public void preCreateTableAction(
  3. final ObserverContext<MasterCoprocessorEnvironment> ctx,
  4. final TableDescriptor desc,
  5. final RegionInfo[] regions) throws IOException {
  6. if (!desc.getTableName().isSystemTable() && !rsgroupHasServersOnline(desc)) {
  7. throw new HBaseIOException("No online servers in the rsgroup, which table " +
  8. desc.getTableName().getNameAsString() + " belongs to");
  9. }
  10. }

代码示例来源:origin: apache/hbase

  1. @Override
  2. public void preOpen(ObserverContext<RegionCoprocessorEnvironment> c) throws IOException {
  3. try {
  4. if (!c.getEnvironment().getRegion().getRegionInfo().getTable().isSystemTable()) {
  5. LOG.info("begin to sleep");
  6. Thread.sleep(10000);
  7. LOG.info("finish sleep");
  8. }
  9. } catch (Throwable t) {
  10. }
  11. }

代码示例来源:origin: apache/hbase

  1. @Override
  2. public void preClose(ObserverContext<RegionCoprocessorEnvironment> c, boolean abortRequested)
  3. throws IOException {
  4. if (!c.getEnvironment().getRegion().getRegionInfo().getTable().isSystemTable()) {
  5. LOG.info("begin to sleep");
  6. countDownLatch.countDown();
  7. // Sleep here so we can stuck the RPC call
  8. Threads.sleep(10000);
  9. LOG.info("finish sleep");
  10. }
  11. }

代码示例来源:origin: apache/hbase

  1. AsyncTableBuilderBase(TableName tableName, AsyncConnectionConfiguration connConf) {
  2. this.tableName = tableName;
  3. this.operationTimeoutNs = tableName.isSystemTable() ? connConf.getMetaOperationTimeoutNs()
  4. : connConf.getOperationTimeoutNs();
  5. this.scanTimeoutNs = connConf.getScanTimeoutNs();
  6. this.rpcTimeoutNs = connConf.getRpcTimeoutNs();
  7. this.readRpcTimeoutNs = connConf.getReadRpcTimeoutNs();
  8. this.writeRpcTimeoutNs = connConf.getWriteRpcTimeoutNs();
  9. this.pauseNs = connConf.getPauseNs();
  10. this.maxAttempts = retries2Attempts(connConf.getMaxRetries());
  11. this.startLogErrorsCnt = connConf.getStartLogErrorsCnt();
  12. }

代码示例来源:origin: apache/hbase

  1. @Override
  2. public void prePut(ObserverContext<RegionCoprocessorEnvironment> e, Put put, WALEdit edit,
  3. Durability durability) throws IOException {
  4. Region region = e.getEnvironment().getRegion();
  5. if (!region.getRegionInfo().isMetaRegion()
  6. && !region.getRegionInfo().getTable().isSystemTable()) {
  7. // The put carries the TTL attribute
  8. if (put.getTTL() != Long.MAX_VALUE) {
  9. return;
  10. }
  11. throw new IOException("Operation does not have TTL set");
  12. }
  13. }
  14. }

代码示例来源:origin: apache/hbase

  1. @Override
  2. public void prePut(ObserverContext<RegionCoprocessorEnvironment> e, Put put, WALEdit edit,
  3. Durability durability) throws IOException {
  4. Region region = e.getEnvironment().getRegion();
  5. if (!region.getRegionInfo().isMetaRegion()
  6. && !region.getRegionInfo().getTable().isSystemTable()) {
  7. if (put.getAttribute(TEST_ATR_KEY) != null) {
  8. LOG.debug("allow any put to happen " + region.getRegionInfo().getRegionNameAsString());
  9. } else {
  10. e.bypass();
  11. }
  12. }
  13. }
  14. }

相关文章