Interface ContextAccessors


public interface ContextAccessors
An interface to implement for providing accessors to S3AFileSystem-level API calls.

This is used to avoid giving any explicit reference to the owning FS in the store context; there are enough calls that using lambda-expressions gets over-complex.

  1. Test suites are free to provide their own implementation, using * the S3AFileSystem methods as the normative reference.
  2. All implementations MUST translate exceptions.
  • Method Details

    • keyToPath

      org.apache.hadoop.fs.Path keyToPath(String key)
      Convert a key to a fully qualified path.
      Parameters:
      key - input key
      Returns:
      the fully qualified path including URI scheme and bucket name.
    • pathToKey

      String pathToKey(org.apache.hadoop.fs.Path path)
      Turns a path (relative or otherwise) into an S3 key.
      Parameters:
      path - input path, may be relative to the working dir
      Returns:
      a key excluding the leading "/", or, if it is the root path, ""
    • createTempFile

      File createTempFile(String prefix, long size) throws IOException
      Create a temporary file.
      Parameters:
      prefix - prefix for the temporary file
      size - the size of the file that is going to be written
      Returns:
      a unique temporary file
      Throws:
      IOException - IO problems
    • getBucketLocation

      @RetryTranslated String getBucketLocation() throws IOException
      Get the region of a bucket. This may be via an S3 API call if not already cached.
      Returns:
      the region in which a bucket is located
      Throws:
      AccessDeniedException - if the caller lacks permission.
      IOException - on any failure.
    • makeQualified

      org.apache.hadoop.fs.Path makeQualified(org.apache.hadoop.fs.Path path)
      Qualify a path.
      Parameters:
      path - path to qualify/normalize
      Returns:
      possibly new path.
    • getActiveAuditSpan

      org.apache.hadoop.fs.store.audit.AuditSpan getActiveAuditSpan()
      Return the active audit span. This is thread local -it MUST be picked up and passed into workers. Collect and cache the value during construction.
      Returns:
      active audit span.
    • getRequestFactory

      RequestFactory getRequestFactory()
      Get the request factory.
      Returns:
      the factory for requests.