|
26 | 26 | import="java.util.LinkedHashMap" |
27 | 27 | import="java.util.List" |
28 | 28 | import="java.util.Map" |
| 29 | + import="java.util.Set" |
| 30 | + import="java.util.HashSet" |
29 | 31 | import="java.util.Optional" |
30 | 32 | import="java.util.TreeMap" |
31 | 33 | import="java.util.concurrent.TimeUnit" |
32 | 34 | import="org.apache.commons.lang3.StringEscapeUtils" |
33 | 35 | import="org.apache.hadoop.conf.Configuration" |
34 | | - import="org.apache.hadoop.hbase.HColumnDescriptor" |
35 | 36 | import="org.apache.hadoop.hbase.HConstants" |
36 | 37 | import="org.apache.hadoop.hbase.HRegionLocation" |
37 | 38 | import="org.apache.hadoop.hbase.HTableDescriptor" |
|
51 | 52 | import="org.apache.hadoop.hbase.client.RegionLocator" |
52 | 53 | import="org.apache.hadoop.hbase.client.RegionReplicaUtil" |
53 | 54 | import="org.apache.hadoop.hbase.client.Table" |
| 55 | + import="org.apache.hadoop.hbase.client.ColumnFamilyDescriptor" |
54 | 56 | import="org.apache.hadoop.hbase.http.InfoServer" |
55 | 57 | import="org.apache.hadoop.hbase.master.HMaster" |
56 | 58 | import="org.apache.hadoop.hbase.master.RegionState" |
|
771 | 773 | %> |
772 | 774 | </table> |
773 | 775 | <h2>Table Schema</h2> |
| 776 | + |
774 | 777 | <table class="table table-striped"> |
| 778 | +<% |
| 779 | + ColumnFamilyDescriptor[] families = table.getDescriptor().getColumnFamilies(); |
| 780 | + Set<Bytes> familyKeySet = new HashSet<>(); |
| 781 | + for (ColumnFamilyDescriptor family: families) { |
| 782 | + familyKeySet.addAll(family.getValues().keySet()); |
| 783 | + } |
| 784 | +%> |
775 | 785 | <tr> |
776 | | - <th>Column Family Name</th> |
777 | | - <th></th> |
| 786 | + <th>Property \ Column Family Name</th> |
| 787 | + <% |
| 788 | + for (ColumnFamilyDescriptor family: families) { |
| 789 | + %> |
| 790 | + <th> |
| 791 | + <%= StringEscapeUtils.escapeHtml4(family.getNameAsString()) %> |
| 792 | + </th> |
| 793 | + <% } %> |
778 | 794 | </tr> |
779 | | - <% |
780 | | - Collection<HColumnDescriptor> families = new HTableDescriptor(table.getDescriptor()).getFamilies(); |
781 | | - for (HColumnDescriptor family: families) { |
782 | | - %> |
783 | | - <tr> |
784 | | - <td><%= StringEscapeUtils.escapeHtml4(family.getNameAsString()) %></td> |
785 | | - <td> |
786 | | - <table class="table table-striped"> |
787 | | - <tr> |
788 | | - <th>Property</th> |
789 | | - <th>Value</th> |
790 | | - </tr> |
791 | 795 | <% |
792 | | - Map<Bytes, Bytes> familyValues = family.getValues(); |
793 | | - for (Bytes familyKey: familyValues.keySet()) { |
| 796 | + for (Bytes familyKey: familyKeySet) { |
794 | 797 | %> |
795 | 798 | <tr> |
796 | 799 | <td> |
797 | 800 | <%= StringEscapeUtils.escapeHtml4(familyKey.toString()) %> |
798 | | - </td> |
| 801 | + </td> |
| 802 | + <% |
| 803 | + for (ColumnFamilyDescriptor family: families) { |
| 804 | + String familyValue = "-"; |
| 805 | + if(family.getValues().containsKey(familyKey)){ |
| 806 | + familyValue = family.getValues().get(familyKey).toString(); |
| 807 | + } |
| 808 | + %> |
799 | 809 | <td> |
800 | | - <%= StringEscapeUtils.escapeHtml4(familyValues.get(familyKey).toString()) %> |
| 810 | + <%= StringEscapeUtils.escapeHtml4(familyValue) %> |
801 | 811 | </td> |
| 812 | + <% } %> |
802 | 813 | </tr> |
803 | 814 | <% } %> |
804 | | - </table> |
805 | | - </td> |
806 | | - </tr> |
807 | | - <% } %> |
808 | 815 | </table> |
809 | 816 | <% |
810 | 817 | long totalReadReq = 0; |
|
0 commit comments