Search in sources :

Example 1 with GoogleCloudStorageWriteChannel

use of com.google.cloud.hadoop.gcsio.GoogleCloudStorageWriteChannel 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;
}
Also used : StorageObject(com.google.api.services.storage.model.StorageObject) ObjectWriteConditions(com.google.cloud.hadoop.gcsio.ObjectWriteConditions) GoogleCloudStorageWriteChannel(com.google.cloud.hadoop.gcsio.GoogleCloudStorageWriteChannel)

Aggregations

StorageObject (com.google.api.services.storage.model.StorageObject)1 GoogleCloudStorageWriteChannel (com.google.cloud.hadoop.gcsio.GoogleCloudStorageWriteChannel)1 ObjectWriteConditions (com.google.cloud.hadoop.gcsio.ObjectWriteConditions)1