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

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

本文整理了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

/**
 * @return true if this region is from a system table
 */
public boolean isSystemTable() {
 return tableName.isSystemTable();
}

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

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

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

/**
 * @return the region name
 */
@XmlAttribute
public String getName() {
 byte [] tableNameAsBytes = Bytes.toBytes(this.table);
 TableName tableName = TableName.valueOf(tableNameAsBytes);
 byte [] nameAsBytes = HRegionInfo.createRegionName(
  tableName, this.startKey, this.id, !tableName.isSystemTable());
 return Bytes.toString(nameAsBytes);
}

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

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

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

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

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

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

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

AccessControlFilter(AuthManager mgr, User ugi, TableName tableName,
  Strategy strategy, Map<ByteRange, Integer> cfVsMaxVersions) {
 authManager = mgr;
 table = tableName;
 user = ugi;
 isSystemTable = tableName.isSystemTable();
 this.strategy = strategy;
 this.cfVsMaxVersions = cfVsMaxVersions;
 this.prevFam = new SimpleMutableByteRange();
 this.prevQual = new SimpleMutableByteRange();
}

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

protected static void deleteTableStates(final MasterProcedureEnv env, final TableName tableName)
   throws IOException {
  if (!tableName.isSystemTable()) {
   ProcedureSyncWait.getMasterQuotaManager(env).removeTableFromNamespaceQuota(tableName);
  }
 }
}

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

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

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

@Override
 public Entry filter(Entry entry) {
  if (entry.getKey().getTableName().isSystemTable()) {
   return null;
  }
  return entry;
 }
}

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

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

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

/**
 * Returns the limiter associated to the specified user/table.
 *
 * @param ugi the user to limit
 * @param table the table to limit
 * @return the limiter associated to the specified user/table
 */
public QuotaLimiter getUserLimiter(final UserGroupInformation ugi, final TableName table) {
 if (table.isSystemTable()) {
  return NoopQuotaLimiter.get();
 }
 return getUserQuotaState(ugi).getTableLimiter(table);
}

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

TableBuilderBase(TableName tableName, ConnectionConfiguration connConf) {
 if (tableName == null) {
  throw new IllegalArgumentException("Given table name is null");
 }
 this.tableName = tableName;
 this.operationTimeout = tableName.isSystemTable() ? connConf.getMetaOperationTimeout()
   : connConf.getOperationTimeout();
 this.rpcTimeout = connConf.getRpcTimeout();
 this.readRpcTimeout = connConf.getReadRpcTimeout();
 this.writeRpcTimeout = connConf.getWriteRpcTimeout();
}

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

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

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

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

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

@Override
public void preOpen(ObserverContext<RegionCoprocessorEnvironment> c) throws IOException {
 try {
  if (!c.getEnvironment().getRegion().getRegionInfo().getTable().isSystemTable()) {
   LOG.info("begin to sleep");
   Thread.sleep(10000);
   LOG.info("finish sleep");
  }
 } catch (Throwable t) {
 }
}

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

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

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

AsyncTableBuilderBase(TableName tableName, AsyncConnectionConfiguration connConf) {
 this.tableName = tableName;
 this.operationTimeoutNs = tableName.isSystemTable() ? connConf.getMetaOperationTimeoutNs()
  : connConf.getOperationTimeoutNs();
 this.scanTimeoutNs = connConf.getScanTimeoutNs();
 this.rpcTimeoutNs = connConf.getRpcTimeoutNs();
 this.readRpcTimeoutNs = connConf.getReadRpcTimeoutNs();
 this.writeRpcTimeoutNs = connConf.getWriteRpcTimeoutNs();
 this.pauseNs = connConf.getPauseNs();
 this.maxAttempts = retries2Attempts(connConf.getMaxRetries());
 this.startLogErrorsCnt = connConf.getStartLogErrorsCnt();
}

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

@Override
 public void prePut(ObserverContext<RegionCoprocessorEnvironment> e, Put put, WALEdit edit,
   Durability durability) throws IOException {
  Region region = e.getEnvironment().getRegion();
  if (!region.getRegionInfo().isMetaRegion()
    && !region.getRegionInfo().getTable().isSystemTable()) {
   // The put carries the TTL attribute
   if (put.getTTL() != Long.MAX_VALUE) {
    return;
   }
   throw new IOException("Operation does not have TTL set");
  }
 }
}

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

@Override
 public void prePut(ObserverContext<RegionCoprocessorEnvironment> e, Put put, WALEdit edit,
   Durability durability) throws IOException {
  Region region = e.getEnvironment().getRegion();
  if (!region.getRegionInfo().isMetaRegion()
    && !region.getRegionInfo().getTable().isSystemTable()) {
   if (put.getAttribute(TEST_ATR_KEY) != null) {
    LOG.debug("allow any put to happen " + region.getRegionInfo().getRegionNameAsString());
   } else {
    e.bypass();
   }
  }
 }
}

相关文章