• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Page类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.google.cloud.Page的典型用法代码示例。如果您正苦于以下问题:Java Page类的具体用法?Java Page怎么用?Java Page使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Page类属于com.google.cloud包,在下文中一共展示了Page类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: listTablesFromId

import com.google.cloud.Page; //导入依赖的package包/类
/**
 * Example of listing the tables in a dataset.
 */
// [TARGET listTables(DatasetId, TableListOption...)]
// [VARIABLE "my_project_id"]
// [VARIABLE "my_dataset_name"]
public Page<Table> listTablesFromId(String projectId, String datasetName) {
  // [START listTablesFromId]
  DatasetId datasetId = DatasetId.of(projectId, datasetName);
  Page<Table> tables = bigquery.listTables(datasetId, TableListOption.pageSize(100));
  Iterator<Table> tableIterator = tables.iterateAll();
  while (tableIterator.hasNext()) {
    Table table = tableIterator.next();
    // do something with the table
  }
  // [END listTablesFromId]
  return tables;
}
 
开发者ID:michael-hll,项目名称:BigQueryStudy,代码行数:19,代码来源:BigQuerySnippets.java


示例2: listTableData

import com.google.cloud.Page; //导入依赖的package包/类
/**
 * Example of listing table rows, specifying the page size.
 */
// [TARGET listTableData(String, String, TableDataListOption...)]
// [VARIABLE "my_dataset_name"]
// [VARIABLE "my_table_name"]
public Page<List<FieldValue>> listTableData(String datasetName, String tableName) {
  // [START listTableData]
  Page<List<FieldValue>> tableData =
      bigquery.listTableData(datasetName, tableName, TableDataListOption.pageSize(100));
  Iterator<List<FieldValue>> rowIterator = tableData.iterateAll();
  while (rowIterator.hasNext()) {
    List<FieldValue> row = rowIterator.next();
    // do something with the row
  }
  // [END listTableData]
  return tableData;
}
 
开发者ID:michael-hll,项目名称:BigQueryStudy,代码行数:19,代码来源:BigQuerySnippets.java


示例3: listTableDataFromId

import com.google.cloud.Page; //导入依赖的package包/类
/**
 * Example of listing table rows, specifying the page size.
 */
// [TARGET listTableData(TableId, TableDataListOption...)]
// [VARIABLE "my_dataset_name"]
// [VARIABLE "my_table_name"]
public Page<List<FieldValue>> listTableDataFromId(String datasetName, String tableName) {
  // [START listTableDataFromId]
  TableId tableIdObject = TableId.of(datasetName, tableName);
  Page<List<FieldValue>> tableData =
      bigquery.listTableData(tableIdObject, TableDataListOption.pageSize(100));
  Iterator<List<FieldValue>> rowIterator = tableData.iterateAll();
  while (rowIterator.hasNext()) {
    List<FieldValue> row = rowIterator.next();
    // do something with the row
  }
  // [END listTableDataFromId]
  return tableData;
}
 
开发者ID:michael-hll,项目名称:BigQueryStudy,代码行数:20,代码来源:BigQuerySnippets.java


示例4: blobExistsInner

import com.google.cloud.Page; //导入依赖的package包/类
private static Blob blobExistsInner(URI uri) {
  final String bucketName = uri.getAuthority();
  final String prefix = uri.getPath().startsWith("/") ? uri.getPath().substring(1) : uri.getPath();

  final Page<Blob> list = STORAGE.list(bucketName, prefix(prefix));
  final Iterator<Blob> blobIterator = list.iterateAll();

  Blob blob = null;
  while (blobIterator.hasNext()) {
    blob = blobIterator.next();
    if (blob.getName().equals(prefix)) {
      break;
    }
  }

  if (blob != null) {
    return blob;
  } else {
    throw new NotReady();
  }
}
 
开发者ID:spotify,项目名称:flo-runner,代码行数:22,代码来源:GcsTasks.java


示例5: listDatasets

import com.google.cloud.Page; //导入依赖的package包/类
/**
 * Example of listing datasets, specifying the page size.
 */
// [TARGET listDatasets(DatasetListOption...)]
public Page<Dataset> listDatasets() {
  // [START listDatasets]
  Page<Dataset> datasets = bigquery.listDatasets(DatasetListOption.pageSize(100));
  Iterator<Dataset> datasetIterator = datasets.iterateAll();
  while (datasetIterator.hasNext()) {
    Dataset dataset = datasetIterator.next();
    // do something with the dataset
  }
  // [END listDatasets]
  return datasets;
}
 
开发者ID:michael-hll,项目名称:BigQueryStudy,代码行数:16,代码来源:BigQuerySnippets.java


示例6: listTables

import com.google.cloud.Page; //导入依赖的package包/类
/**
 * Example of listing the tables in a dataset, specifying the page size.
 */
// [TARGET listTables(String, TableListOption...)]
// [VARIABLE "my_dataset_name"]
public Page<Table> listTables(String datasetName) {
  // [START listTables]
  Page<Table> tables = bigquery.listTables(datasetName, TableListOption.pageSize(100));
  Iterator<Table> tableIterator = tables.iterateAll();
  while (tableIterator.hasNext()) {
    Table table = tableIterator.next();
    // do something with the table
  }
  // [END listTables]
  return tables;
}
 
开发者ID:michael-hll,项目名称:BigQueryStudy,代码行数:17,代码来源:BigQuerySnippets.java


示例7: listJobs

import com.google.cloud.Page; //导入依赖的package包/类
/**
 * Example of listing jobs, specifying the page size.
 */
// [TARGET listJobs(JobListOption...)]
public Page<Job> listJobs() {
  // [START listJobs]
  Page<Job> jobs = bigquery.listJobs(JobListOption.pageSize(100));
  Iterator<Job> jobIterator = jobs.iterateAll();
  while (jobIterator.hasNext()) {
    Job job = jobIterator.next();
    // do something with the job
  }
  // [END listJobs]
  return jobs;
}
 
开发者ID:michael-hll,项目名称:BigQueryStudy,代码行数:16,代码来源:BigQuerySnippets.java


示例8: readAllRows

import com.google.cloud.Page; //导入依赖的package包/类
private List<List<Object>> readAllRows(String tableName) {
  Table table = bigQuery.getTable(dataset, tableName);
  Schema schema = table.getDefinition().getSchema();
  Page<List<FieldValue>> page = table.list();

  List<List<Object>> rows = new ArrayList<>();
  while (page != null) {
    for (List<FieldValue> row : page.getValues()) {
      rows.add(convertRow(schema.getFields(), row));
    }
    page = page.getNextPage();
  }
  return rows;
}
 
开发者ID:wepay,项目名称:kafka-connect-bigquery,代码行数:15,代码来源:BigQueryConnectorIntegrationTest.java


示例9: listDatasets

import com.google.cloud.Page; //导入依赖的package包/类
@Override
public Set<String> listDatasets() throws IOException {
    BigQuery bigquery = BigQueryConnection.createClient(properties.getDatastoreProperties());
    Page<Dataset> datasets = bigquery.listDatasets(properties.getDatastoreProperties().projectName.getValue(),
            BigQuery.DatasetListOption.pageSize(100));
    Set<String> datasetsName = new HashSet<>();
    Iterator<Dataset> datasetIterator = datasets.iterateAll();
    while (datasetIterator.hasNext()) {
        datasetsName.add(datasetIterator.next().getDatasetId().getDataset());
    }
    return datasetsName;
}
 
开发者ID:Talend,项目名称:components,代码行数:13,代码来源:BigQueryDatasetRuntime.java


示例10: listTables

import com.google.cloud.Page; //导入依赖的package包/类
@Override
public Set<String> listTables() throws IOException {
    BigQuery bigquery = BigQueryConnection.createClient(properties.getDatastoreProperties());
    DatasetId datasetId = DatasetId.of(properties.getDatastoreProperties().projectName.getValue(),
            properties.bqDataset.getValue());
    Page<Table> tables = bigquery.listTables(datasetId, BigQuery.TableListOption.pageSize(100));
    Set<String> tablesName = new HashSet<>();
    Iterator<Table> tableIterator = tables.iterateAll();
    while (tableIterator.hasNext()) {
        tablesName.add(tableIterator.next().getTableId().getTable());
    }
    return tablesName;
}
 
开发者ID:Talend,项目名称:components,代码行数:14,代码来源:BigQueryDatasetRuntime.java



注:本文中的com.google.cloud.Page类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java MavenProperties类代码示例发布时间:2022-05-23
下一篇:
Java SpelParseException类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap