检索示例键

检索示例行键。

代码示例

C++

如需了解如何安装和使用 Bigtable 客户端库,请参阅 Bigtable 客户端库

如需向 Bigtable 进行身份验证,请设置应用默认凭据。 如需了解详情,请参阅为本地开发环境设置身份验证

namespace cbt = ::google::cloud::bigtable;
using ::google::cloud::StatusOr;
[](cbt::Table table) {
  StatusOr<std::vector<cbt::RowKeySample>> samples = table.SampleRows();
  if (!samples) throw std::move(samples).status();
  for (auto const& sample : *samples) {
    std::cout << "key=" << sample.row_key << " - " << sample.offset_bytes
              << "\n";
  }
}

后续步骤

如需搜索和过滤其他 Google Cloud 产品的代码示例,请参阅 Google Cloud 示例浏览器