use of com.google.cloud.hadoop.gcsio.ObjectWriteConditions in project beam by apache.
the class GcsUtil method create.
/**
* Same as {@link GcsUtil#create(GcsPath, String)} but allows overriding
* {code uploadBufferSizeBytes}.
*/
public WritableByteChannel create(GcsPath path, String type, Integer uploadBufferSizeBytes) throws IOException {
GoogleCloudStorageWriteChannel channel = new GoogleCloudStorageWriteChannel(executorService, storageClient, new ClientRequestHelper<StorageObject>(), path.getBucket(), path.getObject(), AsyncWriteChannelOptions.newBuilder().build(), new ObjectWriteConditions(), Collections.<String, String>emptyMap(), type);
if (uploadBufferSizeBytes != null) {
channel.setUploadBufferSize(uploadBufferSizeBytes);
}
channel.initialize();
return channel;
}
Aggregations