use of com.google.cloud.bigquery.storage.v1.WriteStream in project beam by apache.
the class FakeDatasetService method createWriteStream.
@Override
public WriteStream createWriteStream(String tableUrn, Type type) throws IOException, InterruptedException {
TableReference tableReference = BigQueryHelpers.parseTableUrn(BigQueryHelpers.stripPartitionDecorator(tableUrn));
synchronized (tables) {
TableContainer tableContainer = getTableContainer(tableReference.getProjectId(), tableReference.getDatasetId(), tableReference.getTableId());
String streamName = UUID.randomUUID().toString();
writeStreams.put(streamName, new Stream(streamName, tableContainer, type));
return WriteStream.newBuilder().setName(streamName).build();
}
}
Aggregations