Table toPb() { Table tablePb = definition.toPb(); tablePb.setTableReference(tableId.toPb()); if (lastModifiedTime != null) { tablePb.setLastModifiedTime(BigInteger.valueOf(lastModifiedTime)); } tablePb.setCreationTime(creationTime); tablePb.setDescription(description); tablePb.setEtag(etag); tablePb.setExpirationTime(expirationTime); tablePb.setFriendlyName(friendlyName); tablePb.setId(generatedId); tablePb.setSelfLink(selfLink); if (encryptionConfiguration != null) { tablePb.setEncryptionConfiguration(encryptionConfiguration.toPb()); } tablePb.setLabels(labels.toPb()); return tablePb; }
@Override public Table patchTableDescription( TableReference tableReference, @Nullable String tableDescription) throws IOException, InterruptedException { Table table = new Table(); table.setDescription(tableDescription); return executeWithRetries( client .tables() .patch( tableReference.getProjectId(), tableReference.getDatasetId(), tableReference.getTableId(), table), String.format( "Unable to patch table description: %s, aborting after %d retries.", tableReference, MAX_RPC_RETRIES), Sleeper.DEFAULT, createDefaultBackoff(), ALWAYS_RETRY); } }
Table toPb() { Table tablePb = definition.toPb(); tablePb.setTableReference(tableId.toPb()); if (lastModifiedTime != null) { tablePb.setLastModifiedTime(BigInteger.valueOf(lastModifiedTime)); } tablePb.setCreationTime(creationTime); tablePb.setDescription(description); tablePb.setEtag(etag); tablePb.setExpirationTime(expirationTime); tablePb.setFriendlyName(friendlyName); tablePb.setId(generatedId); tablePb.setSelfLink(selfLink); return tablePb; }
Table toPb() { Table tablePb = definition.toPb(); tablePb.setTableReference(tableId.toPb()); if (lastModifiedTime != null) { tablePb.setLastModifiedTime(BigInteger.valueOf(lastModifiedTime)); } tablePb.setCreationTime(creationTime); tablePb.setDescription(description); tablePb.setEtag(etag); tablePb.setExpirationTime(expirationTime); tablePb.setFriendlyName(friendlyName); tablePb.setId(generatedId); tablePb.setSelfLink(selfLink); return tablePb; }
Table toPb() { Table tablePb = definition.toPb(); tablePb.setTableReference(tableId.toPb()); if (lastModifiedTime != null) { tablePb.setLastModifiedTime(BigInteger.valueOf(lastModifiedTime)); } tablePb.setCreationTime(creationTime); tablePb.setDescription(description); tablePb.setEtag(etag); tablePb.setExpirationTime(expirationTime); tablePb.setFriendlyName(friendlyName); tablePb.setId(generatedId); tablePb.setSelfLink(selfLink); if (encryptionConfiguration != null) { tablePb.setEncryptionConfiguration(encryptionConfiguration.toPb()); } tablePb.setLabels(labels.toPb()); return tablePb; }
@Override public Table patchTableDescription( TableReference tableReference, @Nullable String tableDescription) throws IOException, InterruptedException { validateWholeTableReference(tableReference); synchronized (tables) { TableContainer tableContainer = getTableContainer( tableReference.getProjectId(), tableReference.getDatasetId(), tableReference.getTableId()); tableContainer.getTable().setDescription(tableDescription); return tableContainer.getTable(); } }
private Table createTable(Description description) throws IOException, InterruptedException { TableReference tableReference = new TableReference() .setProjectId(pipelineOptions.getProject()) .setDatasetId(pipelineOptions.getTargetDataset()) .setTableId(createRandomizedName(description)); table = new Table() .setTableReference(tableReference) .setSchema(BigQueryUtils.toTableSchema(schema)) .setDescription( "Table created for " + description.getDisplayName() + " by TestBigQueryRule. " + "Should be automatically cleaned up after test completion."); if (datasetService.getTable(tableReference) != null) { throw new IllegalStateException( "Table '" + tableReference + "' already exists. " + "It should have been cleaned up by the test rule."); } datasetService.createTable(table); return table; }