Package com.mapr.cli

Class MapRCliUtil

java.lang.Object
com.mapr.cli.MapRCliUtil

public class MapRCliUtil extends Object
  • Field Details

  • Constructor Details

    • MapRCliUtil

      public MapRCliUtil()
  • Method Details

    • fetchEmail

      public static String fetchEmail(Properties prop, String user, boolean type)
    • fetchCLDBParams

      public static int fetchCLDBParams(String cluster, Properties CLDBProperties, com.mapr.fs.proto.Security.CredentialsMsg creds) throws com.mapr.cliframework.base.CLIProcessingException
      Throws:
      com.mapr.cliframework.base.CLIProcessingException
    • stringToFid

      public static com.mapr.fs.proto.Common.FidMsg stringToFid(String s)
    • quotaStringToMB

      public static long quotaStringToMB(String quota)
    • buildIPAddressFromString

      public static com.mapr.fs.proto.Common.IPAddress buildIPAddressFromString(String ipstr)
    • buildIpAddrFromIPAddress

      public static com.mapr.baseutils.cldbutils.CLDBRpcCommonUtils.IpAddr buildIpAddrFromIPAddress(com.mapr.fs.proto.Common.IPAddress ipAddress)
    • getHostIps

      public static List<com.mapr.baseutils.cldbutils.CLDBRpcCommonUtils.IpAddr> getHostIps(String hostname)
    • validateEmail

      public static boolean validateEmail(String email)
    • getHostname

      public static String getHostname(com.mapr.fs.cldb.proto.CLDBProto.FileServerInfo fs)
    • getHostname

      public static String getHostname()
    • isLocalAddr

      public static boolean isLocalAddr(String host)
    • getMapRInstallDir

      public static String getMapRInstallDir()
    • getMapRFileSystem

      public static com.mapr.fs.MapRFileSystem getMapRFileSystem() throws com.mapr.cliframework.base.CLIProcessingException
      Throws:
      com.mapr.cliframework.base.CLIProcessingException
    • getMapRFileSystem

      public static com.mapr.fs.MapRFileSystem getMapRFileSystem(String uname) throws com.mapr.cliframework.base.CLIProcessingException
      Throws:
      com.mapr.cliframework.base.CLIProcessingException
    • parentDirExists

      public static boolean parentDirExists(com.mapr.fs.MapRFileSystem fs, String clusterName, String path) throws com.mapr.cliframework.base.CLIProcessingException
      Throws:
      com.mapr.cliframework.base.CLIProcessingException
    • getParentCid

      public static int getParentCid(com.mapr.fs.MapRFileSystem fs, String clusterName, String path) throws com.mapr.cliframework.base.CLIProcessingException
      Throws:
      com.mapr.cliframework.base.CLIProcessingException
    • createParentDir

      public static boolean createParentDir(com.mapr.fs.MapRFileSystem fs, String clusterName, String path) throws com.mapr.cliframework.base.CLIProcessingException
      Throws:
      com.mapr.cliframework.base.CLIProcessingException
    • sendRpc

      public static byte[] sendRpc(com.google.protobuf.MessageLite request, int procId, String cluster, Class<? extends com.google.protobuf.MessageLite> responseClass) throws Exception
      Throws:
      Exception
    • getJobClient

      public static org.apache.hadoop.mapred.JobClient getJobClient(String zkConnectString)
    • asyncInvoke

      public static <T> T asyncInvoke(Callable<T> callable, String execContext)
    • asyncInvoke

      public static <T> T asyncInvoke(Callable<T> callable, int timeout, String execContext)
    • getYarnClient

      public static org.apache.hadoop.yarn.client.api.YarnClient getYarnClient(String zkConnectString)
    • getRealRMWebAddress

      public static String getRealRMWebAddress(String zkConnectString, com.mapr.fs.proto.Common.ServiceData masterServiceData)
    • extractClusterNameFromFullyQualifiedPath

      public static String extractClusterNameFromFullyQualifiedPath(String fullyQualifiedPath)
    • getFidAsString

      public static String getFidAsString(com.mapr.fs.proto.Common.FidMsg fid)
    • parseEcScheme

      public static int[] parseEcScheme(String ecScheme, com.mapr.cliframework.base.CommandOutput.OutputHierarchy out)
    • getECUsageFromOffloadedSize

      public static long getECUsageFromOffloadedSize(long tierPurged, int dataFragments, int globalParity, int localParity)
      Calculates the size of EC usage from offload based on the provided parameters.
      Parameters:
      tierPurged - The data purged from the frontend.
      dataFragments - The number of data fragments in the EC scheme.
      globalParity - The number of global parity in the EC scheme.
      localParity - The number of local parity in the EC scheme.
      Returns:
      The EC usage offloaded size.
    • getZkConnect

      public static String getZkConnect() throws com.mapr.cliframework.base.CLIProcessingException
      Throws:
      com.mapr.cliframework.base.CLIProcessingException
    • getZkConnect

      public static String getZkConnect(String clusterName) throws com.mapr.cliframework.base.CLIProcessingException
      Throws:
      com.mapr.cliframework.base.CLIProcessingException