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

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

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

TableName.hashCode介绍

暂无

代码示例

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

  1. @Override
  2. public int hashCode() {
  3. int result = m_tableName != null ? m_tableName.hashCode() : 0;
  4. result = 31 * result + Arrays.hashCode(m_startRow);
  5. result = 31 * result + Arrays.hashCode(m_endRow);
  6. result = 31 * result + (m_regionLocation != null ? m_regionLocation.hashCode() : 0);
  7. return result;
  8. }
  9. }

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

  1. @Override
  2. public int hashCode() {
  3. int result = tableName != null ? tableName.hashCode() : 0;
  4. result = 31 * result + (scan != null ? scan.hashCode() : 0);
  5. result = 31 * result + (startRow != null ? Arrays.hashCode(startRow) : 0);
  6. result = 31 * result + (endRow != null ? Arrays.hashCode(endRow) : 0);
  7. result = 31 * result + (regionLocation != null ? regionLocation.hashCode() : 0);
  8. result = 31 * result + (encodedRegionName != null ? encodedRegionName.hashCode() : 0);
  9. return result;
  10. }
  11. }

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

  1. /**
  2. * For performance reasons, the ordering is not lexicographic.
  3. */
  4. @Override
  5. public int compareTo(TableName tableName) {
  6. if (this == tableName) return 0;
  7. if (this.hashCode < tableName.hashCode()) {
  8. return -1;
  9. }
  10. if (this.hashCode > tableName.hashCode()) {
  11. return 1;
  12. }
  13. return this.nameAsString.compareTo(tableName.getNameAsString());
  14. }

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

  1. /**
  2. * @return hash code
  3. */
  4. @Override
  5. public int hashCode() {
  6. int result = this.name.hashCode();
  7. if (this.families.size() > 0) {
  8. for (ColumnFamilyDescriptor e : this.families.values()) {
  9. result ^= e.hashCode();
  10. }
  11. }
  12. result ^= values.hashCode();
  13. return result;
  14. }

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

  1. @Override
  2. public int hashCode() {
  3. int result = (tableName != null ? tableName.hashCode() : 0);
  4. result = 31 * result + (state != null ? state.hashCode() : 0);
  5. return result;
  6. }

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

  1. @Override
  2. public int hashCode() {
  3. int hash = 33 * this.getBackupId().hashCode() + type.hashCode();
  4. hash = 33 * hash + rootDir.hashCode();
  5. hash = 33 * hash + Long.valueOf(startTs).hashCode();
  6. hash = 33 * hash + Long.valueOf(completeTs).hashCode();
  7. for (TableName table : tableList) {
  8. hash = 33 * hash + table.hashCode();
  9. }
  10. return hash;
  11. }

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

  1. public void reportMobCompactionStart(TableName tableName) throws IOException {
  2. IdLock.Entry lockEntry = null;
  3. try {
  4. lockEntry = mobCompactionLock.getLockEntry(tableName.hashCode());
  5. AtomicInteger compactionsCount = mobCompactionStates.get(tableName);
  6. if (compactionsCount == null) {
  7. compactionsCount = new AtomicInteger(0);
  8. mobCompactionStates.put(tableName, compactionsCount);
  9. }
  10. compactionsCount.incrementAndGet();
  11. } finally {
  12. if (lockEntry != null) {
  13. mobCompactionLock.releaseLockEntry(lockEntry);
  14. }
  15. }
  16. }

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

  1. public void reportMobCompactionEnd(TableName tableName) throws IOException {
  2. IdLock.Entry lockEntry = null;
  3. try {
  4. lockEntry = mobCompactionLock.getLockEntry(tableName.hashCode());
  5. AtomicInteger compactionsCount = mobCompactionStates.get(tableName);
  6. if (compactionsCount != null) {
  7. int count = compactionsCount.decrementAndGet();
  8. // remove the entry if the count is 0.
  9. if (count == 0) {
  10. mobCompactionStates.remove(tableName);
  11. }
  12. }
  13. } finally {
  14. if (lockEntry != null) {
  15. mobCompactionLock.releaseLockEntry(lockEntry);
  16. }
  17. }
  18. }

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

  1. public MetricsTableSourceImpl(String tblName,
  2. MetricsTableAggregateSourceImpl aggregate, MetricsTableWrapperAggregate tblWrapperAgg) {
  3. LOG.debug("Creating new MetricsTableSourceImpl for table '{}'", tblName);
  4. this.tableName = TableName.valueOf(tblName);
  5. this.agg = aggregate;
  6. this.tableWrapperAgg = tblWrapperAgg;
  7. this.registry = agg.getMetricsRegistry();
  8. this.tableNamePrefix = "Namespace_" + this.tableName.getNamespaceAsString() +
  9. "_table_" + this.tableName.getQualifierAsString() + "_metric_";
  10. this.hashCode = this.tableName.hashCode();
  11. }

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

  1. @Override
  2. public int hashCode() {
  3. int hash = Arrays.hashCode(getRegionName());
  4. hash = (int) (hash ^ getRegionId());
  5. hash ^= Arrays.hashCode(getStartKey());
  6. hash ^= Arrays.hashCode(getEndKey());
  7. hash ^= Boolean.valueOf(isOffline()).hashCode();
  8. hash ^= getTable().hashCode();
  9. if (regionServer != null) {
  10. hash ^= regionServer.hashCode();
  11. }
  12. hash = (int) (hash ^ modTime);
  13. return hash;
  14. }
  15. }

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

  1. @Override
  2. public int hashCode() {
  3. final int prime = 37;
  4. int result = super.hashCode();
  5. if (table != null) {
  6. result = prime * result + table.hashCode();
  7. }
  8. if (family != null) {
  9. result = prime * result + Bytes.hashCode(family);
  10. }
  11. if (qualifier != null) {
  12. result = prime * result + Bytes.hashCode(qualifier);
  13. }
  14. return result;
  15. }

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

  1. "\n");
  2. final Random rand = new Random(tableName.hashCode() * 17L + 12938197137L);
  3. final int numCF = families.size();
  4. final byte[][] cfBytes = new byte[numCF][];

代码示例来源:origin: org.apache.hbase/hbase-client

  1. /**
  2. * @return hash code
  3. */
  4. @Override
  5. public int hashCode() {
  6. int result = this.name.hashCode();
  7. if (this.families.size() > 0) {
  8. for (ColumnFamilyDescriptor e : this.families.values()) {
  9. result ^= e.hashCode();
  10. }
  11. }
  12. result ^= values.hashCode();
  13. return result;
  14. }

代码示例来源:origin: org.apache.hbase/hbase-client

  1. @Override
  2. public int hashCode() {
  3. int result = (tableName != null ? tableName.hashCode() : 0);
  4. result = 31 * result + (state != null ? state.hashCode() : 0);
  5. return result;
  6. }

代码示例来源:origin: org.apache.hbase/hbase-client

  1. @Override
  2. public int hashCode() {
  3. final int prime = 37;
  4. int result = super.hashCode();
  5. if (table != null) {
  6. result = prime * result + table.hashCode();
  7. }
  8. if (family != null) {
  9. result = prime * result + Bytes.hashCode(family);
  10. }
  11. if (qualifier != null) {
  12. result = prime * result + Bytes.hashCode(qualifier);
  13. }
  14. if (namespace != null) {
  15. result = prime * result + namespace.hashCode();
  16. }
  17. return result;
  18. }

代码示例来源:origin: harbby/presto-connectors

  1. @Override
  2. public int hashCode() {
  3. int result = m_tableName != null ? m_tableName.hashCode() : 0;
  4. result = 31 * result + Arrays.hashCode(m_startRow);
  5. result = 31 * result + Arrays.hashCode(m_endRow);
  6. result = 31 * result + (m_regionLocation != null ? m_regionLocation.hashCode() : 0);
  7. return result;
  8. }
  9. }

代码示例来源:origin: org.apache.hbase/hbase-mapreduce

  1. @Override
  2. public int hashCode() {
  3. int result = m_tableName != null ? m_tableName.hashCode() : 0;
  4. result = 31 * result + Arrays.hashCode(m_startRow);
  5. result = 31 * result + Arrays.hashCode(m_endRow);
  6. result = 31 * result + (m_regionLocation != null ? m_regionLocation.hashCode() : 0);
  7. return result;
  8. }
  9. }

代码示例来源:origin: com.aliyun.hbase/alihbase-mapreduce

  1. @Override
  2. public int hashCode() {
  3. int result = tableName != null ? tableName.hashCode() : 0;
  4. result = 31 * result + (scan != null ? scan.hashCode() : 0);
  5. result = 31 * result + (startRow != null ? Arrays.hashCode(startRow) : 0);
  6. result = 31 * result + (endRow != null ? Arrays.hashCode(endRow) : 0);
  7. result = 31 * result + (regionLocation != null ? regionLocation.hashCode() : 0);
  8. result = 31 * result + (encodedRegionName != null ? encodedRegionName.hashCode() : 0);
  9. return result;
  10. }
  11. }

代码示例来源:origin: com.aliyun.hbase/alihbase-client

  1. @Override
  2. public int hashCode() {
  3. int result = (tableName != null ? tableName.hashCode() : 0);
  4. result = 31 * result + (state != null ? state.hashCode() : 0);
  5. return result;
  6. }

代码示例来源:origin: org.apache.hbase/hbase-hadoop2-compat

  1. public MetricsTableSourceImpl(String tblName,
  2. MetricsTableAggregateSourceImpl aggregate, MetricsTableWrapperAggregate tblWrapperAgg) {
  3. LOG.debug("Creating new MetricsTableSourceImpl for table ");
  4. this.tableName = TableName.valueOf(tblName);
  5. this.agg = aggregate;
  6. agg.register(tblName, this);
  7. this.tableWrapperAgg = tblWrapperAgg;
  8. this.registry = agg.getMetricsRegistry();
  9. this.tableNamePrefix = "Namespace_" + this.tableName.getNamespaceAsString() +
  10. "_table_" + this.tableName.getQualifierAsString() + "_metric_";
  11. this.hashCode = this.tableName.hashCode();
  12. }

相关文章