[jira] [Comment Edited] (HBASE-14925) Develop HBase shell command/tool to list table's region info through command line
[ https://issues.apache.org/jira/browse/HBASE-14925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15989771#comment-15989771 ] Ashish Singhi edited comment on HBASE-14925 at 4/29/17 5:14 AM: Thanks for taking a look. If in case [~karanmehta93] doesn't show up for the above comments by Monday, then its my responsibility to put up an addendum to address the comments pointed out by [~enis] and release note as commented by [~busbey]. was (Author: ashish singhi): Thanks for taking a look. If [~karanmehta93], doesn't show up for the above comments by Monday, then its my responsibility to put up an addendum to address the comments pointed out by [~enis] and release note as commented by [~busbey]. > Develop HBase shell command/tool to list table's region info through command > line > - > > Key: HBASE-14925 > URL: https://issues.apache.org/jira/browse/HBASE-14925 > Project: HBase > Issue Type: Improvement > Components: shell >Reporter: Romil Choksi >Assignee: Karan Mehta > Fix For: 2.0.0, 1.4.0 > > Attachments: HBASE-14925.002.patch, HBASE-14925.003.patch, > HBASE-14925.patch > > > I am going through the hbase shell commands to see if there is anything I can > use to get all the regions info just for a particular table. I don’t see any > such command that provides me that information. > It would be better to have a command that provides region info, start key, > end key etc taking a table name as the input parameter. This is available > through HBase UI on clicking on a particular table's link > A tool/shell command to get a list of regions for a table or all tables in a > tabular structured output (that is machine readable) -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Comment Edited] (HBASE-14925) Develop HBase shell command/tool to list table's region info through command line
[ https://issues.apache.org/jira/browse/HBASE-14925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15957799#comment-15957799 ] Karan Mehta edited comment on HBASE-14925 at 4/5/17 9:46 PM: - {quote} Where are we using this ? @end_time = Time.now {quote} This is to determine the time taken for the command to execute, the {{start_time}} variable is initialized before the call to this function. Added a new patch with proper formatting now. Please suggest if there are better ways to format it. This formatting may be little disrupted if table names are huge or viewing screen size is small, when a single row of data extends up to 2 or more lines. The {{formatter.rb}} file doesn't help format if there are more than 2 columns to be displayed. was (Author: karanmehta93): {quote} Where are we using this ? @end_time = Time.now {quote} This is to determine the time taken for the command to execute, the {{start_time}} variable is initialized before the call to this function. Added a new patch with proper formatting now. Suggest if there are better ways to format it. The {{formatter.rb}} file doesn't help format if there are more than 2 columns to be displayed. > Develop HBase shell command/tool to list table's region info through command > line > - > > Key: HBASE-14925 > URL: https://issues.apache.org/jira/browse/HBASE-14925 > Project: HBase > Issue Type: Improvement > Components: shell >Reporter: Romil Choksi >Assignee: Karan Mehta > Attachments: HBASE-14925.002.patch, HBASE-14925.003.patch, > HBASE-14925.patch > > > I am going through the hbase shell commands to see if there is anything I can > use to get all the regions info just for a particular table. I don’t see any > such command that provides me that information. > It would be better to have a command that provides region info, start key, > end key etc taking a table name as the input parameter. This is available > through HBase UI on clicking on a particular table's link > A tool/shell command to get a list of regions for a table or all tables in a > tabular structured output (that is machine readable) -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Comment Edited] (HBASE-14925) Develop HBase shell command/tool to list table's region info through command line
[ https://issues.apache.org/jira/browse/HBASE-14925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15832667#comment-15832667 ] ronan stokes edited comment on HBASE-14925 at 1/21/17 12:29 AM: Above example is ruby - so you can add it to a file and invoke {noformat} hbase shell {noformat} to load it. Once shell has loaded, you can use {noformat} list_regions '' {noformat} was (Author: rsto...@cloudera.com): Above example is ruby - so you can add it to a file and invoke {noquote} hbase shell {noquote} to load it. Once shell has loaded, you can use {noquote} list_regions '' {noquote} > Develop HBase shell command/tool to list table's region info through command > line > - > > Key: HBASE-14925 > URL: https://issues.apache.org/jira/browse/HBASE-14925 > Project: HBase > Issue Type: Improvement > Components: shell >Reporter: Romil Choksi >Assignee: huaxiang sun > > I am going through the hbase shell commands to see if there is anything I can > use to get all the regions info just for a particular table. I don’t see any > such command that provides me that information. > It would be better to have a command that provides region info, start key, > end key etc taking a table name as the input parameter. This is available > through HBase UI on clicking on a particular table's link > A tool/shell command to get a list of regions for a table or all tables in a > tabular structured output (that is machine readable) -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Comment Edited] (HBASE-14925) Develop HBase shell command/tool to list table's region info through command line
[ https://issues.apache.org/jira/browse/HBASE-14925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15832660#comment-15832660 ] ronan stokes edited comment on HBASE-14925 at 1/21/17 12:25 AM: Here's one mechanism to get the regions for a particular table from the shell - it would be relatively easy to turn it into a command. It's a little hackish as it reads an internal variable of the shell admin instance but when integrated as a command, it could use an appropriate mechanism... {noformat} # list_regions # return list of regions for a table as an array # results are ordered by start key # each element of list is hash of { "name","size", "requests" } # def list_regions(tgtTable) hbadmin = @hbase.admin(@hbase) hbjadmin = hbadmin.instance_variable_get("@admin") cluster_status = hbjadmin.getClusterStatus() master = cluster_status.getMaster() results = Array.new for server in cluster_status.getServers() for name,region in cluster_status.getLoad(server).getRegionsLoad() region_name = region.getNameAsString() regionStoreFileSize = region.getStorefileSizeMB() regionRequests = region.getRequestsCount() if region_name.start_with? tgtTable results << { "server" => server, "name" => region_name, "size" => regionStoreFileSize, "requests" => regionRequests } end end end results.sort!{ |a,b| a["name"].split(',')[1] <=> b["name"].split(',')[1] } return results end {noformat} was (Author: rsto...@cloudera.com): Here's one mechanism to get the regions for a particular table from the shell - it would be relatively easy to turn it into a command. It's a little hackish as it reads an internal variable of the shell admin instance but when integrated as a command, it could use an appropriate mechanism... {quote} # list_regions # return list of regions for a table as an array # results are ordered by start key # each element of list is hash of { "name","size", "requests" } # def list_regions(tgtTable) hbadmin = @hbase.admin(@hbase) hbjadmin = hbadmin.instance_variable_get("@admin") cluster_status = hbjadmin.getClusterStatus() master = cluster_status.getMaster() results = Array.new for server in cluster_status.getServers() for name,region in cluster_status.getLoad(server).getRegionsLoad() region_name = region.getNameAsString() regionStoreFileSize = region.getStorefileSizeMB() regionRequests = region.getRequestsCount() if region_name.start_with? tgtTable results << { "server" => server, "name" => region_name, "size" => regionStoreFileSize, "requests" => regionRequests } end end end results.sort!{ |a,b| a["name"].split(',')[1] <=> b["name"].split(',')[1] } return results end {quote} > Develop HBase shell command/tool to list table's region info through command > line > - > > Key: HBASE-14925 > URL: https://issues.apache.org/jira/browse/HBASE-14925 > Project: HBase > Issue Type: Improvement > Components: shell >Reporter: Romil Choksi >Assignee: huaxiang sun > > I am going through the hbase shell commands to see if there is anything I can > use to get all the regions info just for a particular table. I don’t see any > such command that provides me that information. > It would be better to have a command that provides region info, start key, > end key etc taking a table name as the input parameter. This is available > through HBase UI on clicking on a particular table's link > A tool/shell command to get a list of regions for a table or all tables in a > tabular structured output (that is machine readable) -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Comment Edited] (HBASE-14925) Develop HBase shell command/tool to list table's region info through command line
[ https://issues.apache.org/jira/browse/HBASE-14925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15832660#comment-15832660 ] ronan stokes edited comment on HBASE-14925 at 1/21/17 12:23 AM: Here's one mechanism to get the regions for a particular table from the shell - it would be relatively easy to turn it into a command. It's a little hackish as it reads an internal variable of the shell admin instance but when integrated as a command, it could use an appropriate mechanism... {quote} # list_regions # return list of regions for a table as an array # results are ordered by start key # each element of list is hash of { "name","size", "requests" } # def list_regions(tgtTable) hbadmin = @hbase.admin(@hbase) hbjadmin = hbadmin.instance_variable_get("@admin") cluster_status = hbjadmin.getClusterStatus() master = cluster_status.getMaster() results = Array.new for server in cluster_status.getServers() for name,region in cluster_status.getLoad(server).getRegionsLoad() region_name = region.getNameAsString() regionStoreFileSize = region.getStorefileSizeMB() regionRequests = region.getRequestsCount() if region_name.start_with? tgtTable results << { "server" => server, "name" => region_name, "size" => regionStoreFileSize, "requests" => regionRequests } end end end results.sort!{ |a,b| a["name"].split(',')[1] <=> b["name"].split(',')[1] } return results end {quote} was (Author: rsto...@cloudera.com): Here's one mechanism to get the regions for a particular table from the shell - it would be relatively easy to turn it into a command. It's a little hackish as it reads an internal variable of the shell admin instance but when integrated as a command, it could use an appropriate mechanism... \# list_regions \# return list of regions for a table as an array \# results are ordered by start key \# each element of list is hash of \{ "name","size", "requests" \} \# def list_regions(tgtTable) hbadmin = @hbase.admin(@hbase) hbjadmin = hbadmin.instance_variable_get("@admin") cluster_status = hbjadmin.getClusterStatus() master = cluster_status.getMaster() results = Array.new for server in cluster_status.getServers() for name,region in cluster_status.getLoad(server).getRegionsLoad() region_name = region.getNameAsString() regionStoreFileSize = region.getStorefileSizeMB() regionRequests = region.getRequestsCount() if region_name.start_with? tgtTable results << { "server" => server, "name" => region_name, "size" => regionStoreFileSize, "requests" => regionRequests } end end end results.sort!{ |a,b| a["name"].split(',')[1] <=> b["name"].split(',')[1] } return results end > Develop HBase shell command/tool to list table's region info through command > line > - > > Key: HBASE-14925 > URL: https://issues.apache.org/jira/browse/HBASE-14925 > Project: HBase > Issue Type: Improvement > Components: shell >Reporter: Romil Choksi >Assignee: huaxiang sun > > I am going through the hbase shell commands to see if there is anything I can > use to get all the regions info just for a particular table. I don’t see any > such command that provides me that information. > It would be better to have a command that provides region info, start key, > end key etc taking a table name as the input parameter. This is available > through HBase UI on clicking on a particular table's link > A tool/shell command to get a list of regions for a table or all tables in a > tabular structured output (that is machine readable) -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Comment Edited] (HBASE-14925) Develop HBase shell command/tool to list table's region info through command line
[ https://issues.apache.org/jira/browse/HBASE-14925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15832660#comment-15832660 ] ronan stokes edited comment on HBASE-14925 at 1/21/17 12:21 AM: Here's one mechanism to get the regions for a particular table from the shell - it would be relatively easy to turn it into a command. It's a little hackish as it reads an internal variable of the shell admin instance but when integrated as a command, it could use an appropriate mechanism... \# list_regions \# return list of regions for a table as an array \# results are ordered by start key \# each element of list is hash of { "name","size", "requests" } \# def list_regions(tgtTable) hbadmin = @hbase.admin(@hbase) hbjadmin = hbadmin.instance_variable_get("@admin") cluster_status = hbjadmin.getClusterStatus() master = cluster_status.getMaster() results = Array.new for server in cluster_status.getServers() for name,region in cluster_status.getLoad(server).getRegionsLoad() region_name = region.getNameAsString() regionStoreFileSize = region.getStorefileSizeMB() regionRequests = region.getRequestsCount() if region_name.start_with? tgtTable results << { "server" => server, "name" => region_name, "size" => regionStoreFileSize, "requests" => regionRequests } end end end results.sort!{ |a,b| a["name"].split(',')[1] <=> b["name"].split(',')[1] } return results end was (Author: rsto...@cloudera.com): Here's one mechanism to get the regions for a particular table from the shell - it would be relatively easy to turn it into a command. It's a little hackish as it reads an internal variable of the shell admin instance but when integrated as a command, it could use an appropriate mechanism... # list_regions # return list of regions for a table as an array # results are ordered by start key # each element of list is hash of { "name","size", "requests" } # def list_regions(tgtTable) hbadmin = @hbase.admin(@hbase) hbjadmin = hbadmin.instance_variable_get("@admin") cluster_status = hbjadmin.getClusterStatus() master = cluster_status.getMaster() results = Array.new for server in cluster_status.getServers() for name,region in cluster_status.getLoad(server).getRegionsLoad() region_name = region.getNameAsString() regionStoreFileSize = region.getStorefileSizeMB() regionRequests = region.getRequestsCount() if region_name.start_with? tgtTable results << { "server" => server, "name" => region_name, "size" => regionStoreFileSize, "requests" => regionRequests } end end end results.sort!{ |a,b| a["name"].split(',')[1] <=> b["name"].split(',')[1] } return results end > Develop HBase shell command/tool to list table's region info through command > line > - > > Key: HBASE-14925 > URL: https://issues.apache.org/jira/browse/HBASE-14925 > Project: HBase > Issue Type: Improvement > Components: shell >Reporter: Romil Choksi >Assignee: huaxiang sun > > I am going through the hbase shell commands to see if there is anything I can > use to get all the regions info just for a particular table. I don’t see any > such command that provides me that information. > It would be better to have a command that provides region info, start key, > end key etc taking a table name as the input parameter. This is available > through HBase UI on clicking on a particular table's link > A tool/shell command to get a list of regions for a table or all tables in a > tabular structured output (that is machine readable) -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Comment Edited] (HBASE-14925) Develop HBase shell command/tool to list table's region info through command line
[ https://issues.apache.org/jira/browse/HBASE-14925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15832660#comment-15832660 ] ronan stokes edited comment on HBASE-14925 at 1/21/17 12:22 AM: Here's one mechanism to get the regions for a particular table from the shell - it would be relatively easy to turn it into a command. It's a little hackish as it reads an internal variable of the shell admin instance but when integrated as a command, it could use an appropriate mechanism... \# list_regions \# return list of regions for a table as an array \# results are ordered by start key \# each element of list is hash of \{ "name","size", "requests" \} \# def list_regions(tgtTable) hbadmin = @hbase.admin(@hbase) hbjadmin = hbadmin.instance_variable_get("@admin") cluster_status = hbjadmin.getClusterStatus() master = cluster_status.getMaster() results = Array.new for server in cluster_status.getServers() for name,region in cluster_status.getLoad(server).getRegionsLoad() region_name = region.getNameAsString() regionStoreFileSize = region.getStorefileSizeMB() regionRequests = region.getRequestsCount() if region_name.start_with? tgtTable results << { "server" => server, "name" => region_name, "size" => regionStoreFileSize, "requests" => regionRequests } end end end results.sort!{ |a,b| a["name"].split(',')[1] <=> b["name"].split(',')[1] } return results end was (Author: rsto...@cloudera.com): Here's one mechanism to get the regions for a particular table from the shell - it would be relatively easy to turn it into a command. It's a little hackish as it reads an internal variable of the shell admin instance but when integrated as a command, it could use an appropriate mechanism... \# list_regions \# return list of regions for a table as an array \# results are ordered by start key \# each element of list is hash of { "name","size", "requests" } \# def list_regions(tgtTable) hbadmin = @hbase.admin(@hbase) hbjadmin = hbadmin.instance_variable_get("@admin") cluster_status = hbjadmin.getClusterStatus() master = cluster_status.getMaster() results = Array.new for server in cluster_status.getServers() for name,region in cluster_status.getLoad(server).getRegionsLoad() region_name = region.getNameAsString() regionStoreFileSize = region.getStorefileSizeMB() regionRequests = region.getRequestsCount() if region_name.start_with? tgtTable results << { "server" => server, "name" => region_name, "size" => regionStoreFileSize, "requests" => regionRequests } end end end results.sort!{ |a,b| a["name"].split(',')[1] <=> b["name"].split(',')[1] } return results end > Develop HBase shell command/tool to list table's region info through command > line > - > > Key: HBASE-14925 > URL: https://issues.apache.org/jira/browse/HBASE-14925 > Project: HBase > Issue Type: Improvement > Components: shell >Reporter: Romil Choksi >Assignee: huaxiang sun > > I am going through the hbase shell commands to see if there is anything I can > use to get all the regions info just for a particular table. I don’t see any > such command that provides me that information. > It would be better to have a command that provides region info, start key, > end key etc taking a table name as the input parameter. This is available > through HBase UI on clicking on a particular table's link > A tool/shell command to get a list of regions for a table or all tables in a > tabular structured output (that is machine readable) -- This message was sent by Atlassian JIRA (v6.3.4#6332)