Package com.mapr.cli
Class MapRCliUtil
java.lang.Object
com.mapr.cli.MapRCliUtil
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> TasyncInvoke(Callable<T> callable, int timeout, String execContext) static <T> TasyncInvoke(Callable<T> callable, String execContext) static com.mapr.fs.proto.Common.IPAddressbuildIPAddressFromString(String ipstr) static com.mapr.baseutils.cldbutils.CLDBRpcCommonUtils.IpAddrbuildIpAddrFromIPAddress(com.mapr.fs.proto.Common.IPAddress ipAddress) static booleancreateParentDir(com.mapr.fs.MapRFileSystem fs, String clusterName, String path) static StringextractClusterNameFromFullyQualifiedPath(String fullyQualifiedPath) static intfetchCLDBParams(String cluster, Properties CLDBProperties, com.mapr.fs.proto.Security.CredentialsMsg creds) static StringfetchEmail(Properties prop, String user, boolean type) static longgetECUsageFromOffloadedSize(long tierPurged, int dataFragments, int globalParity, int localParity) Calculates the size of EC usage from offload based on the provided parameters.static StringgetFidAsString(com.mapr.fs.proto.Common.FidMsg fid) static List<com.mapr.baseutils.cldbutils.CLDBRpcCommonUtils.IpAddr>getHostIps(String hostname) static Stringstatic StringgetHostname(com.mapr.fs.cldb.proto.CLDBProto.FileServerInfo fs) static org.apache.hadoop.mapred.JobClientgetJobClient(String zkConnectString) static com.mapr.fs.MapRFileSystemstatic com.mapr.fs.MapRFileSystemgetMapRFileSystem(String uname) static Stringstatic intgetParentCid(com.mapr.fs.MapRFileSystem fs, String clusterName, String path) static StringgetRealRMWebAddress(String zkConnectString, com.mapr.fs.proto.Common.ServiceData masterServiceData) static org.apache.hadoop.yarn.client.api.YarnClientgetYarnClient(String zkConnectString) static Stringstatic StringgetZkConnect(String clusterName) static booleanisLocalAddr(String host) static booleanparentDirExists(com.mapr.fs.MapRFileSystem fs, String clusterName, String path) static int[]parseEcScheme(String ecScheme, com.mapr.cliframework.base.CommandOutput.OutputHierarchy out) static longquotaStringToMB(String quota) static byte[]sendRpc(com.google.protobuf.MessageLite request, int procId, String cluster, Class<? extends com.google.protobuf.MessageLite> responseClass) static com.mapr.fs.proto.Common.FidMsgstatic booleanvalidateEmail(String email)
-
Field Details
-
JTTimeout
public static final int JTTimeout- See Also:
-
ParamEntityQuerySource
- See Also:
-
ParamDomainName
- See Also:
-
CLDB_DEFAULT_PORT
public static final int CLDB_DEFAULT_PORT- See Also:
-
CLUSTER_NAME_PARAM
- See Also:
-
MAPR_PATH_PREFIX
- See Also:
-
MAPR_PATH_PREFIX_LENGTH
public static final int MAPR_PATH_PREFIX_LENGTH
-
-
Constructor Details
-
MapRCliUtil
public MapRCliUtil()
-
-
Method Details
-
fetchEmail
-
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
-
quotaStringToMB
-
buildIPAddressFromString
-
buildIpAddrFromIPAddress
public static com.mapr.baseutils.cldbutils.CLDBRpcCommonUtils.IpAddr buildIpAddrFromIPAddress(com.mapr.fs.proto.Common.IPAddress ipAddress) -
getHostIps
-
validateEmail
-
getHostname
-
getHostname
-
isLocalAddr
-
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
-
asyncInvoke
-
asyncInvoke
-
getYarnClient
-
getRealRMWebAddress
-
extractClusterNameFromFullyQualifiedPath
-
getFidAsString
-
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
- 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
-