hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From git-site-r...@apache.org
Subject [42/51] [partial] hbase-site git commit: Published site at .
Date Thu, 24 Aug 2017 15:11:20 GMT
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/4f1f2a0b/apidocs/src-html/org/apache/hadoop/hbase/client/AsyncBufferedMutatorBuilder.html
----------------------------------------------------------------------
diff --git a/apidocs/src-html/org/apache/hadoop/hbase/client/AsyncBufferedMutatorBuilder.html b/apidocs/src-html/org/apache/hadoop/hbase/client/AsyncBufferedMutatorBuilder.html
new file mode 100644
index 0000000..8f947f8
--- /dev/null
+++ b/apidocs/src-html/org/apache/hadoop/hbase/client/AsyncBufferedMutatorBuilder.html
@@ -0,0 +1,157 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html lang="en">
+<head>
+<title>Source code</title>
+<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
+</head>
+<body>
+<div class="sourceContainer">
+<pre><span class="sourceLineNo">001</span>/**<a name="line.1"></a>
+<span class="sourceLineNo">002</span> * Licensed to the Apache Software Foundation (ASF) under one<a name="line.2"></a>
+<span class="sourceLineNo">003</span> * or more contributor license agreements.  See the NOTICE file<a name="line.3"></a>
+<span class="sourceLineNo">004</span> * distributed with this work for additional information<a name="line.4"></a>
+<span class="sourceLineNo">005</span> * regarding copyright ownership.  The ASF licenses this file<a name="line.5"></a>
+<span class="sourceLineNo">006</span> * to you under the Apache License, Version 2.0 (the<a name="line.6"></a>
+<span class="sourceLineNo">007</span> * "License"); you may not use this file except in compliance<a name="line.7"></a>
+<span class="sourceLineNo">008</span> * with the License.  You may obtain a copy of the License at<a name="line.8"></a>
+<span class="sourceLineNo">009</span> *<a name="line.9"></a>
+<span class="sourceLineNo">010</span> *     http://www.apache.org/licenses/LICENSE-2.0<a name="line.10"></a>
+<span class="sourceLineNo">011</span> *<a name="line.11"></a>
+<span class="sourceLineNo">012</span> * Unless required by applicable law or agreed to in writing, software<a name="line.12"></a>
+<span class="sourceLineNo">013</span> * distributed under the License is distributed on an "AS IS" BASIS,<a name="line.13"></a>
+<span class="sourceLineNo">014</span> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.<a name="line.14"></a>
+<span class="sourceLineNo">015</span> * See the License for the specific language governing permissions and<a name="line.15"></a>
+<span class="sourceLineNo">016</span> * limitations under the License.<a name="line.16"></a>
+<span class="sourceLineNo">017</span> */<a name="line.17"></a>
+<span class="sourceLineNo">018</span>package org.apache.hadoop.hbase.client;<a name="line.18"></a>
+<span class="sourceLineNo">019</span><a name="line.19"></a>
+<span class="sourceLineNo">020</span>import static org.apache.hadoop.hbase.client.ConnectionUtils.retries2Attempts;<a name="line.20"></a>
+<span class="sourceLineNo">021</span><a name="line.21"></a>
+<span class="sourceLineNo">022</span>import java.util.concurrent.TimeUnit;<a name="line.22"></a>
+<span class="sourceLineNo">023</span><a name="line.23"></a>
+<span class="sourceLineNo">024</span>import org.apache.hadoop.hbase.classification.InterfaceAudience;<a name="line.24"></a>
+<span class="sourceLineNo">025</span><a name="line.25"></a>
+<span class="sourceLineNo">026</span>/**<a name="line.26"></a>
+<span class="sourceLineNo">027</span> * For creating {@link AsyncBufferedMutator}.<a name="line.27"></a>
+<span class="sourceLineNo">028</span> */<a name="line.28"></a>
+<span class="sourceLineNo">029</span>@InterfaceAudience.Public<a name="line.29"></a>
+<span class="sourceLineNo">030</span>public interface AsyncBufferedMutatorBuilder {<a name="line.30"></a>
+<span class="sourceLineNo">031</span><a name="line.31"></a>
+<span class="sourceLineNo">032</span>  /**<a name="line.32"></a>
+<span class="sourceLineNo">033</span>   * Set timeout for the background flush operation.<a name="line.33"></a>
+<span class="sourceLineNo">034</span>   */<a name="line.34"></a>
+<span class="sourceLineNo">035</span>  AsyncBufferedMutatorBuilder setOperationTimeout(long timeout, TimeUnit unit);<a name="line.35"></a>
+<span class="sourceLineNo">036</span><a name="line.36"></a>
+<span class="sourceLineNo">037</span>  /**<a name="line.37"></a>
+<span class="sourceLineNo">038</span>   * Set timeout for each rpc request when doing background flush.<a name="line.38"></a>
+<span class="sourceLineNo">039</span>   */<a name="line.39"></a>
+<span class="sourceLineNo">040</span>  AsyncBufferedMutatorBuilder setRpcTimeout(long timeout, TimeUnit unit);<a name="line.40"></a>
+<span class="sourceLineNo">041</span><a name="line.41"></a>
+<span class="sourceLineNo">042</span>  /**<a name="line.42"></a>
+<span class="sourceLineNo">043</span>   * Set the base pause time for retrying. We use an exponential policy to generate sleep time when<a name="line.43"></a>
+<span class="sourceLineNo">044</span>   * retrying.<a name="line.44"></a>
+<span class="sourceLineNo">045</span>   */<a name="line.45"></a>
+<span class="sourceLineNo">046</span>  AsyncBufferedMutatorBuilder setRetryPause(long pause, TimeUnit unit);<a name="line.46"></a>
+<span class="sourceLineNo">047</span><a name="line.47"></a>
+<span class="sourceLineNo">048</span>  /**<a name="line.48"></a>
+<span class="sourceLineNo">049</span>   * Set the max retry times for an operation. Usually it is the max attempt times minus 1.<a name="line.49"></a>
+<span class="sourceLineNo">050</span>   * &lt;p&gt;<a name="line.50"></a>
+<span class="sourceLineNo">051</span>   * Operation timeout and max attempt times(or max retry times) are both limitations for retrying,<a name="line.51"></a>
+<span class="sourceLineNo">052</span>   * we will stop retrying when we reach any of the limitations.<a name="line.52"></a>
+<span class="sourceLineNo">053</span>   * @see #setMaxAttempts(int)<a name="line.53"></a>
+<span class="sourceLineNo">054</span>   * @see #setOperationTimeout(long, TimeUnit)<a name="line.54"></a>
+<span class="sourceLineNo">055</span>   */<a name="line.55"></a>
+<span class="sourceLineNo">056</span>  default AsyncBufferedMutatorBuilder setMaxRetries(int maxRetries) {<a name="line.56"></a>
+<span class="sourceLineNo">057</span>    return setMaxAttempts(retries2Attempts(maxRetries));<a name="line.57"></a>
+<span class="sourceLineNo">058</span>  }<a name="line.58"></a>
+<span class="sourceLineNo">059</span><a name="line.59"></a>
+<span class="sourceLineNo">060</span>  /**<a name="line.60"></a>
+<span class="sourceLineNo">061</span>   * Set the max attempt times for an operation. Usually it is the max retry times plus 1. Operation<a name="line.61"></a>
+<span class="sourceLineNo">062</span>   * timeout and max attempt times(or max retry times) are both limitations for retrying, we will<a name="line.62"></a>
+<span class="sourceLineNo">063</span>   * stop retrying when we reach any of the limitations.<a name="line.63"></a>
+<span class="sourceLineNo">064</span>   * @see #setMaxRetries(int)<a name="line.64"></a>
+<span class="sourceLineNo">065</span>   * @see #setOperationTimeout(long, TimeUnit)<a name="line.65"></a>
+<span class="sourceLineNo">066</span>   */<a name="line.66"></a>
+<span class="sourceLineNo">067</span>  AsyncBufferedMutatorBuilder setMaxAttempts(int maxAttempts);<a name="line.67"></a>
+<span class="sourceLineNo">068</span><a name="line.68"></a>
+<span class="sourceLineNo">069</span>  /**<a name="line.69"></a>
+<span class="sourceLineNo">070</span>   * Set the number of retries that are allowed before we start to log.<a name="line.70"></a>
+<span class="sourceLineNo">071</span>   */<a name="line.71"></a>
+<span class="sourceLineNo">072</span>  AsyncBufferedMutatorBuilder setStartLogErrorsCnt(int startLogErrorsCnt);<a name="line.72"></a>
+<span class="sourceLineNo">073</span><a name="line.73"></a>
+<span class="sourceLineNo">074</span>  /**<a name="line.74"></a>
+<span class="sourceLineNo">075</span>   * Override the write buffer size specified by the provided {@link AsyncConnection}'s<a name="line.75"></a>
+<span class="sourceLineNo">076</span>   * {@link org.apache.hadoop.conf.Configuration} instance, via the configuration key<a name="line.76"></a>
+<span class="sourceLineNo">077</span>   * {@code hbase.client.write.buffer}.<a name="line.77"></a>
+<span class="sourceLineNo">078</span>   */<a name="line.78"></a>
+<span class="sourceLineNo">079</span>  AsyncBufferedMutatorBuilder setWriteBufferSize(long writeBufferSize);<a name="line.79"></a>
+<span class="sourceLineNo">080</span><a name="line.80"></a>
+<span class="sourceLineNo">081</span>  /**<a name="line.81"></a>
+<span class="sourceLineNo">082</span>   * Create the {@link AsyncBufferedMutator} instance.<a name="line.82"></a>
+<span class="sourceLineNo">083</span>   */<a name="line.83"></a>
+<span class="sourceLineNo">084</span>  AsyncBufferedMutator build();<a name="line.84"></a>
+<span class="sourceLineNo">085</span>}<a name="line.85"></a>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+</pre>
+</div>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/4f1f2a0b/apidocs/src-html/org/apache/hadoop/hbase/client/AsyncConnection.html
----------------------------------------------------------------------
diff --git a/apidocs/src-html/org/apache/hadoop/hbase/client/AsyncConnection.html b/apidocs/src-html/org/apache/hadoop/hbase/client/AsyncConnection.html
index 0691430..4c15d38 100644
--- a/apidocs/src-html/org/apache/hadoop/hbase/client/AsyncConnection.html
+++ b/apidocs/src-html/org/apache/hadoop/hbase/client/AsyncConnection.html
@@ -144,7 +144,46 @@
 <span class="sourceLineNo">136</span>   * @param pool the thread pool to use for executing callback<a name="line.136"></a>
 <span class="sourceLineNo">137</span>   */<a name="line.137"></a>
 <span class="sourceLineNo">138</span>  AsyncAdminBuilder getAdminBuilder(ExecutorService pool);<a name="line.138"></a>
-<span class="sourceLineNo">139</span>}<a name="line.139"></a>
+<span class="sourceLineNo">139</span><a name="line.139"></a>
+<span class="sourceLineNo">140</span>  /**<a name="line.140"></a>
+<span class="sourceLineNo">141</span>   * Retrieve an {@link AsyncBufferedMutator} for performing client-side buffering of writes.<a name="line.141"></a>
+<span class="sourceLineNo">142</span>   * &lt;p&gt;<a name="line.142"></a>
+<span class="sourceLineNo">143</span>   * The returned instance will use default configs. Use<a name="line.143"></a>
+<span class="sourceLineNo">144</span>   * {@link #getBufferedMutatorBuilder(TableName)} if you want to customize some configs.<a name="line.144"></a>
+<span class="sourceLineNo">145</span>   * @param tableName the name of the table<a name="line.145"></a>
+<span class="sourceLineNo">146</span>   * @return an {@link AsyncBufferedMutator} for the supplied tableName.<a name="line.146"></a>
+<span class="sourceLineNo">147</span>   */<a name="line.147"></a>
+<span class="sourceLineNo">148</span>  default AsyncBufferedMutator getBufferedMutator(TableName tableName) {<a name="line.148"></a>
+<span class="sourceLineNo">149</span>    return getBufferedMutatorBuilder(tableName).build();<a name="line.149"></a>
+<span class="sourceLineNo">150</span>  }<a name="line.150"></a>
+<span class="sourceLineNo">151</span><a name="line.151"></a>
+<span class="sourceLineNo">152</span>  /**<a name="line.152"></a>
+<span class="sourceLineNo">153</span>   * Returns an {@link AsyncBufferedMutatorBuilder} for creating {@link AsyncBufferedMutator}.<a name="line.153"></a>
+<span class="sourceLineNo">154</span>   * @param tableName the name of the table<a name="line.154"></a>
+<span class="sourceLineNo">155</span>   */<a name="line.155"></a>
+<span class="sourceLineNo">156</span>  AsyncBufferedMutatorBuilder getBufferedMutatorBuilder(TableName tableName);<a name="line.156"></a>
+<span class="sourceLineNo">157</span><a name="line.157"></a>
+<span class="sourceLineNo">158</span>  /**<a name="line.158"></a>
+<span class="sourceLineNo">159</span>   * Retrieve an {@link AsyncBufferedMutator} for performing client-side buffering of writes.<a name="line.159"></a>
+<span class="sourceLineNo">160</span>   * &lt;p&gt;<a name="line.160"></a>
+<span class="sourceLineNo">161</span>   * The returned instance will use default configs. Use<a name="line.161"></a>
+<span class="sourceLineNo">162</span>   * {@link #getBufferedMutatorBuilder(TableName, ExecutorService)} if you want to customize some<a name="line.162"></a>
+<span class="sourceLineNo">163</span>   * configs.<a name="line.163"></a>
+<span class="sourceLineNo">164</span>   * @param tableName the name of the table<a name="line.164"></a>
+<span class="sourceLineNo">165</span>   * @param pool the thread pool to use for executing callback<a name="line.165"></a>
+<span class="sourceLineNo">166</span>   * @return an {@link AsyncBufferedMutator} for the supplied tableName.<a name="line.166"></a>
+<span class="sourceLineNo">167</span>   */<a name="line.167"></a>
+<span class="sourceLineNo">168</span>  default AsyncBufferedMutator getBufferedMutator(TableName tableName, ExecutorService pool) {<a name="line.168"></a>
+<span class="sourceLineNo">169</span>    return getBufferedMutatorBuilder(tableName, pool).build();<a name="line.169"></a>
+<span class="sourceLineNo">170</span>  }<a name="line.170"></a>
+<span class="sourceLineNo">171</span><a name="line.171"></a>
+<span class="sourceLineNo">172</span>  /**<a name="line.172"></a>
+<span class="sourceLineNo">173</span>   * Returns an {@link AsyncBufferedMutatorBuilder} for creating {@link AsyncBufferedMutator}.<a name="line.173"></a>
+<span class="sourceLineNo">174</span>   * @param tableName the name of the table<a name="line.174"></a>
+<span class="sourceLineNo">175</span>   * @param pool the thread pool to use for executing callback<a name="line.175"></a>
+<span class="sourceLineNo">176</span>   */<a name="line.176"></a>
+<span class="sourceLineNo">177</span>  AsyncBufferedMutatorBuilder getBufferedMutatorBuilder(TableName tableName, ExecutorService pool);<a name="line.177"></a>
+<span class="sourceLineNo">178</span>}<a name="line.178"></a>
 
 
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/4f1f2a0b/apidocs/src-html/org/apache/hadoop/hbase/client/ColumnFamilyDescriptorBuilder.html
----------------------------------------------------------------------
diff --git a/apidocs/src-html/org/apache/hadoop/hbase/client/ColumnFamilyDescriptorBuilder.html b/apidocs/src-html/org/apache/hadoop/hbase/client/ColumnFamilyDescriptorBuilder.html
index 031b981..a08278c 100644
--- a/apidocs/src-html/org/apache/hadoop/hbase/client/ColumnFamilyDescriptorBuilder.html
+++ b/apidocs/src-html/org/apache/hadoop/hbase/client/ColumnFamilyDescriptorBuilder.html
@@ -1168,219 +1168,216 @@
 <span class="sourceLineNo">1160</span>      if (this == obj) {<a name="line.1160"></a>
 <span class="sourceLineNo">1161</span>        return true;<a name="line.1161"></a>
 <span class="sourceLineNo">1162</span>      }<a name="line.1162"></a>
-<span class="sourceLineNo">1163</span>      if (obj == null) {<a name="line.1163"></a>
-<span class="sourceLineNo">1164</span>        return false;<a name="line.1164"></a>
+<span class="sourceLineNo">1163</span>      if (obj instanceof ModifyableColumnFamilyDescriptor) {<a name="line.1163"></a>
+<span class="sourceLineNo">1164</span>        return ColumnFamilyDescriptor.COMPARATOR.compare(this, (ModifyableColumnFamilyDescriptor) obj) == 0;<a name="line.1164"></a>
 <span class="sourceLineNo">1165</span>      }<a name="line.1165"></a>
-<span class="sourceLineNo">1166</span>      if (!(obj instanceof ModifyableColumnFamilyDescriptor)) {<a name="line.1166"></a>
-<span class="sourceLineNo">1167</span>        return false;<a name="line.1167"></a>
-<span class="sourceLineNo">1168</span>      }<a name="line.1168"></a>
-<span class="sourceLineNo">1169</span>      return compareTo((ModifyableColumnFamilyDescriptor) obj) == 0;<a name="line.1169"></a>
-<span class="sourceLineNo">1170</span>    }<a name="line.1170"></a>
-<span class="sourceLineNo">1171</span><a name="line.1171"></a>
-<span class="sourceLineNo">1172</span>    @Override<a name="line.1172"></a>
-<span class="sourceLineNo">1173</span>    public int hashCode() {<a name="line.1173"></a>
-<span class="sourceLineNo">1174</span>      int result = Bytes.hashCode(name);<a name="line.1174"></a>
-<span class="sourceLineNo">1175</span>      result ^= (int) COLUMN_DESCRIPTOR_VERSION;<a name="line.1175"></a>
-<span class="sourceLineNo">1176</span>      result ^= values.hashCode();<a name="line.1176"></a>
-<span class="sourceLineNo">1177</span>      result ^= configuration.hashCode();<a name="line.1177"></a>
-<span class="sourceLineNo">1178</span>      return result;<a name="line.1178"></a>
-<span class="sourceLineNo">1179</span>    }<a name="line.1179"></a>
-<span class="sourceLineNo">1180</span><a name="line.1180"></a>
-<span class="sourceLineNo">1181</span>    @Override<a name="line.1181"></a>
-<span class="sourceLineNo">1182</span>    public int compareTo(ModifyableColumnFamilyDescriptor other) {<a name="line.1182"></a>
-<span class="sourceLineNo">1183</span>      return COMPARATOR.compare(this, other);<a name="line.1183"></a>
-<span class="sourceLineNo">1184</span>    }<a name="line.1184"></a>
-<span class="sourceLineNo">1185</span><a name="line.1185"></a>
-<span class="sourceLineNo">1186</span>    /**<a name="line.1186"></a>
-<span class="sourceLineNo">1187</span>     * @return This instance serialized with pb with pb magic prefix<a name="line.1187"></a>
-<span class="sourceLineNo">1188</span>     * @see #parseFrom(byte[])<a name="line.1188"></a>
-<span class="sourceLineNo">1189</span>     */<a name="line.1189"></a>
-<span class="sourceLineNo">1190</span>    private byte[] toByteArray() {<a name="line.1190"></a>
-<span class="sourceLineNo">1191</span>      return ProtobufUtil.prependPBMagic(ProtobufUtil.convertToColumnFamilySchema(this)<a name="line.1191"></a>
-<span class="sourceLineNo">1192</span>                      .toByteArray());<a name="line.1192"></a>
-<span class="sourceLineNo">1193</span>    }<a name="line.1193"></a>
-<span class="sourceLineNo">1194</span><a name="line.1194"></a>
-<span class="sourceLineNo">1195</span>    /**<a name="line.1195"></a>
-<span class="sourceLineNo">1196</span>     * @param bytes A pb serialized {@link ModifyableColumnFamilyDescriptor} instance with pb<a name="line.1196"></a>
-<span class="sourceLineNo">1197</span>     * magic prefix<a name="line.1197"></a>
-<span class="sourceLineNo">1198</span>     * @return An instance of {@link ModifyableColumnFamilyDescriptor} made from<a name="line.1198"></a>
-<span class="sourceLineNo">1199</span>     * &lt;code&gt;bytes&lt;/code&gt;<a name="line.1199"></a>
-<span class="sourceLineNo">1200</span>     * @throws DeserializationException<a name="line.1200"></a>
-<span class="sourceLineNo">1201</span>     * @see #toByteArray()<a name="line.1201"></a>
-<span class="sourceLineNo">1202</span>     */<a name="line.1202"></a>
-<span class="sourceLineNo">1203</span>    private static ColumnFamilyDescriptor parseFrom(final byte[] bytes) throws DeserializationException {<a name="line.1203"></a>
-<span class="sourceLineNo">1204</span>      if (!ProtobufUtil.isPBMagicPrefix(bytes)) {<a name="line.1204"></a>
-<span class="sourceLineNo">1205</span>        throw new DeserializationException("No magic");<a name="line.1205"></a>
-<span class="sourceLineNo">1206</span>      }<a name="line.1206"></a>
-<span class="sourceLineNo">1207</span>      int pblen = ProtobufUtil.lengthOfPBMagic();<a name="line.1207"></a>
-<span class="sourceLineNo">1208</span>      ColumnFamilySchema.Builder builder = ColumnFamilySchema.newBuilder();<a name="line.1208"></a>
-<span class="sourceLineNo">1209</span>      ColumnFamilySchema cfs = null;<a name="line.1209"></a>
-<span class="sourceLineNo">1210</span>      try {<a name="line.1210"></a>
-<span class="sourceLineNo">1211</span>        ProtobufUtil.mergeFrom(builder, bytes, pblen, bytes.length - pblen);<a name="line.1211"></a>
-<span class="sourceLineNo">1212</span>        cfs = builder.build();<a name="line.1212"></a>
-<span class="sourceLineNo">1213</span>      } catch (IOException e) {<a name="line.1213"></a>
-<span class="sourceLineNo">1214</span>        throw new DeserializationException(e);<a name="line.1214"></a>
-<span class="sourceLineNo">1215</span>      }<a name="line.1215"></a>
-<span class="sourceLineNo">1216</span>      return ProtobufUtil.convertToColumnDesc(cfs);<a name="line.1216"></a>
-<span class="sourceLineNo">1217</span>    }<a name="line.1217"></a>
-<span class="sourceLineNo">1218</span><a name="line.1218"></a>
-<span class="sourceLineNo">1219</span>    @Override<a name="line.1219"></a>
-<span class="sourceLineNo">1220</span>    public String getConfigurationValue(String key) {<a name="line.1220"></a>
-<span class="sourceLineNo">1221</span>      return configuration.get(key);<a name="line.1221"></a>
-<span class="sourceLineNo">1222</span>    }<a name="line.1222"></a>
-<span class="sourceLineNo">1223</span><a name="line.1223"></a>
-<span class="sourceLineNo">1224</span>    @Override<a name="line.1224"></a>
-<span class="sourceLineNo">1225</span>    public Map&lt;String, String&gt; getConfiguration() {<a name="line.1225"></a>
-<span class="sourceLineNo">1226</span>      // shallow pointer copy<a name="line.1226"></a>
-<span class="sourceLineNo">1227</span>      return Collections.unmodifiableMap(configuration);<a name="line.1227"></a>
-<span class="sourceLineNo">1228</span>    }<a name="line.1228"></a>
-<span class="sourceLineNo">1229</span><a name="line.1229"></a>
-<span class="sourceLineNo">1230</span>    /**<a name="line.1230"></a>
-<span class="sourceLineNo">1231</span>     * Setter for storing a configuration setting in {@link #configuration} map.<a name="line.1231"></a>
-<span class="sourceLineNo">1232</span>     *<a name="line.1232"></a>
-<span class="sourceLineNo">1233</span>     * @param key Config key. Same as XML config key e.g.<a name="line.1233"></a>
-<span class="sourceLineNo">1234</span>     * hbase.something.or.other.<a name="line.1234"></a>
-<span class="sourceLineNo">1235</span>     * @param value String value. If null, removes the configuration.<a name="line.1235"></a>
-<span class="sourceLineNo">1236</span>     * @return this (for chained invocation)<a name="line.1236"></a>
-<span class="sourceLineNo">1237</span>     */<a name="line.1237"></a>
-<span class="sourceLineNo">1238</span>    public ModifyableColumnFamilyDescriptor setConfiguration(String key, String value) {<a name="line.1238"></a>
-<span class="sourceLineNo">1239</span>      if (value == null) {<a name="line.1239"></a>
-<span class="sourceLineNo">1240</span>        configuration.remove(key);<a name="line.1240"></a>
-<span class="sourceLineNo">1241</span>      } else {<a name="line.1241"></a>
-<span class="sourceLineNo">1242</span>        configuration.put(key, value);<a name="line.1242"></a>
-<span class="sourceLineNo">1243</span>      }<a name="line.1243"></a>
-<span class="sourceLineNo">1244</span>      return this;<a name="line.1244"></a>
-<span class="sourceLineNo">1245</span>    }<a name="line.1245"></a>
-<span class="sourceLineNo">1246</span><a name="line.1246"></a>
-<span class="sourceLineNo">1247</span>    /**<a name="line.1247"></a>
-<span class="sourceLineNo">1248</span>     * Remove a configuration setting represented by the key from the<a name="line.1248"></a>
-<span class="sourceLineNo">1249</span>     * {@link #configuration} map.<a name="line.1249"></a>
-<span class="sourceLineNo">1250</span>     *<a name="line.1250"></a>
-<span class="sourceLineNo">1251</span>     * @param key<a name="line.1251"></a>
-<span class="sourceLineNo">1252</span>     * @return this (for chained invocation)<a name="line.1252"></a>
-<span class="sourceLineNo">1253</span>     */<a name="line.1253"></a>
-<span class="sourceLineNo">1254</span>    public ModifyableColumnFamilyDescriptor removeConfiguration(final String key) {<a name="line.1254"></a>
-<span class="sourceLineNo">1255</span>      return setConfiguration(key, null);<a name="line.1255"></a>
-<span class="sourceLineNo">1256</span>    }<a name="line.1256"></a>
-<span class="sourceLineNo">1257</span><a name="line.1257"></a>
-<span class="sourceLineNo">1258</span>    @Override<a name="line.1258"></a>
-<span class="sourceLineNo">1259</span>    public String getEncryptionType() {<a name="line.1259"></a>
-<span class="sourceLineNo">1260</span>      return getStringOrDefault(ENCRYPTION_BYTES, Function.identity(), null);<a name="line.1260"></a>
-<span class="sourceLineNo">1261</span>    }<a name="line.1261"></a>
-<span class="sourceLineNo">1262</span><a name="line.1262"></a>
-<span class="sourceLineNo">1263</span>    /**<a name="line.1263"></a>
-<span class="sourceLineNo">1264</span>     * Set the encryption algorithm for use with this family<a name="line.1264"></a>
-<span class="sourceLineNo">1265</span>     *<a name="line.1265"></a>
-<span class="sourceLineNo">1266</span>     * @param algorithm<a name="line.1266"></a>
-<span class="sourceLineNo">1267</span>     * @return this (for chained invocation)<a name="line.1267"></a>
-<span class="sourceLineNo">1268</span>     */<a name="line.1268"></a>
-<span class="sourceLineNo">1269</span>    public ModifyableColumnFamilyDescriptor setEncryptionType(String algorithm) {<a name="line.1269"></a>
-<span class="sourceLineNo">1270</span>      return setValue(ENCRYPTION_BYTES, algorithm);<a name="line.1270"></a>
-<span class="sourceLineNo">1271</span>    }<a name="line.1271"></a>
-<span class="sourceLineNo">1272</span><a name="line.1272"></a>
-<span class="sourceLineNo">1273</span>    @Override<a name="line.1273"></a>
-<span class="sourceLineNo">1274</span>    public byte[] getEncryptionKey() {<a name="line.1274"></a>
-<span class="sourceLineNo">1275</span>      return getOrDefault(ENCRYPTION_KEY_BYTES, Bytes::copy, null);<a name="line.1275"></a>
-<span class="sourceLineNo">1276</span>    }<a name="line.1276"></a>
-<span class="sourceLineNo">1277</span><a name="line.1277"></a>
-<span class="sourceLineNo">1278</span>    /**<a name="line.1278"></a>
-<span class="sourceLineNo">1279</span>     * Set the raw crypto key attribute for the family<a name="line.1279"></a>
-<span class="sourceLineNo">1280</span>     *<a name="line.1280"></a>
-<span class="sourceLineNo">1281</span>     * @param keyBytes<a name="line.1281"></a>
-<span class="sourceLineNo">1282</span>     * @return this (for chained invocation)<a name="line.1282"></a>
-<span class="sourceLineNo">1283</span>     */<a name="line.1283"></a>
-<span class="sourceLineNo">1284</span>    public ModifyableColumnFamilyDescriptor setEncryptionKey(byte[] keyBytes) {<a name="line.1284"></a>
-<span class="sourceLineNo">1285</span>      return setValue(ENCRYPTION_KEY_BYTES, new Bytes(keyBytes));<a name="line.1285"></a>
-<span class="sourceLineNo">1286</span>    }<a name="line.1286"></a>
-<span class="sourceLineNo">1287</span><a name="line.1287"></a>
-<span class="sourceLineNo">1288</span>    @Override<a name="line.1288"></a>
-<span class="sourceLineNo">1289</span>    public long getMobThreshold() {<a name="line.1289"></a>
-<span class="sourceLineNo">1290</span>      return getStringOrDefault(MOB_THRESHOLD_BYTES, Long::valueOf, DEFAULT_MOB_THRESHOLD);<a name="line.1290"></a>
-<span class="sourceLineNo">1291</span>    }<a name="line.1291"></a>
-<span class="sourceLineNo">1292</span><a name="line.1292"></a>
-<span class="sourceLineNo">1293</span>    /**<a name="line.1293"></a>
-<span class="sourceLineNo">1294</span>     * Sets the mob threshold of the family.<a name="line.1294"></a>
-<span class="sourceLineNo">1295</span>     *<a name="line.1295"></a>
-<span class="sourceLineNo">1296</span>     * @param threshold The mob threshold.<a name="line.1296"></a>
-<span class="sourceLineNo">1297</span>     * @return this (for chained invocation)<a name="line.1297"></a>
-<span class="sourceLineNo">1298</span>     */<a name="line.1298"></a>
-<span class="sourceLineNo">1299</span>    public ModifyableColumnFamilyDescriptor setMobThreshold(long threshold) {<a name="line.1299"></a>
-<span class="sourceLineNo">1300</span>      return setValue(MOB_THRESHOLD_BYTES, String.valueOf(threshold));<a name="line.1300"></a>
-<span class="sourceLineNo">1301</span>    }<a name="line.1301"></a>
-<span class="sourceLineNo">1302</span><a name="line.1302"></a>
-<span class="sourceLineNo">1303</span>    @Override<a name="line.1303"></a>
-<span class="sourceLineNo">1304</span>    public boolean isMobEnabled() {<a name="line.1304"></a>
-<span class="sourceLineNo">1305</span>      return getStringOrDefault(IS_MOB_BYTES, Boolean::valueOf, DEFAULT_MOB);<a name="line.1305"></a>
-<span class="sourceLineNo">1306</span>    }<a name="line.1306"></a>
-<span class="sourceLineNo">1307</span><a name="line.1307"></a>
-<span class="sourceLineNo">1308</span>    /**<a name="line.1308"></a>
-<span class="sourceLineNo">1309</span>     * Enables the mob for the family.<a name="line.1309"></a>
-<span class="sourceLineNo">1310</span>     *<a name="line.1310"></a>
-<span class="sourceLineNo">1311</span>     * @param isMobEnabled Whether to enable the mob for the family.<a name="line.1311"></a>
-<span class="sourceLineNo">1312</span>     * @return this (for chained invocation)<a name="line.1312"></a>
-<span class="sourceLineNo">1313</span>     */<a name="line.1313"></a>
-<span class="sourceLineNo">1314</span>    public ModifyableColumnFamilyDescriptor setMobEnabled(boolean isMobEnabled) {<a name="line.1314"></a>
-<span class="sourceLineNo">1315</span>      return setValue(IS_MOB_BYTES, String.valueOf(isMobEnabled));<a name="line.1315"></a>
-<span class="sourceLineNo">1316</span>    }<a name="line.1316"></a>
-<span class="sourceLineNo">1317</span><a name="line.1317"></a>
-<span class="sourceLineNo">1318</span>    @Override<a name="line.1318"></a>
-<span class="sourceLineNo">1319</span>    public MobCompactPartitionPolicy getMobCompactPartitionPolicy() {<a name="line.1319"></a>
-<span class="sourceLineNo">1320</span>      return getStringOrDefault(MOB_COMPACT_PARTITION_POLICY_BYTES,<a name="line.1320"></a>
-<span class="sourceLineNo">1321</span>              MobCompactPartitionPolicy::valueOf, DEFAULT_MOB_COMPACT_PARTITION_POLICY);<a name="line.1321"></a>
-<span class="sourceLineNo">1322</span>    }<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>     * Set the mob compact partition policy for the family.<a name="line.1325"></a>
-<span class="sourceLineNo">1326</span>     *<a name="line.1326"></a>
-<span class="sourceLineNo">1327</span>     * @param policy policy type<a name="line.1327"></a>
-<span class="sourceLineNo">1328</span>     * @return this (for chained invocation)<a name="line.1328"></a>
-<span class="sourceLineNo">1329</span>     */<a name="line.1329"></a>
-<span class="sourceLineNo">1330</span>    public ModifyableColumnFamilyDescriptor setMobCompactPartitionPolicy(MobCompactPartitionPolicy policy) {<a name="line.1330"></a>
-<span class="sourceLineNo">1331</span>      return setValue(MOB_COMPACT_PARTITION_POLICY_BYTES, policy.name());<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>    @Override<a name="line.1334"></a>
-<span class="sourceLineNo">1335</span>    public short getDFSReplication() {<a name="line.1335"></a>
-<span class="sourceLineNo">1336</span>      return getStringOrDefault(DFS_REPLICATION_BYTES,<a name="line.1336"></a>
-<span class="sourceLineNo">1337</span>              Short::valueOf, DEFAULT_DFS_REPLICATION);<a name="line.1337"></a>
-<span class="sourceLineNo">1338</span>    }<a name="line.1338"></a>
-<span class="sourceLineNo">1339</span><a name="line.1339"></a>
-<span class="sourceLineNo">1340</span>    /**<a name="line.1340"></a>
-<span class="sourceLineNo">1341</span>     * Set the replication factor to hfile(s) belonging to this family<a name="line.1341"></a>
-<span class="sourceLineNo">1342</span>     *<a name="line.1342"></a>
-<span class="sourceLineNo">1343</span>     * @param replication number of replicas the blocks(s) belonging to this CF<a name="line.1343"></a>
-<span class="sourceLineNo">1344</span>     * should have, or {@link #DEFAULT_DFS_REPLICATION} for the default<a name="line.1344"></a>
-<span class="sourceLineNo">1345</span>     * replication factor set in the filesystem<a name="line.1345"></a>
-<span class="sourceLineNo">1346</span>     * @return this (for chained invocation)<a name="line.1346"></a>
-<span class="sourceLineNo">1347</span>     */<a name="line.1347"></a>
-<span class="sourceLineNo">1348</span>    public ModifyableColumnFamilyDescriptor setDFSReplication(short replication) {<a name="line.1348"></a>
-<span class="sourceLineNo">1349</span>      if (replication &lt; 1 &amp;&amp; replication != DEFAULT_DFS_REPLICATION) {<a name="line.1349"></a>
-<span class="sourceLineNo">1350</span>        throw new IllegalArgumentException(<a name="line.1350"></a>
-<span class="sourceLineNo">1351</span>                "DFS replication factor cannot be less than 1 if explicitly set.");<a name="line.1351"></a>
-<span class="sourceLineNo">1352</span>      }<a name="line.1352"></a>
-<span class="sourceLineNo">1353</span>      return setValue(DFS_REPLICATION_BYTES, Short.toString(replication));<a name="line.1353"></a>
-<span class="sourceLineNo">1354</span>    }<a name="line.1354"></a>
-<span class="sourceLineNo">1355</span><a name="line.1355"></a>
-<span class="sourceLineNo">1356</span>    @Override<a name="line.1356"></a>
-<span class="sourceLineNo">1357</span>    public String getStoragePolicy() {<a name="line.1357"></a>
-<span class="sourceLineNo">1358</span>      return getStringOrDefault(STORAGE_POLICY_BYTES, Function.identity(), null);<a name="line.1358"></a>
-<span class="sourceLineNo">1359</span>    }<a name="line.1359"></a>
-<span class="sourceLineNo">1360</span><a name="line.1360"></a>
-<span class="sourceLineNo">1361</span>    /**<a name="line.1361"></a>
-<span class="sourceLineNo">1362</span>     * Set the storage policy for use with this family<a name="line.1362"></a>
-<span class="sourceLineNo">1363</span>     *<a name="line.1363"></a>
-<span class="sourceLineNo">1364</span>     * @param policy the policy to set, valid setting includes:<a name="line.1364"></a>
-<span class="sourceLineNo">1365</span>     * &lt;i&gt;"LAZY_PERSIST"&lt;/i&gt;,<a name="line.1365"></a>
-<span class="sourceLineNo">1366</span>     * &lt;i&gt;"ALL_SSD"&lt;/i&gt;, &lt;i&gt;"ONE_SSD"&lt;/i&gt;, &lt;i&gt;"HOT"&lt;/i&gt;, &lt;i&gt;"WARM"&lt;/i&gt;,<a name="line.1366"></a>
-<span class="sourceLineNo">1367</span>     * &lt;i&gt;"COLD"&lt;/i&gt;<a name="line.1367"></a>
-<span class="sourceLineNo">1368</span>     * @return this (for chained invocation)<a name="line.1368"></a>
-<span class="sourceLineNo">1369</span>     */<a name="line.1369"></a>
-<span class="sourceLineNo">1370</span>    public ModifyableColumnFamilyDescriptor setStoragePolicy(String policy) {<a name="line.1370"></a>
-<span class="sourceLineNo">1371</span>      return setValue(STORAGE_POLICY_BYTES, policy);<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>  }<a name="line.1374"></a>
-<span class="sourceLineNo">1375</span>}<a name="line.1375"></a>
+<span class="sourceLineNo">1166</span>      return false;<a name="line.1166"></a>
+<span class="sourceLineNo">1167</span>    }<a name="line.1167"></a>
+<span class="sourceLineNo">1168</span><a name="line.1168"></a>
+<span class="sourceLineNo">1169</span>    @Override<a name="line.1169"></a>
+<span class="sourceLineNo">1170</span>    public int hashCode() {<a name="line.1170"></a>
+<span class="sourceLineNo">1171</span>      int result = Bytes.hashCode(name);<a name="line.1171"></a>
+<span class="sourceLineNo">1172</span>      result ^= (int) COLUMN_DESCRIPTOR_VERSION;<a name="line.1172"></a>
+<span class="sourceLineNo">1173</span>      result ^= values.hashCode();<a name="line.1173"></a>
+<span class="sourceLineNo">1174</span>      result ^= configuration.hashCode();<a name="line.1174"></a>
+<span class="sourceLineNo">1175</span>      return result;<a name="line.1175"></a>
+<span class="sourceLineNo">1176</span>    }<a name="line.1176"></a>
+<span class="sourceLineNo">1177</span><a name="line.1177"></a>
+<span class="sourceLineNo">1178</span>    @Override<a name="line.1178"></a>
+<span class="sourceLineNo">1179</span>    public int compareTo(ModifyableColumnFamilyDescriptor other) {<a name="line.1179"></a>
+<span class="sourceLineNo">1180</span>      return COMPARATOR.compare(this, other);<a name="line.1180"></a>
+<span class="sourceLineNo">1181</span>    }<a name="line.1181"></a>
+<span class="sourceLineNo">1182</span><a name="line.1182"></a>
+<span class="sourceLineNo">1183</span>    /**<a name="line.1183"></a>
+<span class="sourceLineNo">1184</span>     * @return This instance serialized with pb with pb magic prefix<a name="line.1184"></a>
+<span class="sourceLineNo">1185</span>     * @see #parseFrom(byte[])<a name="line.1185"></a>
+<span class="sourceLineNo">1186</span>     */<a name="line.1186"></a>
+<span class="sourceLineNo">1187</span>    private byte[] toByteArray() {<a name="line.1187"></a>
+<span class="sourceLineNo">1188</span>      return ProtobufUtil.prependPBMagic(ProtobufUtil.toColumnFamilySchema(this)<a name="line.1188"></a>
+<span class="sourceLineNo">1189</span>                      .toByteArray());<a name="line.1189"></a>
+<span class="sourceLineNo">1190</span>    }<a name="line.1190"></a>
+<span class="sourceLineNo">1191</span><a name="line.1191"></a>
+<span class="sourceLineNo">1192</span>    /**<a name="line.1192"></a>
+<span class="sourceLineNo">1193</span>     * @param bytes A pb serialized {@link ModifyableColumnFamilyDescriptor} instance with pb<a name="line.1193"></a>
+<span class="sourceLineNo">1194</span>     * magic prefix<a name="line.1194"></a>
+<span class="sourceLineNo">1195</span>     * @return An instance of {@link ModifyableColumnFamilyDescriptor} made from<a name="line.1195"></a>
+<span class="sourceLineNo">1196</span>     * &lt;code&gt;bytes&lt;/code&gt;<a name="line.1196"></a>
+<span class="sourceLineNo">1197</span>     * @throws DeserializationException<a name="line.1197"></a>
+<span class="sourceLineNo">1198</span>     * @see #toByteArray()<a name="line.1198"></a>
+<span class="sourceLineNo">1199</span>     */<a name="line.1199"></a>
+<span class="sourceLineNo">1200</span>    private static ColumnFamilyDescriptor parseFrom(final byte[] bytes) throws DeserializationException {<a name="line.1200"></a>
+<span class="sourceLineNo">1201</span>      if (!ProtobufUtil.isPBMagicPrefix(bytes)) {<a name="line.1201"></a>
+<span class="sourceLineNo">1202</span>        throw new DeserializationException("No magic");<a name="line.1202"></a>
+<span class="sourceLineNo">1203</span>      }<a name="line.1203"></a>
+<span class="sourceLineNo">1204</span>      int pblen = ProtobufUtil.lengthOfPBMagic();<a name="line.1204"></a>
+<span class="sourceLineNo">1205</span>      ColumnFamilySchema.Builder builder = ColumnFamilySchema.newBuilder();<a name="line.1205"></a>
+<span class="sourceLineNo">1206</span>      ColumnFamilySchema cfs = null;<a name="line.1206"></a>
+<span class="sourceLineNo">1207</span>      try {<a name="line.1207"></a>
+<span class="sourceLineNo">1208</span>        ProtobufUtil.mergeFrom(builder, bytes, pblen, bytes.length - pblen);<a name="line.1208"></a>
+<span class="sourceLineNo">1209</span>        cfs = builder.build();<a name="line.1209"></a>
+<span class="sourceLineNo">1210</span>      } catch (IOException e) {<a name="line.1210"></a>
+<span class="sourceLineNo">1211</span>        throw new DeserializationException(e);<a name="line.1211"></a>
+<span class="sourceLineNo">1212</span>      }<a name="line.1212"></a>
+<span class="sourceLineNo">1213</span>      return ProtobufUtil.toColumnFamilyDescriptor(cfs);<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>    @Override<a name="line.1216"></a>
+<span class="sourceLineNo">1217</span>    public String getConfigurationValue(String key) {<a name="line.1217"></a>
+<span class="sourceLineNo">1218</span>      return configuration.get(key);<a name="line.1218"></a>
+<span class="sourceLineNo">1219</span>    }<a name="line.1219"></a>
+<span class="sourceLineNo">1220</span><a name="line.1220"></a>
+<span class="sourceLineNo">1221</span>    @Override<a name="line.1221"></a>
+<span class="sourceLineNo">1222</span>    public Map&lt;String, String&gt; getConfiguration() {<a name="line.1222"></a>
+<span class="sourceLineNo">1223</span>      // shallow pointer copy<a name="line.1223"></a>
+<span class="sourceLineNo">1224</span>      return Collections.unmodifiableMap(configuration);<a name="line.1224"></a>
+<span class="sourceLineNo">1225</span>    }<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>     * Setter for storing a configuration setting in {@link #configuration} map.<a name="line.1228"></a>
+<span class="sourceLineNo">1229</span>     *<a name="line.1229"></a>
+<span class="sourceLineNo">1230</span>     * @param key Config key. Same as XML config key e.g.<a name="line.1230"></a>
+<span class="sourceLineNo">1231</span>     * hbase.something.or.other.<a name="line.1231"></a>
+<span class="sourceLineNo">1232</span>     * @param value String value. If null, removes the configuration.<a name="line.1232"></a>
+<span class="sourceLineNo">1233</span>     * @return this (for chained invocation)<a name="line.1233"></a>
+<span class="sourceLineNo">1234</span>     */<a name="line.1234"></a>
+<span class="sourceLineNo">1235</span>    public ModifyableColumnFamilyDescriptor setConfiguration(String key, String value) {<a name="line.1235"></a>
+<span class="sourceLineNo">1236</span>      if (value == null) {<a name="line.1236"></a>
+<span class="sourceLineNo">1237</span>        configuration.remove(key);<a name="line.1237"></a>
+<span class="sourceLineNo">1238</span>      } else {<a name="line.1238"></a>
+<span class="sourceLineNo">1239</span>        configuration.put(key, value);<a name="line.1239"></a>
+<span class="sourceLineNo">1240</span>      }<a name="line.1240"></a>
+<span class="sourceLineNo">1241</span>      return this;<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>    /**<a name="line.1244"></a>
+<span class="sourceLineNo">1245</span>     * Remove a configuration setting represented by the key from the<a name="line.1245"></a>
+<span class="sourceLineNo">1246</span>     * {@link #configuration} map.<a name="line.1246"></a>
+<span class="sourceLineNo">1247</span>     *<a name="line.1247"></a>
+<span class="sourceLineNo">1248</span>     * @param key<a name="line.1248"></a>
+<span class="sourceLineNo">1249</span>     * @return this (for chained invocation)<a name="line.1249"></a>
+<span class="sourceLineNo">1250</span>     */<a name="line.1250"></a>
+<span class="sourceLineNo">1251</span>    public ModifyableColumnFamilyDescriptor removeConfiguration(final String key) {<a name="line.1251"></a>
+<span class="sourceLineNo">1252</span>      return setConfiguration(key, null);<a name="line.1252"></a>
+<span class="sourceLineNo">1253</span>    }<a name="line.1253"></a>
+<span class="sourceLineNo">1254</span><a name="line.1254"></a>
+<span class="sourceLineNo">1255</span>    @Override<a name="line.1255"></a>
+<span class="sourceLineNo">1256</span>    public String getEncryptionType() {<a name="line.1256"></a>
+<span class="sourceLineNo">1257</span>      return getStringOrDefault(ENCRYPTION_BYTES, Function.identity(), null);<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>     * Set the encryption algorithm for use with this family<a name="line.1261"></a>
+<span class="sourceLineNo">1262</span>     *<a name="line.1262"></a>
+<span class="sourceLineNo">1263</span>     * @param algorithm<a name="line.1263"></a>
+<span class="sourceLineNo">1264</span>     * @return this (for chained invocation)<a name="line.1264"></a>
+<span class="sourceLineNo">1265</span>     */<a name="line.1265"></a>
+<span class="sourceLineNo">1266</span>    public ModifyableColumnFamilyDescriptor setEncryptionType(String algorithm) {<a name="line.1266"></a>
+<span class="sourceLineNo">1267</span>      return setValue(ENCRYPTION_BYTES, algorithm);<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>    @Override<a name="line.1270"></a>
+<span class="sourceLineNo">1271</span>    public byte[] getEncryptionKey() {<a name="line.1271"></a>
+<span class="sourceLineNo">1272</span>      return getOrDefault(ENCRYPTION_KEY_BYTES, Bytes::copy, null);<a name="line.1272"></a>
+<span class="sourceLineNo">1273</span>    }<a name="line.1273"></a>
+<span class="sourceLineNo">1274</span><a name="line.1274"></a>
+<span class="sourceLineNo">1275</span>    /**<a name="line.1275"></a>
+<span class="sourceLineNo">1276</span>     * Set the raw crypto key attribute for the family<a name="line.1276"></a>
+<span class="sourceLineNo">1277</span>     *<a name="line.1277"></a>
+<span class="sourceLineNo">1278</span>     * @param keyBytes<a name="line.1278"></a>
+<span class="sourceLineNo">1279</span>     * @return this (for chained invocation)<a name="line.1279"></a>
+<span class="sourceLineNo">1280</span>     */<a name="line.1280"></a>
+<span class="sourceLineNo">1281</span>    public ModifyableColumnFamilyDescriptor setEncryptionKey(byte[] keyBytes) {<a name="line.1281"></a>
+<span class="sourceLineNo">1282</span>      return setValue(ENCRYPTION_KEY_BYTES, new Bytes(keyBytes));<a name="line.1282"></a>
+<span class="sourceLineNo">1283</span>    }<a name="line.1283"></a>
+<span class="sourceLineNo">1284</span><a name="line.1284"></a>
+<span class="sourceLineNo">1285</span>    @Override<a name="line.1285"></a>
+<span class="sourceLineNo">1286</span>    public long getMobThreshold() {<a name="line.1286"></a>
+<span class="sourceLineNo">1287</span>      return getStringOrDefault(MOB_THRESHOLD_BYTES, Long::valueOf, DEFAULT_MOB_THRESHOLD);<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>    /**<a name="line.1290"></a>
+<span class="sourceLineNo">1291</span>     * Sets the mob threshold of the family.<a name="line.1291"></a>
+<span class="sourceLineNo">1292</span>     *<a name="line.1292"></a>
+<span class="sourceLineNo">1293</span>     * @param threshold The mob threshold.<a name="line.1293"></a>
+<span class="sourceLineNo">1294</span>     * @return this (for chained invocation)<a name="line.1294"></a>
+<span class="sourceLineNo">1295</span>     */<a name="line.1295"></a>
+<span class="sourceLineNo">1296</span>    public ModifyableColumnFamilyDescriptor setMobThreshold(long threshold) {<a name="line.1296"></a>
+<span class="sourceLineNo">1297</span>      return setValue(MOB_THRESHOLD_BYTES, String.valueOf(threshold));<a name="line.1297"></a>
+<span class="sourceLineNo">1298</span>    }<a name="line.1298"></a>
+<span class="sourceLineNo">1299</span><a name="line.1299"></a>
+<span class="sourceLineNo">1300</span>    @Override<a name="line.1300"></a>
+<span class="sourceLineNo">1301</span>    public boolean isMobEnabled() {<a name="line.1301"></a>
+<span class="sourceLineNo">1302</span>      return getStringOrDefault(IS_MOB_BYTES, Boolean::valueOf, DEFAULT_MOB);<a name="line.1302"></a>
+<span class="sourceLineNo">1303</span>    }<a name="line.1303"></a>
+<span class="sourceLineNo">1304</span><a name="line.1304"></a>
+<span class="sourceLineNo">1305</span>    /**<a name="line.1305"></a>
+<span class="sourceLineNo">1306</span>     * Enables the mob for the family.<a name="line.1306"></a>
+<span class="sourceLineNo">1307</span>     *<a name="line.1307"></a>
+<span class="sourceLineNo">1308</span>     * @param isMobEnabled Whether to enable the mob for the family.<a name="line.1308"></a>
+<span class="sourceLineNo">1309</span>     * @return this (for chained invocation)<a name="line.1309"></a>
+<span class="sourceLineNo">1310</span>     */<a name="line.1310"></a>
+<span class="sourceLineNo">1311</span>    public ModifyableColumnFamilyDescriptor setMobEnabled(boolean isMobEnabled) {<a name="line.1311"></a>
+<span class="sourceLineNo">1312</span>      return setValue(IS_MOB_BYTES, String.valueOf(isMobEnabled));<a name="line.1312"></a>
+<span class="sourceLineNo">1313</span>    }<a name="line.1313"></a>
+<span class="sourceLineNo">1314</span><a name="line.1314"></a>
+<span class="sourceLineNo">1315</span>    @Override<a name="line.1315"></a>
+<span class="sourceLineNo">1316</span>    public MobCompactPartitionPolicy getMobCompactPartitionPolicy() {<a name="line.1316"></a>
+<span class="sourceLineNo">1317</span>      return getStringOrDefault(MOB_COMPACT_PARTITION_POLICY_BYTES,<a name="line.1317"></a>
+<span class="sourceLineNo">1318</span>              MobCompactPartitionPolicy::valueOf, DEFAULT_MOB_COMPACT_PARTITION_POLICY);<a name="line.1318"></a>
+<span class="sourceLineNo">1319</span>    }<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>     * Set the mob compact partition policy for the family.<a name="line.1322"></a>
+<span class="sourceLineNo">1323</span>     *<a name="line.1323"></a>
+<span class="sourceLineNo">1324</span>     * @param policy policy type<a name="line.1324"></a>
+<span class="sourceLineNo">1325</span>     * @return this (for chained invocation)<a name="line.1325"></a>
+<span class="sourceLineNo">1326</span>     */<a name="line.1326"></a>
+<span class="sourceLineNo">1327</span>    public ModifyableColumnFamilyDescriptor setMobCompactPartitionPolicy(MobCompactPartitionPolicy policy) {<a name="line.1327"></a>
+<span class="sourceLineNo">1328</span>      return setValue(MOB_COMPACT_PARTITION_POLICY_BYTES, policy.name());<a name="line.1328"></a>
+<span class="sourceLineNo">1329</span>    }<a name="line.1329"></a>
+<span class="sourceLineNo">1330</span><a name="line.1330"></a>
+<span class="sourceLineNo">1331</span>    @Override<a name="line.1331"></a>
+<span class="sourceLineNo">1332</span>    public short getDFSReplication() {<a name="line.1332"></a>
+<span class="sourceLineNo">1333</span>      return getStringOrDefault(DFS_REPLICATION_BYTES,<a name="line.1333"></a>
+<span class="sourceLineNo">1334</span>              Short::valueOf, DEFAULT_DFS_REPLICATION);<a name="line.1334"></a>
+<span class="sourceLineNo">1335</span>    }<a name="line.1335"></a>
+<span class="sourceLineNo">1336</span><a name="line.1336"></a>
+<span class="sourceLineNo">1337</span>    /**<a name="line.1337"></a>
+<span class="sourceLineNo">1338</span>     * Set the replication factor to hfile(s) belonging to this family<a name="line.1338"></a>
+<span class="sourceLineNo">1339</span>     *<a name="line.1339"></a>
+<span class="sourceLineNo">1340</span>     * @param replication number of replicas the blocks(s) belonging to this CF<a name="line.1340"></a>
+<span class="sourceLineNo">1341</span>     * should have, or {@link #DEFAULT_DFS_REPLICATION} for the default<a name="line.1341"></a>
+<span class="sourceLineNo">1342</span>     * replication factor set in the filesystem<a name="line.1342"></a>
+<span class="sourceLineNo">1343</span>     * @return this (for chained invocation)<a name="line.1343"></a>
+<span class="sourceLineNo">1344</span>     */<a name="line.1344"></a>
+<span class="sourceLineNo">1345</span>    public ModifyableColumnFamilyDescriptor setDFSReplication(short replication) {<a name="line.1345"></a>
+<span class="sourceLineNo">1346</span>      if (replication &lt; 1 &amp;&amp; replication != DEFAULT_DFS_REPLICATION) {<a name="line.1346"></a>
+<span class="sourceLineNo">1347</span>        throw new IllegalArgumentException(<a name="line.1347"></a>
+<span class="sourceLineNo">1348</span>                "DFS replication factor cannot be less than 1 if explicitly set.");<a name="line.1348"></a>
+<span class="sourceLineNo">1349</span>      }<a name="line.1349"></a>
+<span class="sourceLineNo">1350</span>      return setValue(DFS_REPLICATION_BYTES, Short.toString(replication));<a name="line.1350"></a>
+<span class="sourceLineNo">1351</span>    }<a name="line.1351"></a>
+<span class="sourceLineNo">1352</span><a name="line.1352"></a>
+<span class="sourceLineNo">1353</span>    @Override<a name="line.1353"></a>
+<span class="sourceLineNo">1354</span>    public String getStoragePolicy() {<a name="line.1354"></a>
+<span class="sourceLineNo">1355</span>      return getStringOrDefault(STORAGE_POLICY_BYTES, Function.identity(), null);<a name="line.1355"></a>
+<span class="sourceLineNo">1356</span>    }<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>     * Set the storage policy for use with this family<a name="line.1359"></a>
+<span class="sourceLineNo">1360</span>     *<a name="line.1360"></a>
+<span class="sourceLineNo">1361</span>     * @param policy the policy to set, valid setting includes:<a name="line.1361"></a>
+<span class="sourceLineNo">1362</span>     * &lt;i&gt;"LAZY_PERSIST"&lt;/i&gt;,<a name="line.1362"></a>
+<span class="sourceLineNo">1363</span>     * &lt;i&gt;"ALL_SSD"&lt;/i&gt;, &lt;i&gt;"ONE_SSD"&lt;/i&gt;, &lt;i&gt;"HOT"&lt;/i&gt;, &lt;i&gt;"WARM"&lt;/i&gt;,<a name="line.1363"></a>
+<span class="sourceLineNo">1364</span>     * &lt;i&gt;"COLD"&lt;/i&gt;<a name="line.1364"></a>
+<span class="sourceLineNo">1365</span>     * @return this (for chained invocation)<a name="line.1365"></a>
+<span class="sourceLineNo">1366</span>     */<a name="line.1366"></a>
+<span class="sourceLineNo">1367</span>    public ModifyableColumnFamilyDescriptor setStoragePolicy(String policy) {<a name="line.1367"></a>
+<span class="sourceLineNo">1368</span>      return setValue(STORAGE_POLICY_BYTES, policy);<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>  }<a name="line.1371"></a>
+<span class="sourceLineNo">1372</span>}<a name="line.1372"></a>
 
 
 


Mime
View raw message