Class RouterAsyncNamenodeProtocol

java.lang.Object
org.apache.hadoop.hdfs.server.federation.router.RouterNamenodeProtocol
org.apache.hadoop.hdfs.server.federation.router.async.RouterAsyncNamenodeProtocol
All Implemented Interfaces:
org.apache.hadoop.hdfs.server.protocol.NamenodeProtocol

public class RouterAsyncNamenodeProtocol extends RouterNamenodeProtocol
Module that implements all the asynchronous RPC calls in NamenodeProtocol in the RouterRpcServer.
  • Constructor Details

    • RouterAsyncNamenodeProtocol

      public RouterAsyncNamenodeProtocol(RouterRpcServer server)
  • Method Details

    • getBlocks

      public org.apache.hadoop.hdfs.server.protocol.BlocksWithLocations getBlocks(org.apache.hadoop.hdfs.protocol.DatanodeInfo datanode, long size, long minBlockSize, long hotBlockTimeInterval, org.apache.hadoop.fs.StorageType storageType) throws IOException
      Asynchronously get a list of blocks belonging to datanode whose total size equals size.
      Specified by:
      getBlocks in interface org.apache.hadoop.hdfs.server.protocol.NamenodeProtocol
      Overrides:
      getBlocks in class RouterNamenodeProtocol
      Parameters:
      datanode - a data node
      size - requested size
      minBlockSize - each block should be of this minimum Block Size
      hotBlockTimeInterval - prefer to get blocks which are belong to the cold files accessed before the time interval
      storageType - the given storage type StorageType
      Returns:
      BlocksWithLocations a list of blocks & their locations
      Throws:
      IOException - if size is less than or equal to 0 or datanode does not exist
      See Also:
      • Balancer
    • getBlockKeys

      public org.apache.hadoop.hdfs.security.token.block.ExportedBlockKeys getBlockKeys() throws IOException
      Asynchronously get the current block keys.
      Specified by:
      getBlockKeys in interface org.apache.hadoop.hdfs.server.protocol.NamenodeProtocol
      Overrides:
      getBlockKeys in class RouterNamenodeProtocol
      Returns:
      ExportedBlockKeys containing current block keys
      Throws:
      IOException - if there is no namespace available or other ioExceptions.
    • getTransactionID

      public long getTransactionID() throws IOException
      Asynchronously get the most recent transaction ID.
      Specified by:
      getTransactionID in interface org.apache.hadoop.hdfs.server.protocol.NamenodeProtocol
      Overrides:
      getTransactionID in class RouterNamenodeProtocol
      Returns:
      The most recent transaction ID that has been synced to persistent storage, or applied from persistent storage in the case of a non-active node.
      Throws:
      IOException - if there is no namespace available or other ioExceptions.
    • getMostRecentCheckpointTxId

      public long getMostRecentCheckpointTxId() throws IOException
      Asynchronously get the transaction ID of the most recent checkpoint.
      Specified by:
      getMostRecentCheckpointTxId in interface org.apache.hadoop.hdfs.server.protocol.NamenodeProtocol
      Overrides:
      getMostRecentCheckpointTxId in class RouterNamenodeProtocol
      Returns:
      The transaction ID of the most recent checkpoint.
      Throws:
      IOException - if there is no namespace available or other ioExceptions.
    • getMostRecentNameNodeFileTxId

      public long getMostRecentNameNodeFileTxId(org.apache.hadoop.hdfs.server.namenode.NNStorage.NameNodeFile nnf) throws IOException
      Asynchronously get the transaction ID of the most recent checkpoint for the given NameNodeFile.
      Specified by:
      getMostRecentNameNodeFileTxId in interface org.apache.hadoop.hdfs.server.protocol.NamenodeProtocol
      Overrides:
      getMostRecentNameNodeFileTxId in class RouterNamenodeProtocol
      Returns:
      The transaction ID of the most recent checkpoint for the given NameNodeFile.
      Throws:
      IOException - if there is no namespace available or other ioExceptions.
    • versionRequest

      public org.apache.hadoop.hdfs.server.protocol.NamespaceInfo versionRequest() throws IOException
      Asynchronously request name-node version and storage information.
      Specified by:
      versionRequest in interface org.apache.hadoop.hdfs.server.protocol.NamenodeProtocol
      Overrides:
      versionRequest in class RouterNamenodeProtocol
      Returns:
      NamespaceInfo identifying versions and storage information of the name-node.
      Throws:
      IOException - if there is no namespace available or other ioExceptions.