Class RouterAsyncClientProtocol

java.lang.Object
org.apache.hadoop.hdfs.server.federation.router.RouterClientProtocol
org.apache.hadoop.hdfs.server.federation.router.async.RouterAsyncClientProtocol
All Implemented Interfaces:
org.apache.hadoop.hdfs.protocol.ClientProtocol

public class RouterAsyncClientProtocol extends RouterClientProtocol
Module that implements all the async RPC calls in ClientProtocol in the RouterRpcServer.
  • Constructor Details

    • RouterAsyncClientProtocol

      public RouterAsyncClientProtocol(org.apache.hadoop.conf.Configuration conf, RouterRpcServer rpcServer)
  • Method Details

    • getServerDefaults

      public org.apache.hadoop.fs.FsServerDefaults getServerDefaults() throws IOException
      Specified by:
      getServerDefaults in interface org.apache.hadoop.hdfs.protocol.ClientProtocol
      Overrides:
      getServerDefaults in class RouterClientProtocol
      Throws:
      IOException
    • create

      public org.apache.hadoop.hdfs.protocol.HdfsFileStatus create(String src, org.apache.hadoop.fs.permission.FsPermission masked, String clientName, org.apache.hadoop.io.EnumSetWritable<org.apache.hadoop.fs.CreateFlag> flag, boolean createParent, short replication, long blockSize, org.apache.hadoop.crypto.CryptoProtocolVersion[] supportedVersions, String ecPolicyName, String storagePolicy) throws IOException
      Specified by:
      create in interface org.apache.hadoop.hdfs.protocol.ClientProtocol
      Overrides:
      create in class RouterClientProtocol
      Throws:
      IOException
    • append

      public org.apache.hadoop.hdfs.protocol.LastBlockWithStatus append(String src, String clientName, org.apache.hadoop.io.EnumSetWritable<org.apache.hadoop.fs.CreateFlag> flag) throws IOException
      Specified by:
      append in interface org.apache.hadoop.hdfs.protocol.ClientProtocol
      Overrides:
      append in class RouterClientProtocol
      Throws:
      IOException
    • rename

      @Deprecated public boolean rename(String src, String dst) throws IOException
      Deprecated.
      Specified by:
      rename in interface org.apache.hadoop.hdfs.protocol.ClientProtocol
      Overrides:
      rename in class RouterClientProtocol
      Throws:
      IOException
    • rename2

      public void rename2(String src, String dst, org.apache.hadoop.fs.Options.Rename... options) throws IOException
      Specified by:
      rename2 in interface org.apache.hadoop.hdfs.protocol.ClientProtocol
      Overrides:
      rename2 in class RouterClientProtocol
      Throws:
      IOException
    • concat

      public void concat(String trg, String[] src) throws IOException
      Specified by:
      concat in interface org.apache.hadoop.hdfs.protocol.ClientProtocol
      Overrides:
      concat in class RouterClientProtocol
      Throws:
      IOException
    • mkdirs

      public boolean mkdirs(String src, org.apache.hadoop.fs.permission.FsPermission masked, boolean createParent) throws IOException
      Specified by:
      mkdirs in interface org.apache.hadoop.hdfs.protocol.ClientProtocol
      Overrides:
      mkdirs in class RouterClientProtocol
      Throws:
      IOException
    • getListing

      public org.apache.hadoop.hdfs.protocol.DirectoryListing getListing(String src, byte[] startAfter, boolean needLocation) throws IOException
      Specified by:
      getListing in interface org.apache.hadoop.hdfs.protocol.ClientProtocol
      Overrides:
      getListing in class RouterClientProtocol
      Throws:
      IOException
    • getListingInt

      protected List<RemoteResult<RemoteLocation,org.apache.hadoop.hdfs.protocol.DirectoryListing>> getListingInt(String src, byte[] startAfter, boolean needLocation) throws IOException
      Get listing on remote locations.
      Overrides:
      getListingInt in class RouterClientProtocol
      Parameters:
      src - the directory name
      startAfter - the name to start after
      needLocation - if blockLocations need to be returned
      Returns:
      a partial listing starting after startAfter
      Throws:
      IOException - if other I/O error occurred
    • getFileInfo

      public org.apache.hadoop.hdfs.protocol.HdfsFileStatus getFileInfo(String src) throws IOException
      Specified by:
      getFileInfo in interface org.apache.hadoop.hdfs.protocol.ClientProtocol
      Overrides:
      getFileInfo in class RouterClientProtocol
      Throws:
      IOException
    • getFileRemoteLocation

      public RemoteLocation getFileRemoteLocation(String path) throws IOException
      Overrides:
      getFileRemoteLocation in class RouterClientProtocol
      Throws:
      IOException
    • getMountPointStatus

      public org.apache.hadoop.hdfs.protocol.HdfsFileStatus getMountPointStatus(String name, int childrenNum, long date, boolean setPath)
      Description copied from class: RouterClientProtocol
      Create a new file status for a mount point.
      Overrides:
      getMountPointStatus in class RouterClientProtocol
      Parameters:
      name - Name of the mount point.
      childrenNum - Number of children.
      date - Map with the dates.
      setPath - if true should set path in HdfsFileStatus
      Returns:
      New HDFS file status representing a mount point.
    • getFileInfoAll

      protected org.apache.hadoop.hdfs.protocol.HdfsFileStatus getFileInfoAll(List<RemoteLocation> locations, RemoteMethod method, long timeOutMs) throws IOException
      Description copied from class: RouterClientProtocol
      Get the file info from all the locations.
      Overrides:
      getFileInfoAll in class RouterClientProtocol
      Parameters:
      locations - Locations to check.
      method - The file information method to run.
      timeOutMs - Time out for the operation in milliseconds.
      Returns:
      The first file info if it's a file, the directory if it's everywhere.
      Throws:
      IOException - If all the locations throw an exception.
    • recoverLease

      public boolean recoverLease(String src, String clientName) throws IOException
      Specified by:
      recoverLease in interface org.apache.hadoop.hdfs.protocol.ClientProtocol
      Overrides:
      recoverLease in class RouterClientProtocol
      Throws:
      IOException
    • getStats

      public long[] getStats() throws IOException
      Specified by:
      getStats in interface org.apache.hadoop.hdfs.protocol.ClientProtocol
      Overrides:
      getStats in class RouterClientProtocol
      Throws:
      IOException
    • getReplicatedBlockStats

      public org.apache.hadoop.hdfs.protocol.ReplicatedBlockStats getReplicatedBlockStats() throws IOException
      Specified by:
      getReplicatedBlockStats in interface org.apache.hadoop.hdfs.protocol.ClientProtocol
      Overrides:
      getReplicatedBlockStats in class RouterClientProtocol
      Throws:
      IOException
    • getDatanodeReport

      public org.apache.hadoop.hdfs.protocol.DatanodeInfo[] getDatanodeReport(org.apache.hadoop.hdfs.protocol.HdfsConstants.DatanodeReportType type) throws IOException
      Specified by:
      getDatanodeReport in interface org.apache.hadoop.hdfs.protocol.ClientProtocol
      Overrides:
      getDatanodeReport in class RouterClientProtocol
      Throws:
      IOException
    • getSlowDatanodeReport

      public org.apache.hadoop.hdfs.protocol.DatanodeInfo[] getSlowDatanodeReport() throws IOException
      Specified by:
      getSlowDatanodeReport in interface org.apache.hadoop.hdfs.protocol.ClientProtocol
      Overrides:
      getSlowDatanodeReport in class RouterClientProtocol
      Throws:
      IOException
    • getDatanodeStorageReport

      public org.apache.hadoop.hdfs.server.protocol.DatanodeStorageReport[] getDatanodeStorageReport(org.apache.hadoop.hdfs.protocol.HdfsConstants.DatanodeReportType type) throws IOException
      Specified by:
      getDatanodeStorageReport in interface org.apache.hadoop.hdfs.protocol.ClientProtocol
      Overrides:
      getDatanodeStorageReport in class RouterClientProtocol
      Throws:
      IOException
    • getDatanodeStorageReport

      public org.apache.hadoop.hdfs.server.protocol.DatanodeStorageReport[] getDatanodeStorageReport(org.apache.hadoop.hdfs.protocol.HdfsConstants.DatanodeReportType type, boolean requireResponse, long timeOutMs) throws IOException
      Overrides:
      getDatanodeStorageReport in class RouterClientProtocol
      Throws:
      IOException
    • setSafeMode

      public boolean setSafeMode(org.apache.hadoop.hdfs.protocol.HdfsConstants.SafeModeAction action, boolean isChecked) throws IOException
      Specified by:
      setSafeMode in interface org.apache.hadoop.hdfs.protocol.ClientProtocol
      Overrides:
      setSafeMode in class RouterClientProtocol
      Throws:
      IOException
    • saveNamespace

      public boolean saveNamespace(long timeWindow, long txGap) throws IOException
      Specified by:
      saveNamespace in interface org.apache.hadoop.hdfs.protocol.ClientProtocol
      Overrides:
      saveNamespace in class RouterClientProtocol
      Throws:
      IOException
    • rollEdits

      public long rollEdits() throws IOException
      Specified by:
      rollEdits in interface org.apache.hadoop.hdfs.protocol.ClientProtocol
      Overrides:
      rollEdits in class RouterClientProtocol
      Throws:
      IOException
    • restoreFailedStorage

      public boolean restoreFailedStorage(String arg) throws IOException
      Specified by:
      restoreFailedStorage in interface org.apache.hadoop.hdfs.protocol.ClientProtocol
      Overrides:
      restoreFailedStorage in class RouterClientProtocol
      Throws:
      IOException
    • rollingUpgrade

      public org.apache.hadoop.hdfs.protocol.RollingUpgradeInfo rollingUpgrade(org.apache.hadoop.hdfs.protocol.HdfsConstants.RollingUpgradeAction action) throws IOException
      Specified by:
      rollingUpgrade in interface org.apache.hadoop.hdfs.protocol.ClientProtocol
      Overrides:
      rollingUpgrade in class RouterClientProtocol
      Throws:
      IOException
    • getContentSummary

      public org.apache.hadoop.fs.ContentSummary getContentSummary(String path) throws IOException
      Specified by:
      getContentSummary in interface org.apache.hadoop.hdfs.protocol.ClientProtocol
      Overrides:
      getContentSummary in class RouterClientProtocol
      Throws:
      IOException
    • getCurrentEditLogTxid

      public long getCurrentEditLogTxid() throws IOException
      Specified by:
      getCurrentEditLogTxid in interface org.apache.hadoop.hdfs.protocol.ClientProtocol
      Overrides:
      getCurrentEditLogTxid in class RouterClientProtocol
      Throws:
      IOException
    • msync

      public void msync() throws IOException
      Specified by:
      msync in interface org.apache.hadoop.hdfs.protocol.ClientProtocol
      Overrides:
      msync in class RouterClientProtocol
      Throws:
      IOException
    • setReplication

      public boolean setReplication(String src, short replication) throws IOException
      Specified by:
      setReplication in interface org.apache.hadoop.hdfs.protocol.ClientProtocol
      Overrides:
      setReplication in class RouterClientProtocol
      Throws:
      IOException
    • isMultiDestDirectory

      @VisibleForTesting public boolean isMultiDestDirectory(String src)
      Checks if the path is a directory and is supposed to be present in all subclusters.
      Overrides:
      isMultiDestDirectory in class RouterClientProtocol
      Parameters:
      src - the source path
      Returns:
      true if the path is directory and is supposed to be present in all subclusters else false in all other scenarios.
    • getEnclosingRoot

      public org.apache.hadoop.fs.Path getEnclosingRoot(String src) throws IOException
      Specified by:
      getEnclosingRoot in interface org.apache.hadoop.hdfs.protocol.ClientProtocol
      Overrides:
      getEnclosingRoot in class RouterClientProtocol
      Throws:
      IOException
    • getDelegationToken

      public org.apache.hadoop.security.token.Token<org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier> getDelegationToken(org.apache.hadoop.io.Text renewer) throws IOException
      Specified by:
      getDelegationToken in interface org.apache.hadoop.hdfs.protocol.ClientProtocol
      Overrides:
      getDelegationToken in class RouterClientProtocol
      Throws:
      IOException
    • renewDelegationToken

      public long renewDelegationToken(org.apache.hadoop.security.token.Token<org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier> token) throws IOException
      Specified by:
      renewDelegationToken in interface org.apache.hadoop.hdfs.protocol.ClientProtocol
      Overrides:
      renewDelegationToken in class RouterClientProtocol
      Throws:
      IOException
    • cancelDelegationToken

      public void cancelDelegationToken(org.apache.hadoop.security.token.Token<org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier> token) throws IOException
      Specified by:
      cancelDelegationToken in interface org.apache.hadoop.hdfs.protocol.ClientProtocol
      Overrides:
      cancelDelegationToken in class RouterClientProtocol
      Throws:
      IOException