public static Optional<TableName> getTableName(ExtendedCell cell) {
    Optional<Tag> maybe = getTableNameTag(cell);
    Optional<TableName> name = Optional.empty();
    if (maybe.isPresent()) {
      final Tag tag = maybe.get();
      if (tag.hasArray()) {
        name = Optional
          .of(TableName.valueOf(tag.getValueArray(), tag.getValueOffset(), tag.getValueLength()));
      } else {
        // TODO ByteBuffer handling in tags looks busted. revisit.
        ByteBuffer buffer = tag.getValueByteBuffer().duplicate();
        buffer.mark();
        buffer.position(tag.getValueOffset());
        buffer.limit(tag.getValueOffset() + tag.getValueLength());
        name = Optional.of(TableName.valueOf(buffer));
      }
    }
    return name;
  }
Get the table name from when this cell was written into a mob hfile as a TableName.
@param cell to extract tag from
@return name of table as a TableName. empty if the tag is not found.
hbase-server/src/main/java/org/apache/hadoop/hbase/mob/MobUtils.java