http://git-wip-us.apache.org/repos/asf/hbase-site/blob/854846a5/devapidocs/src-html/org/apache/hadoop/hbase/client/TableDescriptorBuilder.html
----------------------------------------------------------------------
diff --git 
a/devapidocs/src-html/org/apache/hadoop/hbase/client/TableDescriptorBuilder.html
 
b/devapidocs/src-html/org/apache/hadoop/hbase/client/TableDescriptorBuilder.html
index 644bb30..05c0542 100644
--- 
a/devapidocs/src-html/org/apache/hadoop/hbase/client/TableDescriptorBuilder.html
+++ 
b/devapidocs/src-html/org/apache/hadoop/hbase/client/TableDescriptorBuilder.html
@@ -1062,375 +1062,366 @@
 <span class="sourceLineNo">1054</span>    }<a name="line.1054"></a>
 <span class="sourceLineNo">1055</span><a name="line.1055"></a>
 <span class="sourceLineNo">1056</span>    /**<a name="line.1056"></a>
-<span class="sourceLineNo">1057</span>     * Return true if there are at least 
one cf whose replication scope is serial.<a name="line.1057"></a>
+<span class="sourceLineNo">1057</span>     * Returns the configured replicas 
per region<a name="line.1057"></a>
 <span class="sourceLineNo">1058</span>     */<a name="line.1058"></a>
 <span class="sourceLineNo">1059</span>    @Override<a name="line.1059"></a>
-<span class="sourceLineNo">1060</span>    public boolean 
hasSerialReplicationScope() {<a name="line.1060"></a>
-<span class="sourceLineNo">1061</span>      return 
families.values().stream()<a name="line.1061"></a>
-<span class="sourceLineNo">1062</span>        .anyMatch(column -&gt; 
column.getScope() == HConstants.REPLICATION_SCOPE_SERIAL);<a 
name="line.1062"></a>
-<span class="sourceLineNo">1063</span>    }<a name="line.1063"></a>
-<span class="sourceLineNo">1064</span><a name="line.1064"></a>
-<span class="sourceLineNo">1065</span>    /**<a name="line.1065"></a>
-<span class="sourceLineNo">1066</span>     * Returns the configured replicas 
per region<a name="line.1066"></a>
-<span class="sourceLineNo">1067</span>     */<a name="line.1067"></a>
-<span class="sourceLineNo">1068</span>    @Override<a name="line.1068"></a>
-<span class="sourceLineNo">1069</span>    public int getRegionReplication() 
{<a name="line.1069"></a>
-<span class="sourceLineNo">1070</span>      return 
getOrDefault(REGION_REPLICATION_KEY, Integer::valueOf, 
DEFAULT_REGION_REPLICATION);<a name="line.1070"></a>
-<span class="sourceLineNo">1071</span>    }<a name="line.1071"></a>
-<span class="sourceLineNo">1072</span><a name="line.1072"></a>
-<span class="sourceLineNo">1073</span>    /**<a name="line.1073"></a>
-<span class="sourceLineNo">1074</span>     * Sets the number of replicas per 
region.<a name="line.1074"></a>
-<span class="sourceLineNo">1075</span>     *<a name="line.1075"></a>
-<span class="sourceLineNo">1076</span>     * @param regionReplication the 
replication factor per region<a name="line.1076"></a>
-<span class="sourceLineNo">1077</span>     * @return the modifyable TD<a 
name="line.1077"></a>
-<span class="sourceLineNo">1078</span>     */<a name="line.1078"></a>
-<span class="sourceLineNo">1079</span>    public ModifyableTableDescriptor 
setRegionReplication(int regionReplication) {<a name="line.1079"></a>
-<span class="sourceLineNo">1080</span>      return 
setValue(REGION_REPLICATION_KEY, Integer.toString(regionReplication));<a 
name="line.1080"></a>
-<span class="sourceLineNo">1081</span>    }<a name="line.1081"></a>
-<span class="sourceLineNo">1082</span><a name="line.1082"></a>
-<span class="sourceLineNo">1083</span>    /**<a name="line.1083"></a>
-<span class="sourceLineNo">1084</span>     * @return true if the read-replicas 
memstore replication is enabled.<a name="line.1084"></a>
-<span class="sourceLineNo">1085</span>     */<a name="line.1085"></a>
-<span class="sourceLineNo">1086</span>    @Override<a name="line.1086"></a>
-<span class="sourceLineNo">1087</span>    public boolean 
hasRegionMemStoreReplication() {<a name="line.1087"></a>
-<span class="sourceLineNo">1088</span>      return 
getOrDefault(REGION_MEMSTORE_REPLICATION_KEY, Boolean::valueOf, 
DEFAULT_REGION_MEMSTORE_REPLICATION);<a name="line.1088"></a>
-<span class="sourceLineNo">1089</span>    }<a name="line.1089"></a>
-<span class="sourceLineNo">1090</span><a name="line.1090"></a>
-<span class="sourceLineNo">1091</span>    /**<a name="line.1091"></a>
-<span class="sourceLineNo">1092</span>     * Enable or Disable the memstore 
replication from the primary region to the<a name="line.1092"></a>
-<span class="sourceLineNo">1093</span>     * replicas. The replication will be 
used only for meta operations (e.g.<a name="line.1093"></a>
-<span class="sourceLineNo">1094</span>     * flush, compaction, ...)<a 
name="line.1094"></a>
-<span class="sourceLineNo">1095</span>     *<a name="line.1095"></a>
-<span class="sourceLineNo">1096</span>     * @param memstoreReplication true 
if the new data written to the primary<a name="line.1096"></a>
-<span class="sourceLineNo">1097</span>     * region should be replicated. 
false if the secondaries can tollerate to<a name="line.1097"></a>
-<span class="sourceLineNo">1098</span>     * have new data only when the 
primary flushes the memstore.<a name="line.1098"></a>
-<span class="sourceLineNo">1099</span>     * @return the modifyable TD<a 
name="line.1099"></a>
-<span class="sourceLineNo">1100</span>     */<a name="line.1100"></a>
-<span class="sourceLineNo">1101</span>    public ModifyableTableDescriptor 
setRegionMemStoreReplication(boolean memstoreReplication) {<a 
name="line.1101"></a>
-<span class="sourceLineNo">1102</span>      
setValue(REGION_MEMSTORE_REPLICATION_KEY, 
Boolean.toString(memstoreReplication));<a name="line.1102"></a>
-<span class="sourceLineNo">1103</span>      // If the memstore replication is 
setup, we do not have to wait for observing a flush event<a 
name="line.1103"></a>
-<span class="sourceLineNo">1104</span>      // from primary before starting to 
serve reads, because gaps from replication is not applicable<a 
name="line.1104"></a>
-<span class="sourceLineNo">1105</span>      return 
setValue(REGION_REPLICA_WAIT_FOR_PRIMARY_FLUSH_CONF_KEY,<a name="line.1105"></a>
-<span class="sourceLineNo">1106</span>              
Boolean.toString(memstoreReplication));<a name="line.1106"></a>
+<span class="sourceLineNo">1060</span>    public int getRegionReplication() 
{<a name="line.1060"></a>
+<span class="sourceLineNo">1061</span>      return 
getOrDefault(REGION_REPLICATION_KEY, Integer::valueOf, 
DEFAULT_REGION_REPLICATION);<a name="line.1061"></a>
+<span class="sourceLineNo">1062</span>    }<a name="line.1062"></a>
+<span class="sourceLineNo">1063</span><a name="line.1063"></a>
+<span class="sourceLineNo">1064</span>    /**<a name="line.1064"></a>
+<span class="sourceLineNo">1065</span>     * Sets the number of replicas per 
region.<a name="line.1065"></a>
+<span class="sourceLineNo">1066</span>     *<a name="line.1066"></a>
+<span class="sourceLineNo">1067</span>     * @param regionReplication the 
replication factor per region<a name="line.1067"></a>
+<span class="sourceLineNo">1068</span>     * @return the modifyable TD<a 
name="line.1068"></a>
+<span class="sourceLineNo">1069</span>     */<a name="line.1069"></a>
+<span class="sourceLineNo">1070</span>    public ModifyableTableDescriptor 
setRegionReplication(int regionReplication) {<a name="line.1070"></a>
+<span class="sourceLineNo">1071</span>      return 
setValue(REGION_REPLICATION_KEY, Integer.toString(regionReplication));<a 
name="line.1071"></a>
+<span class="sourceLineNo">1072</span>    }<a name="line.1072"></a>
+<span class="sourceLineNo">1073</span><a name="line.1073"></a>
+<span class="sourceLineNo">1074</span>    /**<a name="line.1074"></a>
+<span class="sourceLineNo">1075</span>     * @return true if the read-replicas 
memstore replication is enabled.<a name="line.1075"></a>
+<span class="sourceLineNo">1076</span>     */<a name="line.1076"></a>
+<span class="sourceLineNo">1077</span>    @Override<a name="line.1077"></a>
+<span class="sourceLineNo">1078</span>    public boolean 
hasRegionMemStoreReplication() {<a name="line.1078"></a>
+<span class="sourceLineNo">1079</span>      return 
getOrDefault(REGION_MEMSTORE_REPLICATION_KEY, Boolean::valueOf, 
DEFAULT_REGION_MEMSTORE_REPLICATION);<a name="line.1079"></a>
+<span class="sourceLineNo">1080</span>    }<a name="line.1080"></a>
+<span class="sourceLineNo">1081</span><a name="line.1081"></a>
+<span class="sourceLineNo">1082</span>    /**<a name="line.1082"></a>
+<span class="sourceLineNo">1083</span>     * Enable or Disable the memstore 
replication from the primary region to the<a name="line.1083"></a>
+<span class="sourceLineNo">1084</span>     * replicas. The replication will be 
used only for meta operations (e.g.<a name="line.1084"></a>
+<span class="sourceLineNo">1085</span>     * flush, compaction, ...)<a 
name="line.1085"></a>
+<span class="sourceLineNo">1086</span>     *<a name="line.1086"></a>
+<span class="sourceLineNo">1087</span>     * @param memstoreReplication true 
if the new data written to the primary<a name="line.1087"></a>
+<span class="sourceLineNo">1088</span>     * region should be replicated. 
false if the secondaries can tollerate to<a name="line.1088"></a>
+<span class="sourceLineNo">1089</span>     * have new data only when the 
primary flushes the memstore.<a name="line.1089"></a>
+<span class="sourceLineNo">1090</span>     * @return the modifyable TD<a 
name="line.1090"></a>
+<span class="sourceLineNo">1091</span>     */<a name="line.1091"></a>
+<span class="sourceLineNo">1092</span>    public ModifyableTableDescriptor 
setRegionMemStoreReplication(boolean memstoreReplication) {<a 
name="line.1092"></a>
+<span class="sourceLineNo">1093</span>      
setValue(REGION_MEMSTORE_REPLICATION_KEY, 
Boolean.toString(memstoreReplication));<a name="line.1093"></a>
+<span class="sourceLineNo">1094</span>      // If the memstore replication is 
setup, we do not have to wait for observing a flush event<a 
name="line.1094"></a>
+<span class="sourceLineNo">1095</span>      // from primary before starting to 
serve reads, because gaps from replication is not applicable<a 
name="line.1095"></a>
+<span class="sourceLineNo">1096</span>      return 
setValue(REGION_REPLICA_WAIT_FOR_PRIMARY_FLUSH_CONF_KEY,<a name="line.1096"></a>
+<span class="sourceLineNo">1097</span>              
Boolean.toString(memstoreReplication));<a name="line.1097"></a>
+<span class="sourceLineNo">1098</span>    }<a name="line.1098"></a>
+<span class="sourceLineNo">1099</span><a name="line.1099"></a>
+<span class="sourceLineNo">1100</span>    public ModifyableTableDescriptor 
setPriority(int priority) {<a name="line.1100"></a>
+<span class="sourceLineNo">1101</span>      return setValue(PRIORITY_KEY, 
Integer.toString(priority));<a name="line.1101"></a>
+<span class="sourceLineNo">1102</span>    }<a name="line.1102"></a>
+<span class="sourceLineNo">1103</span><a name="line.1103"></a>
+<span class="sourceLineNo">1104</span>    @Override<a name="line.1104"></a>
+<span class="sourceLineNo">1105</span>    public int getPriority() {<a 
name="line.1105"></a>
+<span class="sourceLineNo">1106</span>      return getOrDefault(PRIORITY_KEY, 
Integer::valueOf, DEFAULT_PRIORITY);<a name="line.1106"></a>
 <span class="sourceLineNo">1107</span>    }<a name="line.1107"></a>
 <span class="sourceLineNo">1108</span><a name="line.1108"></a>
-<span class="sourceLineNo">1109</span>    public ModifyableTableDescriptor 
setPriority(int priority) {<a name="line.1109"></a>
-<span class="sourceLineNo">1110</span>      return setValue(PRIORITY_KEY, 
Integer.toString(priority));<a name="line.1110"></a>
-<span class="sourceLineNo">1111</span>    }<a name="line.1111"></a>
-<span class="sourceLineNo">1112</span><a name="line.1112"></a>
-<span class="sourceLineNo">1113</span>    @Override<a name="line.1113"></a>
-<span class="sourceLineNo">1114</span>    public int getPriority() {<a 
name="line.1114"></a>
-<span class="sourceLineNo">1115</span>      return getOrDefault(PRIORITY_KEY, 
Integer::valueOf, DEFAULT_PRIORITY);<a name="line.1115"></a>
-<span class="sourceLineNo">1116</span>    }<a name="line.1116"></a>
-<span class="sourceLineNo">1117</span><a name="line.1117"></a>
-<span class="sourceLineNo">1118</span>    /**<a name="line.1118"></a>
-<span class="sourceLineNo">1119</span>     * Returns all the column family 
names of the current table. The map of<a name="line.1119"></a>
-<span class="sourceLineNo">1120</span>     * TableDescriptor contains mapping 
of family name to ColumnFamilyDescriptor.<a name="line.1120"></a>
-<span class="sourceLineNo">1121</span>     * This returns all the keys of the 
family map which represents the column<a name="line.1121"></a>
-<span class="sourceLineNo">1122</span>     * family names of the table.<a 
name="line.1122"></a>
-<span class="sourceLineNo">1123</span>     *<a name="line.1123"></a>
-<span class="sourceLineNo">1124</span>     * @return Immutable sorted set of 
the keys of the families.<a name="line.1124"></a>
-<span class="sourceLineNo">1125</span>     */<a name="line.1125"></a>
-<span class="sourceLineNo">1126</span>    @Override<a name="line.1126"></a>
-<span class="sourceLineNo">1127</span>    public Set&lt;byte[]&gt; 
getColumnFamilyNames() {<a name="line.1127"></a>
-<span class="sourceLineNo">1128</span>      return 
Collections.unmodifiableSet(this.families.keySet());<a name="line.1128"></a>
-<span class="sourceLineNo">1129</span>    }<a name="line.1129"></a>
-<span class="sourceLineNo">1130</span><a name="line.1130"></a>
-<span class="sourceLineNo">1131</span>    /**<a name="line.1131"></a>
-<span class="sourceLineNo">1132</span>     * Returns the 
ColumnFamilyDescriptor for a specific column family with name as<a 
name="line.1132"></a>
-<span class="sourceLineNo">1133</span>     * specified by the parameter 
column.<a name="line.1133"></a>
-<span class="sourceLineNo">1134</span>     *<a name="line.1134"></a>
-<span class="sourceLineNo">1135</span>     * @param column Column family 
name<a name="line.1135"></a>
-<span class="sourceLineNo">1136</span>     * @return Column descriptor for the 
passed family name or the family on<a name="line.1136"></a>
-<span class="sourceLineNo">1137</span>     * passed in column.<a 
name="line.1137"></a>
-<span class="sourceLineNo">1138</span>     */<a name="line.1138"></a>
-<span class="sourceLineNo">1139</span>    @Override<a name="line.1139"></a>
-<span class="sourceLineNo">1140</span>    public ColumnFamilyDescriptor 
getColumnFamily(final byte[] column) {<a name="line.1140"></a>
-<span class="sourceLineNo">1141</span>      return 
this.families.get(column);<a name="line.1141"></a>
-<span class="sourceLineNo">1142</span>    }<a name="line.1142"></a>
-<span class="sourceLineNo">1143</span><a name="line.1143"></a>
-<span class="sourceLineNo">1144</span>    /**<a name="line.1144"></a>
-<span class="sourceLineNo">1145</span>     * Removes the 
ColumnFamilyDescriptor with name specified by the parameter column<a 
name="line.1145"></a>
-<span class="sourceLineNo">1146</span>     * from the table descriptor<a 
name="line.1146"></a>
-<span class="sourceLineNo">1147</span>     *<a name="line.1147"></a>
-<span class="sourceLineNo">1148</span>     * @param column Name of the column 
family to be removed.<a name="line.1148"></a>
-<span class="sourceLineNo">1149</span>     * @return Column descriptor for the 
passed family name or the family on<a name="line.1149"></a>
-<span class="sourceLineNo">1150</span>     * passed in column.<a 
name="line.1150"></a>
-<span class="sourceLineNo">1151</span>     */<a name="line.1151"></a>
-<span class="sourceLineNo">1152</span>    public ColumnFamilyDescriptor 
removeColumnFamily(final byte[] column) {<a name="line.1152"></a>
-<span class="sourceLineNo">1153</span>      return 
this.families.remove(column);<a name="line.1153"></a>
-<span class="sourceLineNo">1154</span>    }<a name="line.1154"></a>
-<span class="sourceLineNo">1155</span><a name="line.1155"></a>
-<span class="sourceLineNo">1156</span>    /**<a name="line.1156"></a>
-<span class="sourceLineNo">1157</span>     * Add a table coprocessor to this 
table. The coprocessor type must be<a name="line.1157"></a>
-<span class="sourceLineNo">1158</span>     * 
org.apache.hadoop.hbase.coprocessor.RegionObserver or Endpoint. It won't<a 
name="line.1158"></a>
-<span class="sourceLineNo">1159</span>     * check if the class can be loaded 
or not. Whether a coprocessor is<a name="line.1159"></a>
-<span class="sourceLineNo">1160</span>     * loadable or not will be 
determined when a region is opened.<a name="line.1160"></a>
-<span class="sourceLineNo">1161</span>     *<a name="line.1161"></a>
-<span class="sourceLineNo">1162</span>     * @param className Full class 
name.<a name="line.1162"></a>
-<span class="sourceLineNo">1163</span>     * @throws IOException<a 
name="line.1163"></a>
-<span class="sourceLineNo">1164</span>     * @return the modifyable TD<a 
name="line.1164"></a>
-<span class="sourceLineNo">1165</span>     */<a name="line.1165"></a>
-<span class="sourceLineNo">1166</span>    public ModifyableTableDescriptor 
addCoprocessor(String className) throws IOException {<a name="line.1166"></a>
-<span class="sourceLineNo">1167</span>      return addCoprocessor(className, 
null, Coprocessor.PRIORITY_USER, null);<a name="line.1167"></a>
-<span class="sourceLineNo">1168</span>    }<a name="line.1168"></a>
-<span class="sourceLineNo">1169</span><a name="line.1169"></a>
-<span class="sourceLineNo">1170</span>    /**<a name="line.1170"></a>
-<span class="sourceLineNo">1171</span>     * Add a table coprocessor to this 
table. The coprocessor type must be<a name="line.1171"></a>
-<span class="sourceLineNo">1172</span>     * 
org.apache.hadoop.hbase.coprocessor.RegionObserver or Endpoint. It won't<a 
name="line.1172"></a>
-<span class="sourceLineNo">1173</span>     * check if the class can be loaded 
or not. Whether a coprocessor is<a name="line.1173"></a>
-<span class="sourceLineNo">1174</span>     * loadable or not will be 
determined when a region is opened.<a name="line.1174"></a>
-<span class="sourceLineNo">1175</span>     *<a name="line.1175"></a>
-<span class="sourceLineNo">1176</span>     * @param jarFilePath Path of the 
jar file. If it's null, the class will be<a name="line.1176"></a>
-<span class="sourceLineNo">1177</span>     * loaded from default 
classloader.<a name="line.1177"></a>
-<span class="sourceLineNo">1178</span>     * @param className Full class 
name.<a name="line.1178"></a>
-<span class="sourceLineNo">1179</span>     * @param priority Priority<a 
name="line.1179"></a>
-<span class="sourceLineNo">1180</span>     * @param kvs Arbitrary key-value 
parameter pairs passed into the<a name="line.1180"></a>
-<span class="sourceLineNo">1181</span>     * coprocessor.<a 
name="line.1181"></a>
-<span class="sourceLineNo">1182</span>     * @throws IOException<a 
name="line.1182"></a>
-<span class="sourceLineNo">1183</span>     * @return the modifyable TD<a 
name="line.1183"></a>
-<span class="sourceLineNo">1184</span>     */<a name="line.1184"></a>
-<span class="sourceLineNo">1185</span>    public ModifyableTableDescriptor 
addCoprocessor(String className, Path jarFilePath,<a name="line.1185"></a>
-<span class="sourceLineNo">1186</span>            int priority, final 
Map&lt;String, String&gt; kvs)<a name="line.1186"></a>
-<span class="sourceLineNo">1187</span>            throws IOException {<a 
name="line.1187"></a>
-<span class="sourceLineNo">1188</span>      checkHasCoprocessor(className);<a 
name="line.1188"></a>
-<span class="sourceLineNo">1189</span><a name="line.1189"></a>
-<span class="sourceLineNo">1190</span>      // Validate parameter kvs and then 
add key/values to kvString.<a name="line.1190"></a>
-<span class="sourceLineNo">1191</span>      StringBuilder kvString = new 
StringBuilder();<a name="line.1191"></a>
-<span class="sourceLineNo">1192</span>      if (kvs != null) {<a 
name="line.1192"></a>
-<span class="sourceLineNo">1193</span>        for (Map.Entry&lt;String, 
String&gt; e : kvs.entrySet()) {<a name="line.1193"></a>
-<span class="sourceLineNo">1194</span>          if 
(!e.getKey().matches(HConstants.CP_HTD_ATTR_VALUE_PARAM_KEY_PATTERN)) {<a 
name="line.1194"></a>
-<span class="sourceLineNo">1195</span>            throw new 
IOException("Illegal parameter key = " + e.getKey());<a name="line.1195"></a>
-<span class="sourceLineNo">1196</span>          }<a name="line.1196"></a>
-<span class="sourceLineNo">1197</span>          if 
(!e.getValue().matches(HConstants.CP_HTD_ATTR_VALUE_PARAM_VALUE_PATTERN)) {<a 
name="line.1197"></a>
-<span class="sourceLineNo">1198</span>            throw new 
IOException("Illegal parameter (" + e.getKey()<a name="line.1198"></a>
-<span class="sourceLineNo">1199</span>                    + ") value = " + 
e.getValue());<a name="line.1199"></a>
-<span class="sourceLineNo">1200</span>          }<a name="line.1200"></a>
-<span class="sourceLineNo">1201</span>          if (kvString.length() != 0) 
{<a name="line.1201"></a>
-<span class="sourceLineNo">1202</span>            kvString.append(',');<a 
name="line.1202"></a>
-<span class="sourceLineNo">1203</span>          }<a name="line.1203"></a>
-<span class="sourceLineNo">1204</span>          kvString.append(e.getKey());<a 
name="line.1204"></a>
-<span class="sourceLineNo">1205</span>          kvString.append('=');<a 
name="line.1205"></a>
-<span class="sourceLineNo">1206</span>          
kvString.append(e.getValue());<a name="line.1206"></a>
-<span class="sourceLineNo">1207</span>        }<a name="line.1207"></a>
-<span class="sourceLineNo">1208</span>      }<a name="line.1208"></a>
-<span class="sourceLineNo">1209</span><a name="line.1209"></a>
-<span class="sourceLineNo">1210</span>      String value = ((jarFilePath == 
null) ? "" : jarFilePath.toString())<a name="line.1210"></a>
-<span class="sourceLineNo">1211</span>              + "|" + className + "|" + 
Integer.toString(priority) + "|"<a name="line.1211"></a>
-<span class="sourceLineNo">1212</span>              + kvString.toString();<a 
name="line.1212"></a>
-<span class="sourceLineNo">1213</span>      return 
addCoprocessorToMap(value);<a name="line.1213"></a>
-<span class="sourceLineNo">1214</span>    }<a name="line.1214"></a>
-<span class="sourceLineNo">1215</span><a name="line.1215"></a>
-<span class="sourceLineNo">1216</span>    /**<a name="line.1216"></a>
-<span class="sourceLineNo">1217</span>     * Add a table coprocessor to this 
table. The coprocessor type must be<a name="line.1217"></a>
-<span class="sourceLineNo">1218</span>     * 
org.apache.hadoop.hbase.coprocessor.RegionObserver or Endpoint. It won't<a 
name="line.1218"></a>
-<span class="sourceLineNo">1219</span>     * check if the class can be loaded 
or not. Whether a coprocessor is<a name="line.1219"></a>
-<span class="sourceLineNo">1220</span>     * loadable or not will be 
determined when a region is opened.<a name="line.1220"></a>
-<span class="sourceLineNo">1221</span>     *<a name="line.1221"></a>
-<span class="sourceLineNo">1222</span>     * @param specStr The Coprocessor 
specification all in in one String<a name="line.1222"></a>
-<span class="sourceLineNo">1223</span>     * formatted so matches {@link 
HConstants#CP_HTD_ATTR_VALUE_PATTERN}<a name="line.1223"></a>
-<span class="sourceLineNo">1224</span>     * @throws IOException<a 
name="line.1224"></a>
-<span class="sourceLineNo">1225</span>     * @return the modifyable TD<a 
name="line.1225"></a>
-<span class="sourceLineNo">1226</span>     */<a name="line.1226"></a>
-<span class="sourceLineNo">1227</span>    public ModifyableTableDescriptor 
addCoprocessorWithSpec(final String specStr) throws IOException {<a 
name="line.1227"></a>
-<span class="sourceLineNo">1228</span>      String className = 
getCoprocessorClassNameFromSpecStr(specStr);<a name="line.1228"></a>
-<span class="sourceLineNo">1229</span>      if (className == null) {<a 
name="line.1229"></a>
-<span class="sourceLineNo">1230</span>        throw new 
IllegalArgumentException("Format does not match "<a name="line.1230"></a>
-<span class="sourceLineNo">1231</span>                + 
HConstants.CP_HTD_ATTR_VALUE_PATTERN + ": " + specStr);<a name="line.1231"></a>
-<span class="sourceLineNo">1232</span>      }<a name="line.1232"></a>
-<span class="sourceLineNo">1233</span>      checkHasCoprocessor(className);<a 
name="line.1233"></a>
-<span class="sourceLineNo">1234</span>      return 
addCoprocessorToMap(specStr);<a name="line.1234"></a>
-<span class="sourceLineNo">1235</span>    }<a name="line.1235"></a>
-<span class="sourceLineNo">1236</span><a name="line.1236"></a>
-<span class="sourceLineNo">1237</span>    private void 
checkHasCoprocessor(final String className) throws IOException {<a 
name="line.1237"></a>
-<span class="sourceLineNo">1238</span>      if (hasCoprocessor(className)) {<a 
name="line.1238"></a>
-<span class="sourceLineNo">1239</span>        throw new 
IOException("Coprocessor " + className + " already exists.");<a 
name="line.1239"></a>
-<span class="sourceLineNo">1240</span>      }<a name="line.1240"></a>
-<span class="sourceLineNo">1241</span>    }<a name="line.1241"></a>
-<span class="sourceLineNo">1242</span><a name="line.1242"></a>
-<span class="sourceLineNo">1243</span>    /**<a name="line.1243"></a>
-<span class="sourceLineNo">1244</span>     * Add coprocessor to values Map<a 
name="line.1244"></a>
-<span class="sourceLineNo">1245</span>     *<a name="line.1245"></a>
-<span class="sourceLineNo">1246</span>     * @param specStr The Coprocessor 
specification all in in one String<a name="line.1246"></a>
-<span class="sourceLineNo">1247</span>     * formatted so matches {@link 
HConstants#CP_HTD_ATTR_VALUE_PATTERN}<a name="line.1247"></a>
-<span class="sourceLineNo">1248</span>     * @return Returns 
&lt;code&gt;this&lt;/code&gt;<a name="line.1248"></a>
-<span class="sourceLineNo">1249</span>     */<a name="line.1249"></a>
-<span class="sourceLineNo">1250</span>    private ModifyableTableDescriptor 
addCoprocessorToMap(final String specStr) {<a name="line.1250"></a>
-<span class="sourceLineNo">1251</span>      if (specStr == null) {<a 
name="line.1251"></a>
-<span class="sourceLineNo">1252</span>        return this;<a 
name="line.1252"></a>
-<span class="sourceLineNo">1253</span>      }<a name="line.1253"></a>
-<span class="sourceLineNo">1254</span>      // generate a coprocessor key<a 
name="line.1254"></a>
-<span class="sourceLineNo">1255</span>      int maxCoprocessorNumber = 0;<a 
name="line.1255"></a>
-<span class="sourceLineNo">1256</span>      Matcher keyMatcher;<a 
name="line.1256"></a>
-<span class="sourceLineNo">1257</span>      for (Map.Entry&lt;Bytes, Bytes&gt; 
e : this.values.entrySet()) {<a name="line.1257"></a>
-<span class="sourceLineNo">1258</span>        keyMatcher = 
HConstants.CP_HTD_ATTR_KEY_PATTERN.matcher(Bytes.toString(e.getKey().get()));<a 
name="line.1258"></a>
-<span class="sourceLineNo">1259</span>        if (!keyMatcher.matches()) {<a 
name="line.1259"></a>
-<span class="sourceLineNo">1260</span>          continue;<a 
name="line.1260"></a>
-<span class="sourceLineNo">1261</span>        }<a name="line.1261"></a>
-<span class="sourceLineNo">1262</span>        maxCoprocessorNumber = 
Math.max(Integer.parseInt(keyMatcher.group(1)), maxCoprocessorNumber);<a 
name="line.1262"></a>
-<span class="sourceLineNo">1263</span>      }<a name="line.1263"></a>
-<span class="sourceLineNo">1264</span>      maxCoprocessorNumber++;<a 
name="line.1264"></a>
-<span class="sourceLineNo">1265</span>      String key = "coprocessor$" + 
Integer.toString(maxCoprocessorNumber);<a name="line.1265"></a>
-<span class="sourceLineNo">1266</span>      return setValue(new 
Bytes(Bytes.toBytes(key)), new Bytes(Bytes.toBytes(specStr)));<a 
name="line.1266"></a>
-<span class="sourceLineNo">1267</span>    }<a name="line.1267"></a>
-<span class="sourceLineNo">1268</span><a name="line.1268"></a>
-<span class="sourceLineNo">1269</span>    /**<a name="line.1269"></a>
-<span class="sourceLineNo">1270</span>     * Check if the table has an 
attached co-processor represented by the name<a name="line.1270"></a>
-<span class="sourceLineNo">1271</span>     * className<a name="line.1271"></a>
-<span class="sourceLineNo">1272</span>     *<a name="line.1272"></a>
-<span class="sourceLineNo">1273</span>     * @param classNameToMatch - Class 
name of the co-processor<a name="line.1273"></a>
-<span class="sourceLineNo">1274</span>     * @return true of the table has a 
co-processor className<a name="line.1274"></a>
-<span class="sourceLineNo">1275</span>     */<a name="line.1275"></a>
-<span class="sourceLineNo">1276</span>    @Override<a name="line.1276"></a>
-<span class="sourceLineNo">1277</span>    public boolean hasCoprocessor(String 
classNameToMatch) {<a name="line.1277"></a>
-<span class="sourceLineNo">1278</span>      Matcher keyMatcher;<a 
name="line.1278"></a>
-<span class="sourceLineNo">1279</span>      for (Map.Entry&lt;Bytes, Bytes&gt; 
e<a name="line.1279"></a>
-<span class="sourceLineNo">1280</span>              : this.values.entrySet()) 
{<a name="line.1280"></a>
-<span class="sourceLineNo">1281</span>        keyMatcher<a 
name="line.1281"></a>
-<span class="sourceLineNo">1282</span>                = 
HConstants.CP_HTD_ATTR_KEY_PATTERN.matcher(<a name="line.1282"></a>
-<span class="sourceLineNo">1283</span>                        
Bytes.toString(e.getKey().get()));<a name="line.1283"></a>
-<span class="sourceLineNo">1284</span>        if (!keyMatcher.matches()) {<a 
name="line.1284"></a>
-<span class="sourceLineNo">1285</span>          continue;<a 
name="line.1285"></a>
-<span class="sourceLineNo">1286</span>        }<a name="line.1286"></a>
-<span class="sourceLineNo">1287</span>        String className = 
getCoprocessorClassNameFromSpecStr(Bytes.toString(e.getValue().get()));<a 
name="line.1287"></a>
-<span class="sourceLineNo">1288</span>        if (className == null) {<a 
name="line.1288"></a>
-<span class="sourceLineNo">1289</span>          continue;<a 
name="line.1289"></a>
-<span class="sourceLineNo">1290</span>        }<a name="line.1290"></a>
-<span class="sourceLineNo">1291</span>        if 
(className.equals(classNameToMatch.trim())) {<a name="line.1291"></a>
-<span class="sourceLineNo">1292</span>          return true;<a 
name="line.1292"></a>
-<span class="sourceLineNo">1293</span>        }<a name="line.1293"></a>
-<span class="sourceLineNo">1294</span>      }<a name="line.1294"></a>
-<span class="sourceLineNo">1295</span>      return false;<a 
name="line.1295"></a>
-<span class="sourceLineNo">1296</span>    }<a name="line.1296"></a>
-<span class="sourceLineNo">1297</span><a name="line.1297"></a>
-<span class="sourceLineNo">1298</span>    /**<a name="line.1298"></a>
-<span class="sourceLineNo">1299</span>     * Return the list of attached 
co-processor represented by their name<a name="line.1299"></a>
-<span class="sourceLineNo">1300</span>     * className<a name="line.1300"></a>
-<span class="sourceLineNo">1301</span>     *<a name="line.1301"></a>
-<span class="sourceLineNo">1302</span>     * @return The list of co-processors 
classNames<a name="line.1302"></a>
-<span class="sourceLineNo">1303</span>     */<a name="line.1303"></a>
-<span class="sourceLineNo">1304</span>    @Override<a name="line.1304"></a>
-<span class="sourceLineNo">1305</span>    public List&lt;String&gt; 
getCoprocessors() {<a name="line.1305"></a>
-<span class="sourceLineNo">1306</span>      List&lt;String&gt; result = new 
ArrayList&lt;&gt;(this.values.entrySet().size());<a name="line.1306"></a>
-<span class="sourceLineNo">1307</span>      Matcher keyMatcher;<a 
name="line.1307"></a>
-<span class="sourceLineNo">1308</span>      for (Map.Entry&lt;Bytes, Bytes&gt; 
e : this.values.entrySet()) {<a name="line.1308"></a>
-<span class="sourceLineNo">1309</span>        keyMatcher = 
HConstants.CP_HTD_ATTR_KEY_PATTERN.matcher(Bytes.toString(e.getKey().get()));<a 
name="line.1309"></a>
-<span class="sourceLineNo">1310</span>        if (!keyMatcher.matches()) {<a 
name="line.1310"></a>
-<span class="sourceLineNo">1311</span>          continue;<a 
name="line.1311"></a>
-<span class="sourceLineNo">1312</span>        }<a name="line.1312"></a>
-<span class="sourceLineNo">1313</span>        String className = 
getCoprocessorClassNameFromSpecStr(Bytes.toString(e.getValue().get()));<a 
name="line.1313"></a>
-<span class="sourceLineNo">1314</span>        if (className == null) {<a 
name="line.1314"></a>
-<span class="sourceLineNo">1315</span>          continue;<a 
name="line.1315"></a>
-<span class="sourceLineNo">1316</span>        }<a name="line.1316"></a>
-<span class="sourceLineNo">1317</span>        result.add(className); // 
classname is the 2nd field<a name="line.1317"></a>
-<span class="sourceLineNo">1318</span>      }<a name="line.1318"></a>
-<span class="sourceLineNo">1319</span>      return result;<a 
name="line.1319"></a>
-<span class="sourceLineNo">1320</span>    }<a name="line.1320"></a>
-<span class="sourceLineNo">1321</span><a name="line.1321"></a>
-<span class="sourceLineNo">1322</span>    /**<a name="line.1322"></a>
-<span class="sourceLineNo">1323</span>     * @param spec String formatted as 
per<a name="line.1323"></a>
-<span class="sourceLineNo">1324</span>     * {@link 
HConstants#CP_HTD_ATTR_VALUE_PATTERN}<a name="line.1324"></a>
-<span class="sourceLineNo">1325</span>     * @return Class parsed from passed 
in &lt;code&gt;spec&lt;/code&gt; or null if no match<a name="line.1325"></a>
-<span class="sourceLineNo">1326</span>     * or classpath found<a 
name="line.1326"></a>
-<span class="sourceLineNo">1327</span>     */<a name="line.1327"></a>
-<span class="sourceLineNo">1328</span>    private static String 
getCoprocessorClassNameFromSpecStr(final String spec) {<a name="line.1328"></a>
-<span class="sourceLineNo">1329</span>      Matcher matcher = 
HConstants.CP_HTD_ATTR_VALUE_PATTERN.matcher(spec);<a name="line.1329"></a>
-<span class="sourceLineNo">1330</span>      // Classname is the 2nd field<a 
name="line.1330"></a>
-<span class="sourceLineNo">1331</span>      return matcher != null &amp;&amp; 
matcher.matches() ? matcher.group(2).trim() : null;<a name="line.1331"></a>
-<span class="sourceLineNo">1332</span>    }<a name="line.1332"></a>
-<span class="sourceLineNo">1333</span><a name="line.1333"></a>
-<span class="sourceLineNo">1334</span>    /**<a name="line.1334"></a>
-<span class="sourceLineNo">1335</span>     * Remove a coprocessor from those 
set on the table<a name="line.1335"></a>
-<span class="sourceLineNo">1336</span>     *<a name="line.1336"></a>
-<span class="sourceLineNo">1337</span>     * @param className Class name of 
the co-processor<a name="line.1337"></a>
-<span class="sourceLineNo">1338</span>     */<a name="line.1338"></a>
-<span class="sourceLineNo">1339</span>    public void removeCoprocessor(String 
className) {<a name="line.1339"></a>
-<span class="sourceLineNo">1340</span>      Bytes match = null;<a 
name="line.1340"></a>
-<span class="sourceLineNo">1341</span>      Matcher keyMatcher;<a 
name="line.1341"></a>
-<span class="sourceLineNo">1342</span>      Matcher valueMatcher;<a 
name="line.1342"></a>
-<span class="sourceLineNo">1343</span>      for (Map.Entry&lt;Bytes, Bytes&gt; 
e : this.values<a name="line.1343"></a>
-<span class="sourceLineNo">1344</span>              .entrySet()) {<a 
name="line.1344"></a>
-<span class="sourceLineNo">1345</span>        keyMatcher = 
HConstants.CP_HTD_ATTR_KEY_PATTERN.matcher(Bytes.toString(e<a 
name="line.1345"></a>
-<span class="sourceLineNo">1346</span>                .getKey().get()));<a 
name="line.1346"></a>
-<span class="sourceLineNo">1347</span>        if (!keyMatcher.matches()) {<a 
name="line.1347"></a>
-<span class="sourceLineNo">1348</span>          continue;<a 
name="line.1348"></a>
-<span class="sourceLineNo">1349</span>        }<a name="line.1349"></a>
-<span class="sourceLineNo">1350</span>        valueMatcher = 
HConstants.CP_HTD_ATTR_VALUE_PATTERN.matcher(Bytes<a name="line.1350"></a>
-<span class="sourceLineNo">1351</span>                
.toString(e.getValue().get()));<a name="line.1351"></a>
-<span class="sourceLineNo">1352</span>        if (!valueMatcher.matches()) {<a 
name="line.1352"></a>
-<span class="sourceLineNo">1353</span>          continue;<a 
name="line.1353"></a>
-<span class="sourceLineNo">1354</span>        }<a name="line.1354"></a>
-<span class="sourceLineNo">1355</span>        // get className and compare<a 
name="line.1355"></a>
-<span class="sourceLineNo">1356</span>        String clazz = 
valueMatcher.group(2).trim(); // classname is the 2nd field<a 
name="line.1356"></a>
-<span class="sourceLineNo">1357</span>        // remove the CP if it is 
present<a name="line.1357"></a>
-<span class="sourceLineNo">1358</span>        if 
(clazz.equals(className.trim())) {<a name="line.1358"></a>
-<span class="sourceLineNo">1359</span>          match = e.getKey();<a 
name="line.1359"></a>
-<span class="sourceLineNo">1360</span>          break;<a name="line.1360"></a>
-<span class="sourceLineNo">1361</span>        }<a name="line.1361"></a>
-<span class="sourceLineNo">1362</span>      }<a name="line.1362"></a>
-<span class="sourceLineNo">1363</span>      // if we found a match, remove 
it<a name="line.1363"></a>
-<span class="sourceLineNo">1364</span>      if (match != null) {<a 
name="line.1364"></a>
-<span class="sourceLineNo">1365</span>        
ModifyableTableDescriptor.this.removeValue(match);<a name="line.1365"></a>
-<span class="sourceLineNo">1366</span>      }<a name="line.1366"></a>
-<span class="sourceLineNo">1367</span>    }<a name="line.1367"></a>
-<span class="sourceLineNo">1368</span><a name="line.1368"></a>
-<span class="sourceLineNo">1369</span>    @Deprecated<a name="line.1369"></a>
-<span class="sourceLineNo">1370</span>    public ModifyableTableDescriptor 
setOwner(User owner) {<a name="line.1370"></a>
-<span class="sourceLineNo">1371</span>      return setOwnerString(owner != 
null ? owner.getShortName() : null);<a name="line.1371"></a>
-<span class="sourceLineNo">1372</span>    }<a name="line.1372"></a>
-<span class="sourceLineNo">1373</span><a name="line.1373"></a>
-<span class="sourceLineNo">1374</span>    // used by 
admin.rb:alter(table_name,*args) to update owner.<a name="line.1374"></a>
-<span class="sourceLineNo">1375</span>    @Deprecated<a name="line.1375"></a>
-<span class="sourceLineNo">1376</span>    public ModifyableTableDescriptor 
setOwnerString(String ownerString) {<a name="line.1376"></a>
-<span class="sourceLineNo">1377</span>      return setValue(OWNER_KEY, 
ownerString);<a name="line.1377"></a>
+<span class="sourceLineNo">1109</span>    /**<a name="line.1109"></a>
+<span class="sourceLineNo">1110</span>     * Returns all the column family 
names of the current table. The map of<a name="line.1110"></a>
+<span class="sourceLineNo">1111</span>     * TableDescriptor contains mapping 
of family name to ColumnFamilyDescriptor.<a name="line.1111"></a>
+<span class="sourceLineNo">1112</span>     * This returns all the keys of the 
family map which represents the column<a name="line.1112"></a>
+<span class="sourceLineNo">1113</span>     * family names of the table.<a 
name="line.1113"></a>
+<span class="sourceLineNo">1114</span>     *<a name="line.1114"></a>
+<span class="sourceLineNo">1115</span>     * @return Immutable sorted set of 
the keys of the families.<a name="line.1115"></a>
+<span class="sourceLineNo">1116</span>     */<a name="line.1116"></a>
+<span class="sourceLineNo">1117</span>    @Override<a name="line.1117"></a>
+<span class="sourceLineNo">1118</span>    public Set&lt;byte[]&gt; 
getColumnFamilyNames() {<a name="line.1118"></a>
+<span class="sourceLineNo">1119</span>      return 
Collections.unmodifiableSet(this.families.keySet());<a name="line.1119"></a>
+<span class="sourceLineNo">1120</span>    }<a name="line.1120"></a>
+<span class="sourceLineNo">1121</span><a name="line.1121"></a>
+<span class="sourceLineNo">1122</span>    /**<a name="line.1122"></a>
+<span class="sourceLineNo">1123</span>     * Returns the 
ColumnFamilyDescriptor for a specific column family with name as<a 
name="line.1123"></a>
+<span class="sourceLineNo">1124</span>     * specified by the parameter 
column.<a name="line.1124"></a>
+<span class="sourceLineNo">1125</span>     *<a name="line.1125"></a>
+<span class="sourceLineNo">1126</span>     * @param column Column family 
name<a name="line.1126"></a>
+<span class="sourceLineNo">1127</span>     * @return Column descriptor for the 
passed family name or the family on<a name="line.1127"></a>
+<span class="sourceLineNo">1128</span>     * passed in column.<a 
name="line.1128"></a>
+<span class="sourceLineNo">1129</span>     */<a name="line.1129"></a>
+<span class="sourceLineNo">1130</span>    @Override<a name="line.1130"></a>
+<span class="sourceLineNo">1131</span>    public ColumnFamilyDescriptor 
getColumnFamily(final byte[] column) {<a name="line.1131"></a>
+<span class="sourceLineNo">1132</span>      return 
this.families.get(column);<a name="line.1132"></a>
+<span class="sourceLineNo">1133</span>    }<a name="line.1133"></a>
+<span class="sourceLineNo">1134</span><a name="line.1134"></a>
+<span class="sourceLineNo">1135</span>    /**<a name="line.1135"></a>
+<span class="sourceLineNo">1136</span>     * Removes the 
ColumnFamilyDescriptor with name specified by the parameter column<a 
name="line.1136"></a>
+<span class="sourceLineNo">1137</span>     * from the table descriptor<a 
name="line.1137"></a>
+<span class="sourceLineNo">1138</span>     *<a name="line.1138"></a>
+<span class="sourceLineNo">1139</span>     * @param column Name of the column 
family to be removed.<a name="line.1139"></a>
+<span class="sourceLineNo">1140</span>     * @return Column descriptor for the 
passed family name or the family on<a name="line.1140"></a>
+<span class="sourceLineNo">1141</span>     * passed in column.<a 
name="line.1141"></a>
+<span class="sourceLineNo">1142</span>     */<a name="line.1142"></a>
+<span class="sourceLineNo">1143</span>    public ColumnFamilyDescriptor 
removeColumnFamily(final byte[] column) {<a name="line.1143"></a>
+<span class="sourceLineNo">1144</span>      return 
this.families.remove(column);<a name="line.1144"></a>
+<span class="sourceLineNo">1145</span>    }<a name="line.1145"></a>
+<span class="sourceLineNo">1146</span><a name="line.1146"></a>
+<span class="sourceLineNo">1147</span>    /**<a name="line.1147"></a>
+<span class="sourceLineNo">1148</span>     * Add a table coprocessor to this 
table. The coprocessor type must be<a name="line.1148"></a>
+<span class="sourceLineNo">1149</span>     * 
org.apache.hadoop.hbase.coprocessor.RegionObserver or Endpoint. It won't<a 
name="line.1149"></a>
+<span class="sourceLineNo">1150</span>     * check if the class can be loaded 
or not. Whether a coprocessor is<a name="line.1150"></a>
+<span class="sourceLineNo">1151</span>     * loadable or not will be 
determined when a region is opened.<a name="line.1151"></a>
+<span class="sourceLineNo">1152</span>     *<a name="line.1152"></a>
+<span class="sourceLineNo">1153</span>     * @param className Full class 
name.<a name="line.1153"></a>
+<span class="sourceLineNo">1154</span>     * @throws IOException<a 
name="line.1154"></a>
+<span class="sourceLineNo">1155</span>     * @return the modifyable TD<a 
name="line.1155"></a>
+<span class="sourceLineNo">1156</span>     */<a name="line.1156"></a>
+<span class="sourceLineNo">1157</span>    public ModifyableTableDescriptor 
addCoprocessor(String className) throws IOException {<a name="line.1157"></a>
+<span class="sourceLineNo">1158</span>      return addCoprocessor(className, 
null, Coprocessor.PRIORITY_USER, null);<a name="line.1158"></a>
+<span class="sourceLineNo">1159</span>    }<a name="line.1159"></a>
+<span class="sourceLineNo">1160</span><a name="line.1160"></a>
+<span class="sourceLineNo">1161</span>    /**<a name="line.1161"></a>
+<span class="sourceLineNo">1162</span>     * Add a table coprocessor to this 
table. The coprocessor type must be<a name="line.1162"></a>
+<span class="sourceLineNo">1163</span>     * 
org.apache.hadoop.hbase.coprocessor.RegionObserver or Endpoint. It won't<a 
name="line.1163"></a>
+<span class="sourceLineNo">1164</span>     * check if the class can be loaded 
or not. Whether a coprocessor is<a name="line.1164"></a>
+<span class="sourceLineNo">1165</span>     * loadable or not will be 
determined when a region is opened.<a name="line.1165"></a>
+<span class="sourceLineNo">1166</span>     *<a name="line.1166"></a>
+<span class="sourceLineNo">1167</span>     * @param jarFilePath Path of the 
jar file. If it's null, the class will be<a name="line.1167"></a>
+<span class="sourceLineNo">1168</span>     * loaded from default 
classloader.<a name="line.1168"></a>
+<span class="sourceLineNo">1169</span>     * @param className Full class 
name.<a name="line.1169"></a>
+<span class="sourceLineNo">1170</span>     * @param priority Priority<a 
name="line.1170"></a>
+<span class="sourceLineNo">1171</span>     * @param kvs Arbitrary key-value 
parameter pairs passed into the<a name="line.1171"></a>
+<span class="sourceLineNo">1172</span>     * coprocessor.<a 
name="line.1172"></a>
+<span class="sourceLineNo">1173</span>     * @throws IOException<a 
name="line.1173"></a>
+<span class="sourceLineNo">1174</span>     * @return the modifyable TD<a 
name="line.1174"></a>
+<span class="sourceLineNo">1175</span>     */<a name="line.1175"></a>
+<span class="sourceLineNo">1176</span>    public ModifyableTableDescriptor 
addCoprocessor(String className, Path jarFilePath,<a name="line.1176"></a>
+<span class="sourceLineNo">1177</span>            int priority, final 
Map&lt;String, String&gt; kvs)<a name="line.1177"></a>
+<span class="sourceLineNo">1178</span>            throws IOException {<a 
name="line.1178"></a>
+<span class="sourceLineNo">1179</span>      checkHasCoprocessor(className);<a 
name="line.1179"></a>
+<span class="sourceLineNo">1180</span><a name="line.1180"></a>
+<span class="sourceLineNo">1181</span>      // Validate parameter kvs and then 
add key/values to kvString.<a name="line.1181"></a>
+<span class="sourceLineNo">1182</span>      StringBuilder kvString = new 
StringBuilder();<a name="line.1182"></a>
+<span class="sourceLineNo">1183</span>      if (kvs != null) {<a 
name="line.1183"></a>
+<span class="sourceLineNo">1184</span>        for (Map.Entry&lt;String, 
String&gt; e : kvs.entrySet()) {<a name="line.1184"></a>
+<span class="sourceLineNo">1185</span>          if 
(!e.getKey().matches(HConstants.CP_HTD_ATTR_VALUE_PARAM_KEY_PATTERN)) {<a 
name="line.1185"></a>
+<span class="sourceLineNo">1186</span>            throw new 
IOException("Illegal parameter key = " + e.getKey());<a name="line.1186"></a>
+<span class="sourceLineNo">1187</span>          }<a name="line.1187"></a>
+<span class="sourceLineNo">1188</span>          if 
(!e.getValue().matches(HConstants.CP_HTD_ATTR_VALUE_PARAM_VALUE_PATTERN)) {<a 
name="line.1188"></a>
+<span class="sourceLineNo">1189</span>            throw new 
IOException("Illegal parameter (" + e.getKey()<a name="line.1189"></a>
+<span class="sourceLineNo">1190</span>                    + ") value = " + 
e.getValue());<a name="line.1190"></a>
+<span class="sourceLineNo">1191</span>          }<a name="line.1191"></a>
+<span class="sourceLineNo">1192</span>          if (kvString.length() != 0) 
{<a name="line.1192"></a>
+<span class="sourceLineNo">1193</span>            kvString.append(',');<a 
name="line.1193"></a>
+<span class="sourceLineNo">1194</span>          }<a name="line.1194"></a>
+<span class="sourceLineNo">1195</span>          kvString.append(e.getKey());<a 
name="line.1195"></a>
+<span class="sourceLineNo">1196</span>          kvString.append('=');<a 
name="line.1196"></a>
+<span class="sourceLineNo">1197</span>          
kvString.append(e.getValue());<a name="line.1197"></a>
+<span class="sourceLineNo">1198</span>        }<a name="line.1198"></a>
+<span class="sourceLineNo">1199</span>      }<a name="line.1199"></a>
+<span class="sourceLineNo">1200</span><a name="line.1200"></a>
+<span class="sourceLineNo">1201</span>      String value = ((jarFilePath == 
null) ? "" : jarFilePath.toString())<a name="line.1201"></a>
+<span class="sourceLineNo">1202</span>              + "|" + className + "|" + 
Integer.toString(priority) + "|"<a name="line.1202"></a>
+<span class="sourceLineNo">1203</span>              + kvString.toString();<a 
name="line.1203"></a>
+<span class="sourceLineNo">1204</span>      return 
addCoprocessorToMap(value);<a name="line.1204"></a>
+<span class="sourceLineNo">1205</span>    }<a name="line.1205"></a>
+<span class="sourceLineNo">1206</span><a name="line.1206"></a>
+<span class="sourceLineNo">1207</span>    /**<a name="line.1207"></a>
+<span class="sourceLineNo">1208</span>     * Add a table coprocessor to this 
table. The coprocessor type must be<a name="line.1208"></a>
+<span class="sourceLineNo">1209</span>     * 
org.apache.hadoop.hbase.coprocessor.RegionObserver or Endpoint. It won't<a 
name="line.1209"></a>
+<span class="sourceLineNo">1210</span>     * check if the class can be loaded 
or not. Whether a coprocessor is<a name="line.1210"></a>
+<span class="sourceLineNo">1211</span>     * loadable or not will be 
determined when a region is opened.<a name="line.1211"></a>
+<span class="sourceLineNo">1212</span>     *<a name="line.1212"></a>
+<span class="sourceLineNo">1213</span>     * @param specStr The Coprocessor 
specification all in in one String<a name="line.1213"></a>
+<span class="sourceLineNo">1214</span>     * formatted so matches {@link 
HConstants#CP_HTD_ATTR_VALUE_PATTERN}<a name="line.1214"></a>
+<span class="sourceLineNo">1215</span>     * @throws IOException<a 
name="line.1215"></a>
+<span class="sourceLineNo">1216</span>     * @return the modifyable TD<a 
name="line.1216"></a>
+<span class="sourceLineNo">1217</span>     */<a name="line.1217"></a>
+<span class="sourceLineNo">1218</span>    public ModifyableTableDescriptor 
addCoprocessorWithSpec(final String specStr) throws IOException {<a 
name="line.1218"></a>
+<span class="sourceLineNo">1219</span>      String className = 
getCoprocessorClassNameFromSpecStr(specStr);<a name="line.1219"></a>
+<span class="sourceLineNo">1220</span>      if (className == null) {<a 
name="line.1220"></a>
+<span class="sourceLineNo">1221</span>        throw new 
IllegalArgumentException("Format does not match "<a name="line.1221"></a>
+<span class="sourceLineNo">1222</span>                + 
HConstants.CP_HTD_ATTR_VALUE_PATTERN + ": " + specStr);<a name="line.1222"></a>
+<span class="sourceLineNo">1223</span>      }<a name="line.1223"></a>
+<span class="sourceLineNo">1224</span>      checkHasCoprocessor(className);<a 
name="line.1224"></a>
+<span class="sourceLineNo">1225</span>      return 
addCoprocessorToMap(specStr);<a name="line.1225"></a>
+<span class="sourceLineNo">1226</span>    }<a name="line.1226"></a>
+<span class="sourceLineNo">1227</span><a name="line.1227"></a>
+<span class="sourceLineNo">1228</span>    private void 
checkHasCoprocessor(final String className) throws IOException {<a 
name="line.1228"></a>
+<span class="sourceLineNo">1229</span>      if (hasCoprocessor(className)) {<a 
name="line.1229"></a>
+<span class="sourceLineNo">1230</span>        throw new 
IOException("Coprocessor " + className + " already exists.");<a 
name="line.1230"></a>
+<span class="sourceLineNo">1231</span>      }<a name="line.1231"></a>
+<span class="sourceLineNo">1232</span>    }<a name="line.1232"></a>
+<span class="sourceLineNo">1233</span><a name="line.1233"></a>
+<span class="sourceLineNo">1234</span>    /**<a name="line.1234"></a>
+<span class="sourceLineNo">1235</span>     * Add coprocessor to values Map<a 
name="line.1235"></a>
+<span class="sourceLineNo">1236</span>     *<a name="line.1236"></a>
+<span class="sourceLineNo">1237</span>     * @param specStr The Coprocessor 
specification all in in one String<a name="line.1237"></a>
+<span class="sourceLineNo">1238</span>     * formatted so matches {@link 
HConstants#CP_HTD_ATTR_VALUE_PATTERN}<a name="line.1238"></a>
+<span class="sourceLineNo">1239</span>     * @return Returns 
&lt;code&gt;this&lt;/code&gt;<a name="line.1239"></a>
+<span class="sourceLineNo">1240</span>     */<a name="line.1240"></a>
+<span class="sourceLineNo">1241</span>    private ModifyableTableDescriptor 
addCoprocessorToMap(final String specStr) {<a name="line.1241"></a>
+<span class="sourceLineNo">1242</span>      if (specStr == null) {<a 
name="line.1242"></a>
+<span class="sourceLineNo">1243</span>        return this;<a 
name="line.1243"></a>
+<span class="sourceLineNo">1244</span>      }<a name="line.1244"></a>
+<span class="sourceLineNo">1245</span>      // generate a coprocessor key<a 
name="line.1245"></a>
+<span class="sourceLineNo">1246</span>      int maxCoprocessorNumber = 0;<a 
name="line.1246"></a>
+<span class="sourceLineNo">1247</span>      Matcher keyMatcher;<a 
name="line.1247"></a>
+<span class="sourceLineNo">1248</span>      for (Map.Entry&lt;Bytes, Bytes&gt; 
e : this.values.entrySet()) {<a name="line.1248"></a>
+<span class="sourceLineNo">1249</span>        keyMatcher = 
HConstants.CP_HTD_ATTR_KEY_PATTERN.matcher(Bytes.toString(e.getKey().get()));<a 
name="line.1249"></a>
+<span class="sourceLineNo">1250</span>        if (!keyMatcher.matches()) {<a 
name="line.1250"></a>
+<span class="sourceLineNo">1251</span>          continue;<a 
name="line.1251"></a>
+<span class="sourceLineNo">1252</span>        }<a name="line.1252"></a>
+<span class="sourceLineNo">1253</span>        maxCoprocessorNumber = 
Math.max(Integer.parseInt(keyMatcher.group(1)), maxCoprocessorNumber);<a 
name="line.1253"></a>
+<span class="sourceLineNo">1254</span>      }<a name="line.1254"></a>
+<span class="sourceLineNo">1255</span>      maxCoprocessorNumber++;<a 
name="line.1255"></a>
+<span class="sourceLineNo">1256</span>      String key = "coprocessor$" + 
Integer.toString(maxCoprocessorNumber);<a name="line.1256"></a>
+<span class="sourceLineNo">1257</span>      return setValue(new 
Bytes(Bytes.toBytes(key)), new Bytes(Bytes.toBytes(specStr)));<a 
name="line.1257"></a>
+<span class="sourceLineNo">1258</span>    }<a name="line.1258"></a>
+<span class="sourceLineNo">1259</span><a name="line.1259"></a>
+<span class="sourceLineNo">1260</span>    /**<a name="line.1260"></a>
+<span class="sourceLineNo">1261</span>     * Check if the table has an 
attached co-processor represented by the name<a name="line.1261"></a>
+<span class="sourceLineNo">1262</span>     * className<a name="line.1262"></a>
+<span class="sourceLineNo">1263</span>     *<a name="line.1263"></a>
+<span class="sourceLineNo">1264</span>     * @param classNameToMatch - Class 
name of the co-processor<a name="line.1264"></a>
+<span class="sourceLineNo">1265</span>     * @return true of the table has a 
co-processor className<a name="line.1265"></a>
+<span class="sourceLineNo">1266</span>     */<a name="line.1266"></a>
+<span class="sourceLineNo">1267</span>    @Override<a name="line.1267"></a>
+<span class="sourceLineNo">1268</span>    public boolean hasCoprocessor(String 
classNameToMatch) {<a name="line.1268"></a>
+<span class="sourceLineNo">1269</span>      Matcher keyMatcher;<a 
name="line.1269"></a>
+<span class="sourceLineNo">1270</span>      for (Map.Entry&lt;Bytes, Bytes&gt; 
e<a name="line.1270"></a>
+<span class="sourceLineNo">1271</span>              : this.values.entrySet()) 
{<a name="line.1271"></a>
+<span class="sourceLineNo">1272</span>        keyMatcher<a 
name="line.1272"></a>
+<span class="sourceLineNo">1273</span>                = 
HConstants.CP_HTD_ATTR_KEY_PATTERN.matcher(<a name="line.1273"></a>
+<span class="sourceLineNo">1274</span>                        
Bytes.toString(e.getKey().get()));<a name="line.1274"></a>
+<span class="sourceLineNo">1275</span>        if (!keyMatcher.matches()) {<a 
name="line.1275"></a>
+<span class="sourceLineNo">1276</span>          continue;<a 
name="line.1276"></a>
+<span class="sourceLineNo">1277</span>        }<a name="line.1277"></a>
+<span class="sourceLineNo">1278</span>        String className = 
getCoprocessorClassNameFromSpecStr(Bytes.toString(e.getValue().get()));<a 
name="line.1278"></a>
+<span class="sourceLineNo">1279</span>        if (className == null) {<a 
name="line.1279"></a>
+<span class="sourceLineNo">1280</span>          continue;<a 
name="line.1280"></a>
+<span class="sourceLineNo">1281</span>        }<a name="line.1281"></a>
+<span class="sourceLineNo">1282</span>        if 
(className.equals(classNameToMatch.trim())) {<a name="line.1282"></a>
+<span class="sourceLineNo">1283</span>          return true;<a 
name="line.1283"></a>
+<span class="sourceLineNo">1284</span>        }<a name="line.1284"></a>
+<span class="sourceLineNo">1285</span>      }<a name="line.1285"></a>
+<span class="sourceLineNo">1286</span>      return false;<a 
name="line.1286"></a>
+<span class="sourceLineNo">1287</span>    }<a name="line.1287"></a>
+<span class="sourceLineNo">1288</span><a name="line.1288"></a>
+<span class="sourceLineNo">1289</span>    /**<a name="line.1289"></a>
+<span class="sourceLineNo">1290</span>     * Return the list of attached 
co-processor represented by their name<a name="line.1290"></a>
+<span class="sourceLineNo">1291</span>     * className<a name="line.1291"></a>
+<span class="sourceLineNo">1292</span>     *<a name="line.1292"></a>
+<span class="sourceLineNo">1293</span>     * @return The list of co-processors 
classNames<a name="line.1293"></a>
+<span class="sourceLineNo">1294</span>     */<a name="line.1294"></a>
+<span class="sourceLineNo">1295</span>    @Override<a name="line.1295"></a>
+<span class="sourceLineNo">1296</span>    public List&lt;String&gt; 
getCoprocessors() {<a name="line.1296"></a>
+<span class="sourceLineNo">1297</span>      List&lt;String&gt; result = new 
ArrayList&lt;&gt;(this.values.entrySet().size());<a name="line.1297"></a>
+<span class="sourceLineNo">1298</span>      Matcher keyMatcher;<a 
name="line.1298"></a>
+<span class="sourceLineNo">1299</span>      for (Map.Entry&lt;Bytes, Bytes&gt; 
e : this.values.entrySet()) {<a name="line.1299"></a>
+<span class="sourceLineNo">1300</span>        keyMatcher = 
HConstants.CP_HTD_ATTR_KEY_PATTERN.matcher(Bytes.toString(e.getKey().get()));<a 
name="line.1300"></a>
+<span class="sourceLineNo">1301</span>        if (!keyMatcher.matches()) {<a 
name="line.1301"></a>
+<span class="sourceLineNo">1302</span>          continue;<a 
name="line.1302"></a>
+<span class="sourceLineNo">1303</span>        }<a name="line.1303"></a>
+<span class="sourceLineNo">1304</span>        String className = 
getCoprocessorClassNameFromSpecStr(Bytes.toString(e.getValue().get()));<a 
name="line.1304"></a>
+<span class="sourceLineNo">1305</span>        if (className == null) {<a 
name="line.1305"></a>
+<span class="sourceLineNo">1306</span>          continue;<a 
name="line.1306"></a>
+<span class="sourceLineNo">1307</span>        }<a name="line.1307"></a>
+<span class="sourceLineNo">1308</span>        result.add(className); // 
classname is the 2nd field<a name="line.1308"></a>
+<span class="sourceLineNo">1309</span>      }<a name="line.1309"></a>
+<span class="sourceLineNo">1310</span>      return result;<a 
name="line.1310"></a>
+<span class="sourceLineNo">1311</span>    }<a name="line.1311"></a>
+<span class="sourceLineNo">1312</span><a name="line.1312"></a>
+<span class="sourceLineNo">1313</span>    /**<a name="line.1313"></a>
+<span class="sourceLineNo">1314</span>     * @param spec String formatted as 
per<a name="line.1314"></a>
+<span class="sourceLineNo">1315</span>     * {@link 
HConstants#CP_HTD_ATTR_VALUE_PATTERN}<a name="line.1315"></a>
+<span class="sourceLineNo">1316</span>     * @return Class parsed from passed 
in &lt;code&gt;spec&lt;/code&gt; or null if no match<a name="line.1316"></a>
+<span class="sourceLineNo">1317</span>     * or classpath found<a 
name="line.1317"></a>
+<span class="sourceLineNo">1318</span>     */<a name="line.1318"></a>
+<span class="sourceLineNo">1319</span>    private static String 
getCoprocessorClassNameFromSpecStr(final String spec) {<a name="line.1319"></a>
+<span class="sourceLineNo">1320</span>      Matcher matcher = 
HConstants.CP_HTD_ATTR_VALUE_PATTERN.matcher(spec);<a name="line.1320"></a>
+<span class="sourceLineNo">1321</span>      // Classname is the 2nd field<a 
name="line.1321"></a>
+<span class="sourceLineNo">1322</span>      return matcher != null &amp;&amp; 
matcher.matches() ? matcher.group(2).trim() : null;<a name="line.1322"></a>
+<span class="sourceLineNo">1323</span>    }<a name="line.1323"></a>
+<span class="sourceLineNo">1324</span><a name="line.1324"></a>
+<span class="sourceLineNo">1325</span>    /**<a name="line.1325"></a>
+<span class="sourceLineNo">1326</span>     * Remove a coprocessor from those 
set on the table<a name="line.1326"></a>
+<span class="sourceLineNo">1327</span>     *<a name="line.1327"></a>
+<span class="sourceLineNo">1328</span>     * @param className Class name of 
the co-processor<a name="line.1328"></a>
+<span class="sourceLineNo">1329</span>     */<a name="line.1329"></a>
+<span class="sourceLineNo">1330</span>    public void removeCoprocessor(String 
className) {<a name="line.1330"></a>
+<span class="sourceLineNo">1331</span>      Bytes match = null;<a 
name="line.1331"></a>
+<span class="sourceLineNo">1332</span>      Matcher keyMatcher;<a 
name="line.1332"></a>
+<span class="sourceLineNo">1333</span>      Matcher valueMatcher;<a 
name="line.1333"></a>
+<span class="sourceLineNo">1334</span>      for (Map.Entry&lt;Bytes, Bytes&gt; 
e : this.values<a name="line.1334"></a>
+<span class="sourceLineNo">1335</span>              .entrySet()) {<a 
name="line.1335"></a>
+<span class="sourceLineNo">1336</span>        keyMatcher = 
HConstants.CP_HTD_ATTR_KEY_PATTERN.matcher(Bytes.toString(e<a 
name="line.1336"></a>
+<span class="sourceLineNo">1337</span>                .getKey().get()));<a 
name="line.1337"></a>
+<span class="sourceLineNo">1338</span>        if (!keyMatcher.matches()) {<a 
name="line.1338"></a>
+<span class="sourceLineNo">1339</span>          continue;<a 
name="line.1339"></a>
+<span class="sourceLineNo">1340</span>        }<a name="line.1340"></a>
+<span class="sourceLineNo">1341</span>        valueMatcher = 
HConstants.CP_HTD_ATTR_VALUE_PATTERN.matcher(Bytes<a name="line.1341"></a>
+<span class="sourceLineNo">1342</span>                
.toString(e.getValue().get()));<a name="line.1342"></a>
+<span class="sourceLineNo">1343</span>        if (!valueMatcher.matches()) {<a 
name="line.1343"></a>
+<span class="sourceLineNo">1344</span>          continue;<a 
name="line.1344"></a>
+<span class="sourceLineNo">1345</span>        }<a name="line.1345"></a>
+<span class="sourceLineNo">1346</span>        // get className and compare<a 
name="line.1346"></a>
+<span class="sourceLineNo">1347</span>        String clazz = 
valueMatcher.group(2).trim(); // classname is the 2nd field<a 
name="line.1347"></a>
+<span class="sourceLineNo">1348</span>        // remove the CP if it is 
present<a name="line.1348"></a>
+<span class="sourceLineNo">1349</span>        if 
(clazz.equals(className.trim())) {<a name="line.1349"></a>
+<span class="sourceLineNo">1350</span>          match = e.getKey();<a 
name="line.1350"></a>
+<span class="sourceLineNo">1351</span>          break;<a name="line.1351"></a>
+<span class="sourceLineNo">1352</span>        }<a name="line.1352"></a>
+<span class="sourceLineNo">1353</span>      }<a name="line.1353"></a>
+<span class="sourceLineNo">1354</span>      // if we found a match, remove 
it<a name="line.1354"></a>
+<span class="sourceLineNo">1355</span>      if (match != null) {<a 
name="line.1355"></a>
+<span class="sourceLineNo">1356</span>        
ModifyableTableDescriptor.this.removeValue(match);<a name="line.1356"></a>
+<span class="sourceLineNo">1357</span>      }<a name="line.1357"></a>
+<span class="sourceLineNo">1358</span>    }<a name="line.1358"></a>
+<span class="sourceLineNo">1359</span><a name="line.1359"></a>
+<span class="sourceLineNo">1360</span>    @Deprecated<a name="line.1360"></a>
+<span class="sourceLineNo">1361</span>    public ModifyableTableDescriptor 
setOwner(User owner) {<a name="line.1361"></a>
+<span class="sourceLineNo">1362</span>      return setOwnerString(owner != 
null ? owner.getShortName() : null);<a name="line.1362"></a>
+<span class="sourceLineNo">1363</span>    }<a name="line.1363"></a>
+<span class="sourceLineNo">1364</span><a name="line.1364"></a>
+<span class="sourceLineNo">1365</span>    // used by 
admin.rb:alter(table_name,*args) to update owner.<a name="line.1365"></a>
+<span class="sourceLineNo">1366</span>    @Deprecated<a name="line.1366"></a>
+<span class="sourceLineNo">1367</span>    public ModifyableTableDescriptor 
setOwnerString(String ownerString) {<a name="line.1367"></a>
+<span class="sourceLineNo">1368</span>      return setValue(OWNER_KEY, 
ownerString);<a name="line.1368"></a>
+<span class="sourceLineNo">1369</span>    }<a name="line.1369"></a>
+<span class="sourceLineNo">1370</span><a name="line.1370"></a>
+<span class="sourceLineNo">1371</span>    @Override<a name="line.1371"></a>
+<span class="sourceLineNo">1372</span>    @Deprecated<a name="line.1372"></a>
+<span class="sourceLineNo">1373</span>    public String getOwnerString() {<a 
name="line.1373"></a>
+<span class="sourceLineNo">1374</span>      // Note that every table should 
have an owner (i.e. should have OWNER_KEY set).<a name="line.1374"></a>
+<span class="sourceLineNo">1375</span>      // hbase:meta should return system 
user as owner, not null (see<a name="line.1375"></a>
+<span class="sourceLineNo">1376</span>      // 
MasterFileSystem.java:bootstrap()).<a name="line.1376"></a>
+<span class="sourceLineNo">1377</span>      return getOrDefault(OWNER_KEY, 
Function.identity(), null);<a name="line.1377"></a>
 <span class="sourceLineNo">1378</span>    }<a name="line.1378"></a>
 <span class="sourceLineNo">1379</span><a name="line.1379"></a>
-<span class="sourceLineNo">1380</span>    @Override<a name="line.1380"></a>
-<span class="sourceLineNo">1381</span>    @Deprecated<a name="line.1381"></a>
-<span class="sourceLineNo">1382</span>    public String getOwnerString() {<a 
name="line.1382"></a>
-<span class="sourceLineNo">1383</span>      // Note that every table should 
have an owner (i.e. should have OWNER_KEY set).<a name="line.1383"></a>
-<span class="sourceLineNo">1384</span>      // hbase:meta should return system 
user as owner, not null (see<a name="line.1384"></a>
-<span class="sourceLineNo">1385</span>      // 
MasterFileSystem.java:bootstrap()).<a name="line.1385"></a>
-<span class="sourceLineNo">1386</span>      return getOrDefault(OWNER_KEY, 
Function.identity(), null);<a name="line.1386"></a>
-<span class="sourceLineNo">1387</span>    }<a name="line.1387"></a>
-<span class="sourceLineNo">1388</span><a name="line.1388"></a>
-<span class="sourceLineNo">1389</span>    /**<a name="line.1389"></a>
-<span class="sourceLineNo">1390</span>     * @return the bytes in pb format<a 
name="line.1390"></a>
-<span class="sourceLineNo">1391</span>     */<a name="line.1391"></a>
-<span class="sourceLineNo">1392</span>    private byte[] toByteArray() {<a 
name="line.1392"></a>
-<span class="sourceLineNo">1393</span>      return 
ProtobufUtil.prependPBMagic(ProtobufUtil.toTableSchema(this).toByteArray());<a 
name="line.1393"></a>
-<span class="sourceLineNo">1394</span>    }<a name="line.1394"></a>
-<span class="sourceLineNo">1395</span><a name="line.1395"></a>
-<span class="sourceLineNo">1396</span>    /**<a name="line.1396"></a>
-<span class="sourceLineNo">1397</span>     * @param bytes A pb serialized 
{@link ModifyableTableDescriptor} instance<a name="line.1397"></a>
-<span class="sourceLineNo">1398</span>     * with pb magic prefix<a 
name="line.1398"></a>
-<span class="sourceLineNo">1399</span>     * @return An instance of {@link 
ModifyableTableDescriptor} made from<a name="line.1399"></a>
-<span class="sourceLineNo">1400</span>     * &lt;code&gt;bytes&lt;/code&gt;<a 
name="line.1400"></a>
-<span class="sourceLineNo">1401</span>     * @throws 
DeserializationException<a name="line.1401"></a>
-<span class="sourceLineNo">1402</span>     * @see #toByteArray()<a 
name="line.1402"></a>
-<span class="sourceLineNo">1403</span>     */<a name="line.1403"></a>
-<span class="sourceLineNo">1404</span>    private static TableDescriptor 
parseFrom(final byte[] bytes)<a name="line.1404"></a>
-<span class="sourceLineNo">1405</span>            throws 
DeserializationException {<a name="line.1405"></a>
-<span class="sourceLineNo">1406</span>      if 
(!ProtobufUtil.isPBMagicPrefix(bytes)) {<a name="line.1406"></a>
-<span class="sourceLineNo">1407</span>        throw new 
DeserializationException("Expected PB encoded ModifyableTableDescriptor");<a 
name="line.1407"></a>
-<span class="sourceLineNo">1408</span>      }<a name="line.1408"></a>
-<span class="sourceLineNo">1409</span>      int pblen = 
ProtobufUtil.lengthOfPBMagic();<a name="line.1409"></a>
-<span class="sourceLineNo">1410</span>      HBaseProtos.TableSchema.Builder 
builder = HBaseProtos.TableSchema.newBuilder();<a name="line.1410"></a>
-<span class="sourceLineNo">1411</span>      try {<a name="line.1411"></a>
-<span class="sourceLineNo">1412</span>        ProtobufUtil.mergeFrom(builder, 
bytes, pblen, bytes.length - pblen);<a name="line.1412"></a>
-<span class="sourceLineNo">1413</span>        return 
ProtobufUtil.toTableDescriptor(builder.build());<a name="line.1413"></a>
-<span class="sourceLineNo">1414</span>      } catch (IOException e) {<a 
name="line.1414"></a>
-<span class="sourceLineNo">1415</span>        throw new 
DeserializationException(e);<a name="line.1415"></a>
-<span class="sourceLineNo">1416</span>      }<a name="line.1416"></a>
-<span class="sourceLineNo">1417</span>    }<a name="line.1417"></a>
-<span class="sourceLineNo">1418</span><a name="line.1418"></a>
-<span class="sourceLineNo">1419</span>    @Override<a name="line.1419"></a>
-<span class="sourceLineNo">1420</span>    public int getColumnFamilyCount() 
{<a name="line.1420"></a>
-<span class="sourceLineNo">1421</span>      return families.size();<a 
name="line.1421"></a>
-<span class="sourceLineNo">1422</span>    }<a name="line.1422"></a>
-<span class="sourceLineNo">1423</span>  }<a name="line.1423"></a>
-<span class="sourceLineNo">1424</span><a name="line.1424"></a>
-<span class="sourceLineNo">1425</span>}<a name="line.1425"></a>
+<span class="sourceLineNo">1380</span>    /**<a name="line.1380"></a>
+<span class="sourceLineNo">1381</span>     * @return the bytes in pb format<a 
name="line.1381"></a>
+<span class="sourceLineNo">1382</span>     */<a name="line.1382"></a>
+<span class="sourceLineNo">1383</span>    private byte[] toByteArray() {<a 
name="line.1383"></a>
+<span class="sourceLineNo">1384</span>      return 
ProtobufUtil.prependPBMagic(ProtobufUtil.toTableSchema(this).toByteArray());<a 
name="line.1384"></a>
+<span class="sourceLineNo">1385</span>    }<a name="line.1385"></a>
+<span class="sourceLineNo">1386</span><a name="line.1386"></a>
+<span class="sourceLineNo">1387</span>    /**<a name="line.1387"></a>
+<span class="sourceLineNo">1388</span>     * @param bytes A pb serialized 
{@link ModifyableTableDescriptor} instance<a name="line.1388"></a>
+<span class="sourceLineNo">1389</span>     * with pb magic prefix<a 
name="line.1389"></a>
+<span class="sourceLineNo">1390</span>     * @return An instance of {@link 
ModifyableTableDescriptor} made from<a name="line.1390"></a>
+<span class="sourceLineNo">1391</span>     * &lt;code&gt;bytes&lt;/code&gt;<a 
name="line.1391"></a>
+<span class="sourceLineNo">1392</span>     * @throws 
DeserializationException<a name="line.1392"></a>
+<span class="sourceLineNo">1393</span>     * @see #toByteArray()<a 
name="line.1393"></a>
+<span class="sourceLineNo">1394</span>     */<a name="line.1394"></a>
+<span class="sourceLineNo">1395</span>    private static TableDescriptor 
parseFrom(final byte[] bytes)<a name="line.1395"></a>
+<span class="sourceLineNo">1396</span>            throws 
DeserializationException {<a name="line.1396"></a>
+<span class="sourceLineNo">1397</span>      if 
(!ProtobufUtil.isPBMagicPrefix(bytes)) {<a name="line.1397"></a>
+<span class="sourceLineNo">1398</span>        throw new 
DeserializationException("Expected PB encoded ModifyableTableDescriptor");<a 
name="line.1398"></a>
+<span class="sourceLineNo">1399</span>      }<a name="line.1399"></a>
+<span class="sourceLineNo">1400</span>      int pblen = 
ProtobufUtil.lengthOfPBMagic();<a name="line.1400"></a>
+<span class="sourceLineNo">1401</span>      HBaseProtos.TableSchema.Builder 
builder = HBaseProtos.TableSchema.newBuilder();<a name="line.1401"></a>
+<span class="sourceLineNo">1402</span>      try {<a name="line.1402"></a>
+<span class="sourceLineNo">1403</span>        ProtobufUtil.mergeFrom(builder, 
bytes, pblen, bytes.length - pblen);<a name="line.1403"></a>
+<span class="sourceLineNo">1404</span>        return 
ProtobufUtil.toTableDescriptor(builder.build());<a name="line.1404"></a>
+<span class="sourceLineNo">1405</span>      } catch (IOException e) {<a 
name="line.1405"></a>
+<span class="sourceLineNo">1406</span>        throw new 
DeserializationException(e);<a name="line.1406"></a>
+<span class="sourceLineNo">1407</span>      }<a name="line.1407"></a>
+<span class="sourceLineNo">1408</span>    }<a name="line.1408"></a>
+<span class="sourceLineNo">1409</span><a name="line.1409"></a>
+<span class="sourceLineNo">1410</span>    @Override<a name="line.1410"></a>
+<span class="sourceLineNo">1411</span>    public int getColumnFamilyCount() 
{<a name="line.1411"></a>
+<span class="sourceLineNo">1412</span>      return families.size();<a 
name="line.1412"></a>
+<span class="sourceLineNo">1413</span>    }<a name="line.1413"></a>
+<span class="sourceLineNo">1414</span>  }<a name="line.1414"></a>
+<span class="sourceLineNo">1415</span><a name="line.1415"></a>
+<span class="sourceLineNo">1416</span>}<a name="line.1416"></a>
 
 
 

Reply via email to