Search in sources :

Example 1 with Restorable

use of com.google.cloud.Restorable in project google-cloud-java by GoogleCloudPlatform.

the class SerializationTest method restorableObjects.

@Override
protected Restorable<?>[] restorableObjects() {
    StorageOptions options = StorageOptions.newBuilder().setProjectId("p2").build();
    ReadChannel reader = new BlobReadChannel(options, BlobId.of("b", "n"), EMPTY_RPC_OPTIONS);
    // avoid closing when you don't want partial writes to GCS upon failure
    @SuppressWarnings("resource") BlobWriteChannel writer = new BlobWriteChannel(options, BlobInfo.newBuilder(BlobId.of("b", "n")).build(), "upload-id");
    return new Restorable<?>[] { reader, writer };
}
Also used : ReadChannel(com.google.cloud.ReadChannel) Restorable(com.google.cloud.Restorable)

Aggregations

ReadChannel (com.google.cloud.ReadChannel)1 Restorable (com.google.cloud.Restorable)1