RawGcsService (App Engine Client for Google Cloud Storage 0.6 API)

com.google.appengine.tools.cloudstorage

Interface RawGcsService



  • public interface RawGcsService
    Low-level ("raw") interface to Google Cloud Storage. This interface need not be used or seen by users of Google Cloud Storage. Instead the higher level API GcsService should be used.

    Methods throw IOException for connection errors etc. that are retryable, and other exceptions for bad requests and similar errors that should not be retried.

    Implementing classes handle authentication through mechanisms not exposed in this interface.

    • Method Detail

      • getMaxWriteSizeByte

        int getMaxWriteSizeByte()
        Returns the max bytes allowed per putObject/finishObject operations. Value should always be equal or larger than getChunkSizeBytes().
      • continueObjectCreationAsync

        Future<RawGcsService.RawGcsCreationToken> continueObjectCreationAsync(RawGcsService.RawGcsCreationToken token,
                                                                              ByteBuffer chunk,
                                                                              long timeoutMillis)
        Reads all remaining bytes from chunk and writes them to the object and offset specified by token asynchronously.

        Returns a future for a new token to be used to continue writing to the object. Does not mutate token.

        The number of bytes remaining in chunk must be a nonzero multiple of getChunkSizeBytes() and may be subject to an upper limit that is implementation-dependent.

        The calling code is responsible for guaranteeing that the byte sequence written to the object remains identical across retries. (This is because the write may have succeeded on the backend even though an exception was thrown by this method, and writing different data on a retry leaves the object in a bad state.)

      • finishObjectCreation

        void finishObjectCreation(RawGcsService.RawGcsCreationToken token,
                                  ByteBuffer chunk,
                                  long timeoutMillis)
                           throws IOException
        Reads all remaining bytes from chunk and writes them to the object and offset specified by token, as the final bytes of the object. The object will become readable, and further writes will be rejected.

        The number of bytes remaining in chunk may be subject to an upper limit that is implementation-dependent.

        On error, does not consume any bytes from chunk. The write may be retried by making another call with the same token. A whole sequence of writes may be retried by using a previous token (this is useful if the calling code crashes and rolls back to an earlier state). In both cases, the calling code is responsible for guaranteeing that the byte sequence written to the object remains identical across retries. (This is because the write may have succeeded on the backend even though an exception was thrown by this method, and writing different data on a retry leaves the object in a bad state.)

        Throws:
        IOException
      • readObjectAsync

        Future<GcsFileMetadata> readObjectAsync(ByteBuffer dst,
                                                GcsFilename filename,
                                                long offset,
                                                long timeoutMillis)
        Issues a request to the server to retrieve data to fill the provided buffer. The offset may not be negative.

Copyright © 2016 Google. All rights reserved.

Monitor your resources on the go

Get the Google Cloud Console app to help you manage your projects.

Send feedback about...

App Engine standard environment for Java