分享

问题:hbase shell命令

fanbells 发表于 2014-2-14 09:17:31 [显示全部楼层] 回帖奖励 阅读模式 关闭右栏 0 6233
问一下 大家,有谁知道hbase shell命令调用的哪块的方法?

没找到任何评论,期待你打破沉寂

pig2 发表于 2014-2-14 11:58:40
你可以通过cat hbase命令来进行查看。这里以hadoop为例:输入
  1. cat hadoop
复制代码
,如下图
hadoop.jpg

截取了部分内容如下:
  1. # figure out which class to run
  2. if [ "$COMMAND" = "classpath" ] ; then
  3.   if $cygwin; then
  4.     CLASSPATH=`cygpath -p -w "$CLASSPATH"`
  5.   fi
  6.   echo $CLASSPATH
  7.   exit
  8. elif [ "$COMMAND" = "namenode" ] ; then
  9.   CLASS='org.apache.hadoop.hdfs.server.namenode.NameNode'
  10.   HADOOP_OPTS="$HADOOP_OPTS $HADOOP_NAMENODE_OPTS"
  11. elif [ "$COMMAND" = "secondarynamenode" ] ; then
  12.   CLASS='org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode'
  13.   HADOOP_OPTS="$HADOOP_OPTS $HADOOP_SECONDARYNAMENODE_OPTS"
  14. elif [ "$COMMAND" = "datanode" ] ; then
  15.   CLASS='org.apache.hadoop.hdfs.server.datanode.DataNode'
  16.   if [ "$starting_secure_dn" = "true" ]; then
  17.     HADOOP_OPTS="$HADOOP_OPTS -jvm server $HADOOP_DATANODE_OPTS"
  18.   else
  19.     HADOOP_OPTS="$HADOOP_OPTS -server $HADOOP_DATANODE_OPTS"
  20.   fi
  21. elif [ "$COMMAND" = "fs" ] ; then
  22.   CLASS=org.apache.hadoop.fs.FsShell
  23.   HADOOP_OPTS="$HADOOP_OPTS $HADOOP_CLIENT_OPTS"
  24. elif [ "$COMMAND" = "dfs" ] ; then
  25.   CLASS=org.apache.hadoop.fs.FsShell
  26.   HADOOP_OPTS="$HADOOP_OPTS $HADOOP_CLIENT_OPTS"
  27. elif [ "$COMMAND" = "dfsadmin" ] ; then
  28.   CLASS=org.apache.hadoop.hdfs.tools.DFSAdmin
  29.   HADOOP_OPTS="$HADOOP_OPTS $HADOOP_CLIENT_OPTS"
  30. elif [ "$COMMAND" = "mradmin" ] ; then
  31.   CLASS=org.apache.hadoop.mapred.tools.MRAdmin
  32.   HADOOP_OPTS="$HADOOP_OPTS $HADOOP_CLIENT_OPTS"
  33. elif [ "$COMMAND" = "fsck" ] ; then
  34.   CLASS=org.apache.hadoop.hdfs.tools.DFSck
  35.   HADOOP_OPTS="$HADOOP_OPTS $HADOOP_CLIENT_OPTS"
  36. elif [ "$COMMAND" = "balancer" ] ; then
  37.   CLASS=org.apache.hadoop.hdfs.server.balancer.Balancer
  38.   HADOOP_OPTS="$HADOOP_OPTS $HADOOP_BALANCER_OPTS"
  39. elif [ "$COMMAND" = "fetchdt" ] ; then
  40.   CLASS=org.apache.hadoop.hdfs.tools.DelegationTokenFetcher
  41. elif [ "$COMMAND" = "jobtracker" ] ; then
  42.   CLASS=org.apache.hadoop.mapred.JobTracker
  43.   HADOOP_OPTS="$HADOOP_OPTS $HADOOP_JOBTRACKER_OPTS"
  44. elif [ "$COMMAND" = "historyserver" ] ; then
  45.   CLASS=org.apache.hadoop.mapred.JobHistoryServer
  46.   HADOOP_OPTS="$HADOOP_OPTS $HADOOP_JOB_HISTORYSERVER_OPTS"
  47. elif [ "$COMMAND" = "tasktracker" ] ; then
  48.   CLASS=org.apache.hadoop.mapred.TaskTracker
  49.   HADOOP_OPTS="$HADOOP_OPTS $HADOOP_TASKTRACKER_OPTS"
  50. elif [ "$COMMAND" = "job" ] ; then
  51.   CLASS=org.apache.hadoop.mapred.JobClient
  52.   HADOOP_OPTS="$HADOOP_OPTS $HADOOP_CLIENT_OPTS"
复制代码
这里从上面在次截取一部分,可以看到下面,如果是fs 命令,我们则调用org.apache.hadoop.fs.FsShell。

如果dfs命令,我们则调用org.apache.hadoop.fs.FsShell。
  1. elif [ "$COMMAND" = "fs" ] ; then
  2. CLASS=org.apache.hadoop.fs.FsShell
  3. HADOOP_OPTS="$HADOOP_OPTS $HADOOP_CLIENT_OPTS"
  4. elif [ "$COMMAND" = "dfs" ] ; then
  5. CLASS=org.apache.hadoop.fs.FsShell
  6. HADOOP_OPTS="$HADOOP_OPTS $HADOOP_CLIENT_OPTS"
复制代码
所以你可以通过cat put来查看put的调用的相关类,通过cat get来查看get调用的类。对于具体可以查看Hbase Java编程实现增删改查




回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条