Class UnderFileSystemWithLogging

  • All Implemented Interfaces:
    AsyncUfsClient, UnderFileSystem, java.io.Closeable, java.lang.AutoCloseable

    public class UnderFileSystemWithLogging
    extends java.lang.Object
    implements UnderFileSystem
    This class forwards all calls to the UnderFileSystem interface to an internal implementation. For methods which throw an IOException, it is implied that an interaction with the underlying storage is possible. This class logs the enter/exit of all such methods. Methods which do not throw exceptions will not be logged.
    • Method Detail

      • cleanup

        public void cleanup()
                     throws java.io.IOException
        Description copied from interface: UnderFileSystem
        Cleans up the under file system. If any data or files are created and not completed/aborted correctly in normal ways, they should be cleaned in this method.
        Specified by:
        cleanup in interface UnderFileSystem
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException
      • connectFromMaster

        public void connectFromMaster​(java.lang.String hostname)
                               throws java.io.IOException
        Description copied from interface: UnderFileSystem
        Takes any necessary actions required to establish a connection to the under file system from the given master host e.g. logging in

        Depending on the implementation this may be a no-op

        Specified by:
        connectFromMaster in interface UnderFileSystem
        Parameters:
        hostname - the host that wants to connect to the under file system
        Throws:
        java.io.IOException
      • connectFromWorker

        public void connectFromWorker​(java.lang.String hostname)
                               throws java.io.IOException
        Description copied from interface: UnderFileSystem
        Takes any necessary actions required to establish a connection to the under file system from the given worker host e.g. logging in

        Depending on the implementation this may be a no-op

        Specified by:
        connectFromWorker in interface UnderFileSystem
        Parameters:
        hostname - the host that wants to connect to the under file system
        Throws:
        java.io.IOException
      • create

        public java.io.OutputStream create​(java.lang.String path)
                                    throws java.io.IOException
        Description copied from interface: UnderFileSystem
        Creates a file in the under file system with the indicated name. Parents directories will be created recursively.
        Specified by:
        create in interface UnderFileSystem
        Parameters:
        path - the file name
        Returns:
        A OutputStream object
        Throws:
        java.io.IOException
      • create

        public java.io.OutputStream create​(java.lang.String path,
                                           CreateOptions options)
                                    throws java.io.IOException
        Description copied from interface: UnderFileSystem
        Creates a file in the under file system with the specified CreateOptions. Implementations should make sure that the path under creation appears in listings only after a successful close and that contents are written in its entirety or not at all.
        Specified by:
        create in interface UnderFileSystem
        Parameters:
        path - the file name
        options - the options for create
        Returns:
        A OutputStream object
        Throws:
        java.io.IOException
      • createNonexistingFile

        public java.io.OutputStream createNonexistingFile​(java.lang.String path)
                                                   throws java.io.IOException
        Description copied from interface: UnderFileSystem
        Creates a file in the under file system with the indicated name. Similar to UnderFileSystem.create(String) but deals with the delete-then-create eventual consistency issue.
        Specified by:
        createNonexistingFile in interface UnderFileSystem
        Parameters:
        path - the file name
        Returns:
        A OutputStream object
        Throws:
        java.io.IOException
      • deleteDirectory

        public boolean deleteDirectory​(java.lang.String path)
                                throws java.io.IOException
        Description copied from interface: UnderFileSystem
        Deletes a directory from the under file system with the indicated name non-recursively. A non-recursive delete is successful only if the directory is empty.
        Specified by:
        deleteDirectory in interface UnderFileSystem
        Parameters:
        path - of the directory to delete
        Returns:
        true if directory was found and deleted, false otherwise
        Throws:
        java.io.IOException
      • deleteDirectory

        public boolean deleteDirectory​(java.lang.String path,
                                       DeleteOptions options)
                                throws java.io.IOException
        Description copied from interface: UnderFileSystem
        Deletes a directory from the under file system with the indicated name.
        Specified by:
        deleteDirectory in interface UnderFileSystem
        Parameters:
        path - of the directory to delete
        options - for directory delete semantics
        Returns:
        true if directory was found and deleted, false otherwise
        Throws:
        java.io.IOException
      • deleteExistingDirectory

        public boolean deleteExistingDirectory​(java.lang.String path)
                                        throws java.io.IOException
        Description copied from interface: UnderFileSystem
        Deletes a directory from the under file system. Similar to UnderFileSystem.deleteDirectory(String) but deals with the create-delete eventual consistency issue.
        Specified by:
        deleteExistingDirectory in interface UnderFileSystem
        Parameters:
        path - of the directory to delete
        Returns:
        true if directory was found and deleted, false otherwise
        Throws:
        java.io.IOException
      • deleteExistingDirectory

        public boolean deleteExistingDirectory​(java.lang.String path,
                                               DeleteOptions options)
                                        throws java.io.IOException
        Description copied from interface: UnderFileSystem
        Deletes a directory from the under file system with the indicated name. Similar to UnderFileSystem.deleteDirectory(String, DeleteOptions) but deals with the create-then-delete eventual consistency issue.
        Specified by:
        deleteExistingDirectory in interface UnderFileSystem
        Parameters:
        path - of the directory to delete
        options - for directory delete semantics
        Returns:
        true if directory was found and deleted, false otherwise
        Throws:
        java.io.IOException
      • deleteFile

        public boolean deleteFile​(java.lang.String path)
                           throws java.io.IOException
        Description copied from interface: UnderFileSystem
        Deletes a file from the under file system with the indicated name.
        Specified by:
        deleteFile in interface UnderFileSystem
        Parameters:
        path - of the file to delete
        Returns:
        true if file was found and deleted, false otherwise
        Throws:
        java.io.IOException
      • deleteExistingFile

        public boolean deleteExistingFile​(java.lang.String path)
                                   throws java.io.IOException
        Description copied from interface: UnderFileSystem
        Deletes a file from the under file system with the indicated name. Similar to UnderFileSystem.deleteFile(String) but deals with the create-then-delete eventual consistency issue.
        Specified by:
        deleteExistingFile in interface UnderFileSystem
        Parameters:
        path - of the file to delete
        Returns:
        true if file was found and deleted, false otherwise
        Throws:
        java.io.IOException
      • exists

        public boolean exists​(java.lang.String path)
                       throws java.io.IOException
        Description copied from interface: UnderFileSystem
        Checks if a file or directory exists in under file system.
        Specified by:
        exists in interface UnderFileSystem
        Parameters:
        path - the absolute path
        Returns:
        true if the path exists, false otherwise
        Throws:
        java.io.IOException
      • getBlockSizeByte

        public long getBlockSizeByte​(java.lang.String path)
                              throws java.io.IOException
        Description copied from interface: UnderFileSystem
        Gets the block size of a file in under file system, in bytes.
        Specified by:
        getBlockSizeByte in interface UnderFileSystem
        Parameters:
        path - the file name
        Returns:
        the block size in bytes
        Throws:
        java.io.IOException
      • getDirectoryStatus

        public UfsDirectoryStatus getDirectoryStatus​(java.lang.String path)
                                              throws java.io.IOException
        Description copied from interface: UnderFileSystem
        Gets the directory status. The caller must already know the path is a directory. This method will throw an exception if the path exists, but is a file.
        Specified by:
        getDirectoryStatus in interface UnderFileSystem
        Parameters:
        path - the path to the directory
        Returns:
        the directory status
        Throws:
        java.io.FileNotFoundException - when the path does not exist
        java.io.IOException
      • getFileLocations

        public java.util.List<java.lang.String> getFileLocations​(java.lang.String path)
                                                          throws java.io.IOException
        Description copied from interface: UnderFileSystem
        Gets the list of locations of the indicated path.
        Specified by:
        getFileLocations in interface UnderFileSystem
        Parameters:
        path - the file name
        Returns:
        The list of locations
        Throws:
        java.io.IOException
      • getFileLocations

        public java.util.List<java.lang.String> getFileLocations​(java.lang.String path,
                                                                 FileLocationOptions options)
                                                          throws java.io.IOException
        Description copied from interface: UnderFileSystem
        Gets the list of locations of the indicated path given options.
        Specified by:
        getFileLocations in interface UnderFileSystem
        Parameters:
        path - the file name
        options - method options
        Returns:
        The list of locations
        Throws:
        java.io.IOException
      • getFileStatus

        public UfsFileStatus getFileStatus​(java.lang.String path,
                                           GetStatusOptions options)
                                    throws java.io.IOException
        Description copied from interface: UnderFileSystem
        Gets the file status. The caller must already know the path is a file. This method will throw an exception if the path exists, but is a directory.
        Specified by:
        getFileStatus in interface UnderFileSystem
        Parameters:
        path - the path to the file
        options - method options
        Returns:
        the file status
        Throws:
        java.io.FileNotFoundException - when the path does not exist
        java.io.IOException
      • getFingerprint

        public java.lang.String getFingerprint​(java.lang.String path)
        Description copied from interface: UnderFileSystem
        Computes and returns a fingerprint for the path. The fingerprint is used to determine if two UFS files are identical. The fingerprint must be deterministic, and must not change if a file is only renamed (identical content and permissions). Returns Constants.INVALID_UFS_FINGERPRINT if there is any error.
        Specified by:
        getFingerprint in interface UnderFileSystem
        Parameters:
        path - the path to compute the fingerprint for
        Returns:
        the string representing the fingerprint
      • getParsedFingerprint

        public Fingerprint getParsedFingerprint​(java.lang.String path)
        Description copied from interface: UnderFileSystem
        Computes and returns a fingerprint for the path. The fingerprint is used to determine if two UFS files are identical. The fingerprint must be deterministic, and must not change if a file is only renamed (identical content and permissions). Returns Fingerprint.INVALID_FINGERPRINT if there is any error. The default implementation relies on UnderFileSystem.getFingerprint(String) and there is one extra parsing. This default implementation is mainly for backward compatibility. Override this for performance.
        Specified by:
        getParsedFingerprint in interface UnderFileSystem
        Parameters:
        path - the path to compute the fingerprint for
        Returns:
        the string representing the fingerprint
      • getOperationMode

        public UfsMode getOperationMode​(java.util.Map<java.lang.String,​UfsMode> physicalUfsState)
        Description copied from interface: UnderFileSystem
        An UnderFileSystem may be composed of one or more "physical UFS"s. This method is used to determine the operation mode based on the physical UFS operation modes. For example, if this UnderFileSystem is composed of physical UFS hdfs://ns1/ and hdfs://ns2/ with read operations split b/w the two, with physicalUfsState{hdfs://ns1/:NO_ACCESS, hdfs://ns2/:READ_WRITE} this method can return READ_ONLY to allow reads to proceed from hdfs://ns2/.
        Specified by:
        getOperationMode in interface UnderFileSystem
        Parameters:
        physicalUfsState - the state of physical UFSs for this UnderFileSystem; keys are expected to be normalized (ending with /)
        Returns:
        the desired operation mode for this UFS
      • getSpace

        public long getSpace​(java.lang.String path,
                             UnderFileSystem.SpaceType type)
                      throws java.io.IOException
        Description copied from interface: UnderFileSystem
        Queries the under file system about the space of the indicated path (e.g., space left, space used and etc).
        Specified by:
        getSpace in interface UnderFileSystem
        Parameters:
        path - the path to query
        type - the type of queries
        Returns:
        The space in bytes
        Throws:
        java.io.IOException
      • getStatus

        public UfsStatus getStatus​(java.lang.String path,
                                   GetStatusOptions options)
                            throws java.io.IOException
        Description copied from interface: UnderFileSystem
        Gets the file or directory status. The caller does not need to know if the path is a file or directory. This method will determine the path type, and will return the appropriate status.
        Specified by:
        getStatus in interface UnderFileSystem
        Parameters:
        path - the path to get the status
        options - method options
        Returns:
        the file or directory status
        Throws:
        java.io.FileNotFoundException - when the path does not exist
        java.io.IOException
      • getExistingStatus

        public UfsStatus getExistingStatus​(java.lang.String path)
                                    throws java.io.IOException
        Description copied from interface: UnderFileSystem
        Gets the file or directory status. Similar to UnderFileSystem.getStatus(String) but deals with the write-then-get-status eventual consistency issue.
        Specified by:
        getExistingStatus in interface UnderFileSystem
        Parameters:
        path - the path to get the status
        Returns:
        the file or directory status
        Throws:
        java.io.IOException
      • getUnderFSType

        public java.lang.String getUnderFSType()
        Description copied from interface: UnderFileSystem
        Returns the name of the under filesystem implementation. The name should be lowercase and not include any spaces, e.g. "hdfs", "s3".
        Specified by:
        getUnderFSType in interface UnderFileSystem
        Returns:
        name of the under filesystem implementation
      • isDirectory

        public boolean isDirectory​(java.lang.String path)
                            throws java.io.IOException
        Description copied from interface: UnderFileSystem
        Checks if a directory exists in under file system.
        Specified by:
        isDirectory in interface UnderFileSystem
        Parameters:
        path - the absolute directory path
        Returns:
        true if the path exists and is a directory, false otherwise
        Throws:
        java.io.IOException
      • isExistingDirectory

        public boolean isExistingDirectory​(java.lang.String path)
                                    throws java.io.IOException
        Description copied from interface: UnderFileSystem
        Checks if a directory exists in under file system. Similar to UnderFileSystem.isDirectory(String) but deals with the write-then-list eventual consistency issue.
        Specified by:
        isExistingDirectory in interface UnderFileSystem
        Parameters:
        path - the absolute directory path
        Returns:
        true if the path exists and is a directory, false otherwise
        Throws:
        java.io.IOException
      • isFile

        public boolean isFile​(java.lang.String path)
                       throws java.io.IOException
        Description copied from interface: UnderFileSystem
        Checks if a file exists in under file system.
        Specified by:
        isFile in interface UnderFileSystem
        Parameters:
        path - the absolute file path
        Returns:
        true if the path exists and is a file, false otherwise
        Throws:
        java.io.IOException
      • getPhysicalStores

        public java.util.List<java.lang.String> getPhysicalStores()
        Description copied from interface: UnderFileSystem
        An UnderFileSystem may be composed of one or more "physical UFS"s. This method returns all underlying physical stores; normalized with only scheme and authority.
        Specified by:
        getPhysicalStores in interface UnderFileSystem
        Returns:
        physical UFSs this UnderFileSystem is composed of
      • isObjectStorage

        public boolean isObjectStorage()
        Specified by:
        isObjectStorage in interface UnderFileSystem
        Returns:
        true if under storage is an object store, false otherwise
      • listStatus

        public UfsStatus[] listStatus​(java.lang.String path)
                               throws java.io.IOException
        Description copied from interface: UnderFileSystem
        Returns an array of statuses of the files and directories in the directory denoted by this abstract pathname.

        If this abstract pathname does not denote a directory, then this method returns null. Otherwise an array of statuses is returned, one for each file or directory in the directory. Names denoting the directory itself and the directory's parent directory are not included in the result. Each string is a file name rather than a complete path.

        There is no guarantee that the name strings in the resulting array will appear in any specific order; they are not, in particular, guaranteed to appear in alphabetical order.

        Specified by:
        listStatus in interface UnderFileSystem
        Parameters:
        path - the abstract pathname to list
        Returns:
        An array with the statuses of the files and directories in the directory denoted by this abstract pathname. The array will be empty if the directory is empty. Returns null if this abstract pathname does not denote a directory.
        Throws:
        java.io.IOException
      • listStatus

        public UfsStatus[] listStatus​(java.lang.String path,
                                      ListOptions options)
                               throws java.io.IOException
        Description copied from interface: UnderFileSystem
        Returns an array of statuses of the files and directories in the directory denoted by this abstract pathname, with options.

        If this abstract pathname does not denote a directory, then this method returns null. Otherwise an array of statuses is returned, one for each file or directory. Names denoting the directory itself and the directory's parent directory are not included in the result. Each string is a path relative to the given directory.

        There is no guarantee that the name strings in the resulting array will appear in any specific order; they are not, in particular, guaranteed to appear in alphabetical order.

        Specified by:
        listStatus in interface UnderFileSystem
        Parameters:
        path - the abstract pathname to list
        options - for list directory
        Returns:
        An array of statuses naming the files and directories in the directory denoted by this abstract pathname. The array will be empty if the directory is empty. Returns null if this abstract pathname does not denote a directory.
        Throws:
        java.io.IOException
      • listStatusIterable

        public java.util.Iterator<UfsStatus> listStatusIterable​(java.lang.String path,
                                                                ListOptions options,
                                                                java.lang.String startAfter,
                                                                int batchSize)
                                                         throws java.io.IOException
        Description copied from interface: UnderFileSystem
        Lists the ufs statuses iteratively.
        Specified by:
        listStatusIterable in interface UnderFileSystem
        Parameters:
        path - the abstract pathname to list
        options - for list directory
        startAfter - the start after token
        batchSize - the batch size
        Returns:
        An iterator of ufs status. Returns null if this abstract pathname does not denote a directory.
        Throws:
        java.io.IOException
      • mkdirs

        public boolean mkdirs​(java.lang.String path)
                       throws java.io.IOException
        Description copied from interface: UnderFileSystem
        Creates the directory named by this abstract pathname. If the folder already exists, the method returns false. The method creates any necessary but nonexistent parent directories.
        Specified by:
        mkdirs in interface UnderFileSystem
        Parameters:
        path - the folder to create
        Returns:
        true if and only if the directory was created; false otherwise
        Throws:
        java.io.IOException
      • mkdirs

        public boolean mkdirs​(java.lang.String path,
                              MkdirsOptions options)
                       throws java.io.IOException
        Description copied from interface: UnderFileSystem
        Creates the directory named by this abstract pathname, with specified MkdirsOptions. If the folder already exists, the method returns false.
        Specified by:
        mkdirs in interface UnderFileSystem
        Parameters:
        path - the folder to create
        options - the options for mkdirs
        Returns:
        true if and only if the directory was created; false otherwise
        Throws:
        java.io.IOException
      • open

        public java.io.InputStream open​(java.lang.String path)
                                 throws java.io.IOException
        Description copied from interface: UnderFileSystem
        Opens an InputStream for a file in under filesystem at the indicated path.
        Specified by:
        open in interface UnderFileSystem
        Parameters:
        path - the file name
        Returns:
        The InputStream object
        Throws:
        java.io.IOException
      • open

        public java.io.InputStream open​(java.lang.String path,
                                        OpenOptions options)
                                 throws java.io.IOException
        Description copied from interface: UnderFileSystem
        Opens an InputStream for a file in under filesystem at the indicated path.
        Specified by:
        open in interface UnderFileSystem
        Parameters:
        path - the file name
        options - to open input stream
        Returns:
        The InputStream object
        Throws:
        java.io.IOException
      • openExistingFile

        public java.io.InputStream openExistingFile​(java.lang.String path)
                                             throws java.io.IOException
        Description copied from interface: UnderFileSystem
        Opens an InputStream for a file in under filesystem at the indicated path. Similar to UnderFileSystem.open(String) but deals with the write-then-read eventual consistency issue.
        Specified by:
        openExistingFile in interface UnderFileSystem
        Parameters:
        path - the file name
        Returns:
        The InputStream object
        Throws:
        java.io.IOException
      • openExistingFile

        public java.io.InputStream openExistingFile​(java.lang.String path,
                                                    OpenOptions options)
                                             throws java.io.IOException
        Description copied from interface: UnderFileSystem
        Opens an InputStream for a file in under filesystem at the indicated path. Similar to UnderFileSystem.open(String, OpenOptions) but deals with the write-then-read eventual consistency issue.
        Specified by:
        openExistingFile in interface UnderFileSystem
        Parameters:
        path - the file name
        options - to open input stream
        Returns:
        The InputStream object
        Throws:
        java.io.IOException
      • openPositionRead

        public PositionReader openPositionRead​(java.lang.String path,
                                               long fileLength)
        Description copied from interface: UnderFileSystem
        Opens a file for position read.
        Specified by:
        openPositionRead in interface UnderFileSystem
        Parameters:
        path - the path to read
        fileLength - the file length
        Returns:
        the position reader
      • renameDirectory

        public boolean renameDirectory​(java.lang.String src,
                                       java.lang.String dst)
                                throws java.io.IOException
        Description copied from interface: UnderFileSystem
        Renames a directory from src to dst in under file system.
        Specified by:
        renameDirectory in interface UnderFileSystem
        Parameters:
        src - the source directory path
        dst - the destination directory path
        Returns:
        true if succeed, false otherwise
        Throws:
        java.io.IOException
      • renameRenamableDirectory

        public boolean renameRenamableDirectory​(java.lang.String src,
                                                java.lang.String dst)
                                         throws java.io.IOException
        Description copied from interface: UnderFileSystem
        Renames a directory from src to dst in under file system. Similar to UnderFileSystem.renameDirectory(String, String) but deals with the write-src-then-rename and delete-dst-then-rename eventual consistency issue.
        Specified by:
        renameRenamableDirectory in interface UnderFileSystem
        Parameters:
        src - the source directory path
        dst - the destination directory path
        Returns:
        true if succeed, false otherwise
        Throws:
        java.io.IOException
      • renameFile

        public boolean renameFile​(java.lang.String src,
                                  java.lang.String dst)
                           throws java.io.IOException
        Description copied from interface: UnderFileSystem
        Renames a file from src to dst in under file system.
        Specified by:
        renameFile in interface UnderFileSystem
        Parameters:
        src - the source file path
        dst - the destination file path
        Returns:
        true if succeed, false otherwise
        Throws:
        java.io.IOException
      • renameRenamableFile

        public boolean renameRenamableFile​(java.lang.String src,
                                           java.lang.String dst)
                                    throws java.io.IOException
        Description copied from interface: UnderFileSystem
        Renames a file from src to dst in under file system. Similar to UnderFileSystem.renameFile(String, String) but deals with the write-src-then-rename and delete-dst-then-rename eventual consistency issue.
        Specified by:
        renameRenamableFile in interface UnderFileSystem
        Parameters:
        src - the source file path
        dst - the destination file path
        Returns:
        true if succeed, false otherwise
        Throws:
        java.io.IOException
      • resolveUri

        public AlluxioURI resolveUri​(AlluxioURI ufsBaseUri,
                                     java.lang.String alluxioPath)
        Description copied from interface: UnderFileSystem
        Returns an AlluxioURI representation for the UnderFileSystem given a base UFS URI, and the Alluxio path from the base. The default implementation simply concatenates the path to the base URI. This should be overridden if a subclass needs alternate functionality.
        Specified by:
        resolveUri in interface UnderFileSystem
        Parameters:
        ufsBaseUri - the base AlluxioURI in the ufs
        alluxioPath - the path in Alluxio from the given base
        Returns:
        the UFS AlluxioURI representing the Alluxio path
      • setAclEntries

        public void setAclEntries​(java.lang.String path,
                                  java.util.List<AclEntry> aclEntries)
                           throws java.io.IOException
        Description copied from interface: UnderFileSystem
        Sets the access control list of a file or directory in under file system. if the ufs does not support acls, this is a noop. This will overwrite the ACL and defaultACL in the UFS.
        Specified by:
        setAclEntries in interface UnderFileSystem
        Parameters:
        path - the path to the file or directory
        aclEntries - the access control list + default acl represented in a list of acl entries
        Throws:
        java.io.IOException
      • setOwner

        public void setOwner​(java.lang.String path,
                             java.lang.String owner,
                             java.lang.String group)
                      throws java.io.IOException
        Description copied from interface: UnderFileSystem
        Sets the user and group of the given path. An empty implementation should be provided if unsupported.
        Specified by:
        setOwner in interface UnderFileSystem
        Parameters:
        path - the path of the file
        owner - the new owner to set, unchanged if null
        group - the new group to set, unchanged if null
        Throws:
        java.io.IOException
      • setMode

        public void setMode​(java.lang.String path,
                            short mode)
                     throws java.io.IOException
        Description copied from interface: UnderFileSystem
        Changes posix file mode.
        Specified by:
        setMode in interface UnderFileSystem
        Parameters:
        path - the path of the file
        mode - the mode to set in short format, e.g. 0777
        Throws:
        java.io.IOException
      • supportsFlush

        public boolean supportsFlush()
                              throws java.io.IOException
        Description copied from interface: UnderFileSystem
        Whether this type of UFS supports flush.
        Specified by:
        supportsFlush in interface UnderFileSystem
        Returns:
        true if this type of UFS supports flush, false otherwise
        Throws:
        java.io.IOException
      • supportsActiveSync

        public boolean supportsActiveSync()
        Description copied from interface: UnderFileSystem
        Whether this type of UFS supports active sync.
        Specified by:
        supportsActiveSync in interface UnderFileSystem
        Returns:
        true if this type of UFS supports active sync, false otherwise
      • startActiveSyncPolling

        public boolean startActiveSyncPolling​(long txId)
                                       throws java.io.IOException
        Description copied from interface: UnderFileSystem
        Start Active Sync.
        Specified by:
        startActiveSyncPolling in interface UnderFileSystem
        Parameters:
        txId - the transaction id to start receiving event
        Returns:
        true if active sync started
        Throws:
        java.io.IOException
      • stopActiveSyncPolling

        public boolean stopActiveSyncPolling()
                                      throws java.io.IOException
        Description copied from interface: UnderFileSystem
        Stop Active Sync.
        Specified by:
        stopActiveSyncPolling in interface UnderFileSystem
        Returns:
        true if active sync stopped
        Throws:
        java.io.IOException
      • getActiveSyncInfo

        public SyncInfo getActiveSyncInfo()
                                   throws java.io.IOException
        Description copied from interface: UnderFileSystem
        Return the active sync info for the specified syncPoints.
        Specified by:
        getActiveSyncInfo in interface UnderFileSystem
        Returns:
        active sync info consisting of what changed for these sync points
        Throws:
        java.io.IOException
      • startSync

        public void startSync​(AlluxioURI uri)
                       throws java.io.IOException
        Description copied from interface: UnderFileSystem
        Add Sync Point.
        Specified by:
        startSync in interface UnderFileSystem
        Parameters:
        uri - ufs uri to start
        Throws:
        java.io.IOException
      • stopSync

        public void stopSync​(AlluxioURI uri)
                      throws java.io.IOException
        Description copied from interface: UnderFileSystem
        Stop Sync Point.
        Specified by:
        stopSync in interface UnderFileSystem
        Parameters:
        uri - ufs uri to stop
        Throws:
        java.io.IOException
      • performListingAsync

        public void performListingAsync​(java.lang.String path,
                                        @Nullable
                                        java.lang.String continuationToken,
                                        @Nullable
                                        java.lang.String startAfter,
                                        DescendantType descendantType,
                                        boolean checkStatus,
                                        java.util.function.Consumer<UfsLoadResult> onComplete,
                                        java.util.function.Consumer<java.lang.Throwable> onError)
        Description copied from interface: AsyncUfsClient
        Lists the ufs statuses for a given path. The UfsStatus.getName() function for the returned values should include the full path of each item from the UFS root (not including the bucket name for object stores). It differs from a traditional listing in that if the input variable checkStatus is true, the UfsStatus for the base path should be included at the start of the results. The function should return immediately, and perform the operation asynchronously.
        Specified by:
        performListingAsync in interface AsyncUfsClient
        Parameters:
        path - the path in ufs
        continuationToken - the continuation token
        startAfter - the start after string where the loading starts from
        descendantType - the load descendant type (NONE/ONE/ALL)
        checkStatus - if true the call will perform a GetStatus on the path to see if an object exists, which should be returned as part of the result
        onComplete - the callback when the load is complete
        onError - the callback when the load encountered an error