Class OzoneManagerRatisUtils

java.lang.Object
org.apache.hadoop.ozone.om.ratis.utils.OzoneManagerRatisUtils

public final class OzoneManagerRatisUtils extends Object
Utility class used by OzoneManager HA.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
     
    createClientRequest(org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMRequest omRequest, OzoneManager ozoneManager)
    Create OMClientRequest which encapsulates the OMRequest.
    static org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMResponse
    createErrorResponse(org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMRequest omRequest, IOException exception)
     
    static org.apache.ratis.grpc.GrpcTlsConfig
    createServerTlsConfig(org.apache.hadoop.hdds.security.SecurityConfig conf, org.apache.hadoop.hdds.security.x509.certificate.client.CertificateClient caClient)
     
    static org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.Status
    Convert exception result to OzoneManagerProtocolProtos.Status.
    static String
    getOMRatisDirectory(org.apache.hadoop.hdds.conf.ConfigurationSource conf)
    Get the local directory where ratis logs will be stored.
    static String
    getOMRatisSnapshotDirectory(org.apache.hadoop.hdds.conf.ConfigurationSource conf)
    Get the local directory where ratis snapshots will be stored.
    static org.apache.hadoop.hdds.utils.TransactionInfo
    getTrxnInfoFromCheckpoint(org.apache.hadoop.hdds.conf.OzoneConfiguration conf, Path dbPath)
    Obtain OMTransactionInfo from Checkpoint.
    static org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMResponse
    submitRequest(OzoneManager om, org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMRequest omRequest, org.apache.ratis.protocol.ClientId clientId, long callId)
     
    static boolean
    verifyTransactionInfo(org.apache.hadoop.hdds.utils.TransactionInfo transactionInfo, long lastAppliedIndex, String leaderId, Path newDBlocation)
    Verify transaction info with provided lastAppliedIndex.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • createClientRequest

      public static OMClientRequest createClientRequest(org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMRequest omRequest, OzoneManager ozoneManager) throws IOException
      Create OMClientRequest which encapsulates the OMRequest.
      Parameters:
      omRequest -
      Returns:
      OMClientRequest
      Throws:
      IOException
    • exceptionToResponseStatus

      public static org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.Status exceptionToResponseStatus(Exception exception)
      Convert exception result to OzoneManagerProtocolProtos.Status.
      Parameters:
      exception -
      Returns:
      Status
    • getTrxnInfoFromCheckpoint

      public static org.apache.hadoop.hdds.utils.TransactionInfo getTrxnInfoFromCheckpoint(org.apache.hadoop.hdds.conf.OzoneConfiguration conf, Path dbPath) throws Exception
      Obtain OMTransactionInfo from Checkpoint.
      Throws:
      Exception
    • verifyTransactionInfo

      public static boolean verifyTransactionInfo(org.apache.hadoop.hdds.utils.TransactionInfo transactionInfo, long lastAppliedIndex, String leaderId, Path newDBlocation)
      Verify transaction info with provided lastAppliedIndex. If transaction info transaction Index is less than or equal to lastAppliedIndex, return false, else return true.
      Parameters:
      transactionInfo -
      lastAppliedIndex -
      leaderId -
      newDBlocation -
      Returns:
      boolean
    • getOMRatisDirectory

      public static String getOMRatisDirectory(org.apache.hadoop.hdds.conf.ConfigurationSource conf)
      Get the local directory where ratis logs will be stored.
    • getOMRatisSnapshotDirectory

      public static String getOMRatisSnapshotDirectory(org.apache.hadoop.hdds.conf.ConfigurationSource conf)
      Get the local directory where ratis snapshots will be stored.
    • checkLeaderStatus

      public static void checkLeaderStatus(OzoneManager ozoneManager) throws com.google.protobuf.ServiceException
      Throws:
      com.google.protobuf.ServiceException
    • createServerTlsConfig

      public static org.apache.ratis.grpc.GrpcTlsConfig createServerTlsConfig(org.apache.hadoop.hdds.security.SecurityConfig conf, org.apache.hadoop.hdds.security.x509.certificate.client.CertificateClient caClient) throws IOException
      Throws:
      IOException
    • submitRequest

      public static org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMResponse submitRequest(OzoneManager om, org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMRequest omRequest, org.apache.ratis.protocol.ClientId clientId, long callId) throws com.google.protobuf.ServiceException
      Throws:
      com.google.protobuf.ServiceException
    • createErrorResponse

      public static org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMResponse createErrorResponse(org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMRequest omRequest, IOException exception)