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

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

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

TableName.<init>介绍

[英]This is only for the old and meta tables.
[中]这只适用于旧表和元表。

代码示例

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

  1. /**
  2. * It is used to create table names for old META, and ROOT table.
  3. * These tables are not really legal tables. They are not added into the cache.
  4. * @return a dummy TableName instance (with no validation) for the passed qualifier
  5. */
  6. private static TableName getADummyTableName(String qualifier) {
  7. return new TableName(qualifier);
  8. }

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

  1. /**
  2. * Check that the object does not exist already. There are two reasons for creating the objects
  3. * only once:
  4. * 1) With 100K regions, the table names take ~20MB.
  5. * 2) Equals becomes much faster as it's resolved with a reference and an int comparison.
  6. */
  7. private static TableName createTableNameIfNecessary(ByteBuffer bns, ByteBuffer qns) {
  8. for (TableName tn : tableCache) {
  9. if (Bytes.equals(tn.getQualifier(), qns) && Bytes.equals(tn.getNamespace(), bns)) {
  10. return tn;
  11. }
  12. }
  13. TableName newTable = new TableName(bns, qns);
  14. if (tableCache.add(newTable)) { // Adds the specified element if it is not already present
  15. return newTable;
  16. }
  17. // Someone else added it. Let's find it.
  18. for (TableName tn : tableCache) {
  19. if (Bytes.equals(tn.getQualifier(), qns) && Bytes.equals(tn.getNamespace(), bns)) {
  20. return tn;
  21. }
  22. }
  23. // this should never happen.
  24. throw new IllegalStateException(newTable + " was supposed to be in the cache");
  25. }

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

  1. /**
  2. * It is used to create table names for old META, and ROOT table.
  3. * These tables are not really legal tables. They are not added into the cache.
  4. * @return a dummy TableName instance (with no validation) for the passed qualifier
  5. */
  6. private static TableName getADummyTableName(String qualifier) {
  7. return new TableName(qualifier);
  8. }

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

  1. /**
  2. * It is used to create table names for old META, and ROOT table.
  3. * These tables are not really legal tables. They are not added into the cache.
  4. * @return a dummy TableName instance (with no validation) for the passed qualifier
  5. */
  6. private static TableName getADummyTableName(String qualifier) {
  7. return new TableName(qualifier);
  8. }

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

  1. /**
  2. * It is used to create table names for old META, and ROOT table.
  3. * These tables are not really legal tables. They are not added into the cache.
  4. * @return a dummy TableName instance (with no validation) for the passed qualifier
  5. */
  6. private static TableName getADummyTableName(String qualifier) {
  7. return new TableName(qualifier);
  8. }

代码示例来源:origin: stackoverflow.com

  1. TableName papa = new TableName();
  2. papa.setParent(null); // parent
  3. TableName kid1 = new TableName();
  4. kid1.setParent(papa);
  5. papa.getChildren().add(kid1);
  6. TableName kid1_1 = new TableName();
  7. kid1_1.setParent(kid1);
  8. kid1.getChildren().add(kid1_1);
  9. TableName kid2 = new TableName();
  10. kid2.setParent(papa);
  11. papa.getChildren().add(kid2);
  12. session.save(papa)

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

  1. /**
  2. * Check that the object does not exist already. There are two reasons for creating the objects
  3. * only once:
  4. * 1) With 100K regions, the table names take ~20MB.
  5. * 2) Equals becomes much faster as it's resolved with a reference and an int comparison.
  6. */
  7. private static TableName createTableNameIfNecessary(ByteBuffer bns, ByteBuffer qns) {
  8. for (TableName tn : tableCache) {
  9. if (Bytes.equals(tn.getQualifier(), qns) && Bytes.equals(tn.getNamespace(), bns)) {
  10. return tn;
  11. }
  12. }
  13. TableName newTable = new TableName(bns, qns);
  14. if (tableCache.add(newTable)) { // Adds the specified element if it is not already present
  15. return newTable;
  16. }
  17. // Someone else added it. Let's find it.
  18. for (TableName tn : tableCache) {
  19. if (Bytes.equals(tn.getQualifier(), qns) && Bytes.equals(tn.getNamespace(), bns)) {
  20. return tn;
  21. }
  22. }
  23. // this should never happen.
  24. throw new IllegalStateException(newTable + " was supposed to be in the cache");
  25. }

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

  1. /**
  2. * Check that the object does not exist already. There are two reasons for creating the objects
  3. * only once:
  4. * 1) With 100K regions, the table names take ~20MB.
  5. * 2) Equals becomes much faster as it's resolved with a reference and an int comparison.
  6. */
  7. private static TableName createTableNameIfNecessary(ByteBuffer bns, ByteBuffer qns) {
  8. for (TableName tn : tableCache) {
  9. if (Bytes.equals(tn.getQualifier(), qns) && Bytes.equals(tn.getNamespace(), bns)) {
  10. return tn;
  11. }
  12. }
  13. TableName newTable = new TableName(bns, qns);
  14. if (tableCache.add(newTable)) { // Adds the specified element if it is not already present
  15. return newTable;
  16. }
  17. // Someone else added it. Let's find it.
  18. for (TableName tn : tableCache) {
  19. if (Bytes.equals(tn.getQualifier(), qns) && Bytes.equals(tn.getNamespace(), bns)) {
  20. return tn;
  21. }
  22. }
  23. // this should never happen.
  24. throw new IllegalStateException(newTable + " was supposed to be in the cache");
  25. }

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

  1. /**
  2. * Check that the object does not exist already. There are two reasons for creating the objects
  3. * only once:
  4. * 1) With 100K regions, the table names take ~20MB.
  5. * 2) Equals becomes much faster as it's resolved with a reference and an int comparison.
  6. */
  7. private static TableName createTableNameIfNecessary(ByteBuffer bns, ByteBuffer qns) {
  8. for (TableName tn : tableCache) {
  9. if (Bytes.equals(tn.getQualifier(), qns) && Bytes.equals(tn.getNamespace(), bns)) {
  10. return tn;
  11. }
  12. }
  13. TableName newTable = new TableName(bns, qns);
  14. if (tableCache.add(newTable)) { // Adds the specified element if it is not already present
  15. return newTable;
  16. }
  17. // Someone else added it. Let's find it.
  18. for (TableName tn : tableCache) {
  19. if (Bytes.equals(tn.getQualifier(), qns) && Bytes.equals(tn.getNamespace(), bns)) {
  20. return tn;
  21. }
  22. }
  23. // this should never happen.
  24. throw new IllegalStateException(newTable + " was supposed to be in the cache");
  25. }

相关文章