http://git-wip-us.apache.org/repos/asf/hbase-site/blob/21726f5a/apidocs/src-html/org/apache/hadoop/hbase/filter/Filter.ReturnCode.html ---------------------------------------------------------------------- diff --git a/apidocs/src-html/org/apache/hadoop/hbase/filter/Filter.ReturnCode.html b/apidocs/src-html/org/apache/hadoop/hbase/filter/Filter.ReturnCode.html index 2356cfb..35d409c 100644 --- a/apidocs/src-html/org/apache/hadoop/hbase/filter/Filter.ReturnCode.html +++ b/apidocs/src-html/org/apache/hadoop/hbase/filter/Filter.ReturnCode.html @@ -180,128 +180,132 @@ <span class="sourceLineNo">172</span> */<a name="line.172"></a> <span class="sourceLineNo">173</span> NEXT_COL,<a name="line.173"></a> <span class="sourceLineNo">174</span> /**<a name="line.174"></a> -<span class="sourceLineNo">175</span> * Done with columns, skip to next row. Note that filterRow() will<a name="line.175"></a> -<span class="sourceLineNo">176</span> * still be called.<a name="line.176"></a> -<span class="sourceLineNo">177</span> */<a name="line.177"></a> -<span class="sourceLineNo">178</span> NEXT_ROW,<a name="line.178"></a> -<span class="sourceLineNo">179</span> /**<a name="line.179"></a> -<span class="sourceLineNo">180</span> * Seek to next key which is given as hint by the filter.<a name="line.180"></a> +<span class="sourceLineNo">175</span> * Seek to next row in current family. It may still pass a cell whose family is different but<a name="line.175"></a> +<span class="sourceLineNo">176</span> * row is the same as previous cell to {@link #filterKeyValue(Cell)} , even if we get a NEXT_ROW<a name="line.176"></a> +<span class="sourceLineNo">177</span> * returned for previous cell. For more details see HBASE-18368. <br><a name="line.177"></a> +<span class="sourceLineNo">178</span> * Once reset() method was invoked, then we switch to the next row for all family, and you can<a name="line.178"></a> +<span class="sourceLineNo">179</span> * catch the event by invoking CellUtils.matchingRows(previousCell, currentCell). <br><a name="line.179"></a> +<span class="sourceLineNo">180</span> * Note that filterRow() will still be called. <br><a name="line.180"></a> <span class="sourceLineNo">181</span> */<a name="line.181"></a> -<span class="sourceLineNo">182</span> SEEK_NEXT_USING_HINT,<a name="line.182"></a> +<span class="sourceLineNo">182</span> NEXT_ROW,<a name="line.182"></a> <span class="sourceLineNo">183</span> /**<a name="line.183"></a> -<span class="sourceLineNo">184</span> * Include KeyValue and done with row, seek to next.<a name="line.184"></a> +<span class="sourceLineNo">184</span> * Seek to next key which is given as hint by the filter.<a name="line.184"></a> <span class="sourceLineNo">185</span> */<a name="line.185"></a> -<span class="sourceLineNo">186</span> INCLUDE_AND_SEEK_NEXT_ROW,<a name="line.186"></a> -<span class="sourceLineNo">187</span>}<a name="line.187"></a> -<span class="sourceLineNo">188</span><a name="line.188"></a> -<span class="sourceLineNo">189</span> /**<a name="line.189"></a> -<span class="sourceLineNo">190</span> * Chance to alter the list of Cells to be submitted. Modifications to the list will carry on<a name="line.190"></a> -<span class="sourceLineNo">191</span> * <a name="line.191"></a> -<span class="sourceLineNo">192</span> * Concrete implementers can signal a failure condition in their code by throwing an<a name="line.192"></a> -<span class="sourceLineNo">193</span> * {@link IOException}.<a name="line.193"></a> -<span class="sourceLineNo">194</span> * <a name="line.194"></a> -<span class="sourceLineNo">195</span> * @param kvs the list of Cells to be filtered<a name="line.195"></a> -<span class="sourceLineNo">196</span> * @throws IOException in case an I/O or an filter specific failure needs to be signaled.<a name="line.196"></a> -<span class="sourceLineNo">197</span> */<a name="line.197"></a> -<span class="sourceLineNo">198</span> abstract public void filterRowCells(List<Cell> kvs) throws IOException;<a name="line.198"></a> -<span class="sourceLineNo">199</span><a name="line.199"></a> -<span class="sourceLineNo">200</span> /**<a name="line.200"></a> -<span class="sourceLineNo">201</span> * Primarily used to check for conflicts with scans(such as scans that do not read a full row at a<a name="line.201"></a> -<span class="sourceLineNo">202</span> * time).<a name="line.202"></a> -<span class="sourceLineNo">203</span> * <a name="line.203"></a> -<span class="sourceLineNo">204</span> * @return True if this filter actively uses filterRowCells(List) or filterRow().<a name="line.204"></a> -<span class="sourceLineNo">205</span> */<a name="line.205"></a> -<span class="sourceLineNo">206</span> abstract public boolean hasFilterRow();<a name="line.206"></a> -<span class="sourceLineNo">207</span><a name="line.207"></a> -<span class="sourceLineNo">208</span> /**<a name="line.208"></a> -<span class="sourceLineNo">209</span> * Last chance to veto row based on previous {@link #filterKeyValue(Cell)} calls. The filter<a name="line.209"></a> -<span class="sourceLineNo">210</span> * needs to retain state then return a particular value for this call if they wish to exclude a<a name="line.210"></a> -<span class="sourceLineNo">211</span> * row if a certain column is missing (for example).<a name="line.211"></a> -<span class="sourceLineNo">212</span> * <a name="line.212"></a> -<span class="sourceLineNo">213</span> * Concrete implementers can signal a failure condition in their code by throwing an<a name="line.213"></a> -<span class="sourceLineNo">214</span> * {@link IOException}.<a name="line.214"></a> -<span class="sourceLineNo">215</span> * <a name="line.215"></a> -<span class="sourceLineNo">216</span> * @return true to exclude row, false to include row.<a name="line.216"></a> -<span class="sourceLineNo">217</span> * @throws IOException in case an I/O or an filter specific failure needs to be signaled.<a name="line.217"></a> -<span class="sourceLineNo">218</span> */<a name="line.218"></a> -<span class="sourceLineNo">219</span> abstract public boolean filterRow() throws IOException;<a name="line.219"></a> -<span class="sourceLineNo">220</span><a name="line.220"></a> -<span class="sourceLineNo">221</span> /**<a name="line.221"></a> -<span class="sourceLineNo">222</span> * If the filter returns the match code SEEK_NEXT_USING_HINT, then it should also tell which is<a name="line.222"></a> -<span class="sourceLineNo">223</span> * the next key it must seek to. After receiving the match code SEEK_NEXT_USING_HINT, the<a name="line.223"></a> -<span class="sourceLineNo">224</span> * QueryMatcher would call this function to find out which key it must next seek to.<a name="line.224"></a> -<span class="sourceLineNo">225</span> * <a name="line.225"></a> -<span class="sourceLineNo">226</span> * Concrete implementers can signal a failure condition in their code by throwing an<a name="line.226"></a> -<span class="sourceLineNo">227</span> * {@link IOException}.<a name="line.227"></a> -<span class="sourceLineNo">228</span> * <a name="line.228"></a> -<span class="sourceLineNo">229</span> * @return KeyValue which must be next seeked. return null if the filter is not sure which key to<a name="line.229"></a> -<span class="sourceLineNo">230</span> * seek to next.<a name="line.230"></a> -<span class="sourceLineNo">231</span> * @throws IOException in case an I/O or an filter specific failure needs to be signaled.<a name="line.231"></a> -<span class="sourceLineNo">232</span> */<a name="line.232"></a> -<span class="sourceLineNo">233</span> abstract public Cell getNextCellHint(final Cell currentCell) throws IOException;<a name="line.233"></a> -<span class="sourceLineNo">234</span><a name="line.234"></a> -<span class="sourceLineNo">235</span> /**<a name="line.235"></a> -<span class="sourceLineNo">236</span> * Check that given column family is essential for filter to check row. Most filters always return<a name="line.236"></a> -<span class="sourceLineNo">237</span> * true here. But some could have more sophisticated logic which could significantly reduce<a name="line.237"></a> -<span class="sourceLineNo">238</span> * scanning process by not even touching columns until we are 100% sure that it's data is needed<a name="line.238"></a> -<span class="sourceLineNo">239</span> * in result.<a name="line.239"></a> -<span class="sourceLineNo">240</span> * <a name="line.240"></a> -<span class="sourceLineNo">241</span> * Concrete implementers can signal a failure condition in their code by throwing an<a name="line.241"></a> -<span class="sourceLineNo">242</span> * {@link IOException}.<a name="line.242"></a> -<span class="sourceLineNo">243</span> * <a name="line.243"></a> -<span class="sourceLineNo">244</span> * @throws IOException in case an I/O or an filter specific failure needs to be signaled.<a name="line.244"></a> -<span class="sourceLineNo">245</span> */<a name="line.245"></a> -<span class="sourceLineNo">246</span> abstract public boolean isFamilyEssential(byte[] name) throws IOException;<a name="line.246"></a> -<span class="sourceLineNo">247</span><a name="line.247"></a> -<span class="sourceLineNo">248</span> /**<a name="line.248"></a> -<span class="sourceLineNo">249</span> * TODO: JAVADOC<a name="line.249"></a> -<span class="sourceLineNo">250</span> * <a name="line.250"></a> -<span class="sourceLineNo">251</span> * Concrete implementers can signal a failure condition in their code by throwing an<a name="line.251"></a> -<span class="sourceLineNo">252</span> * {@link IOException}.<a name="line.252"></a> -<span class="sourceLineNo">253</span> * <a name="line.253"></a> -<span class="sourceLineNo">254</span> * @return The filter serialized using pb<a name="line.254"></a> -<span class="sourceLineNo">255</span> * @throws IOException in case an I/O or an filter specific failure needs to be signaled.<a name="line.255"></a> -<span class="sourceLineNo">256</span> */<a name="line.256"></a> -<span class="sourceLineNo">257</span> abstract public byte[] toByteArray() throws IOException;<a name="line.257"></a> -<span class="sourceLineNo">258</span><a name="line.258"></a> -<span class="sourceLineNo">259</span> /**<a name="line.259"></a> -<span class="sourceLineNo">260</span> * <a name="line.260"></a> -<span class="sourceLineNo">261</span> * Concrete implementers can signal a failure condition in their code by throwing an<a name="line.261"></a> -<span class="sourceLineNo">262</span> * {@link IOException}.<a name="line.262"></a> -<span class="sourceLineNo">263</span> * <a name="line.263"></a> -<span class="sourceLineNo">264</span> * @param pbBytes A pb serialized {@link Filter} instance<a name="line.264"></a> -<span class="sourceLineNo">265</span> * @return An instance of {@link Filter} made from <code>bytes</code><a name="line.265"></a> -<span class="sourceLineNo">266</span> * @throws DeserializationException<a name="line.266"></a> -<span class="sourceLineNo">267</span> * @see #toByteArray<a name="line.267"></a> -<span class="sourceLineNo">268</span> */<a name="line.268"></a> -<span class="sourceLineNo">269</span> public static Filter parseFrom(final byte [] pbBytes) throws DeserializationException {<a name="line.269"></a> -<span class="sourceLineNo">270</span> throw new DeserializationException(<a name="line.270"></a> -<span class="sourceLineNo">271</span> "parseFrom called on base Filter, but should be called on derived type");<a name="line.271"></a> -<span class="sourceLineNo">272</span> }<a name="line.272"></a> -<span class="sourceLineNo">273</span><a name="line.273"></a> -<span class="sourceLineNo">274</span> /**<a name="line.274"></a> -<span class="sourceLineNo">275</span> * Concrete implementers can signal a failure condition in their code by throwing an<a name="line.275"></a> -<span class="sourceLineNo">276</span> * {@link IOException}.<a name="line.276"></a> -<span class="sourceLineNo">277</span> * <a name="line.277"></a> -<span class="sourceLineNo">278</span> * @param other<a name="line.278"></a> -<span class="sourceLineNo">279</span> * @return true if and only if the fields of the filter that are serialized are equal to the<a name="line.279"></a> -<span class="sourceLineNo">280</span> * corresponding fields in other. Used for testing.<a name="line.280"></a> -<span class="sourceLineNo">281</span> * @throws IOException in case an I/O or an filter specific failure needs to be signaled.<a name="line.281"></a> -<span class="sourceLineNo">282</span> */<a name="line.282"></a> -<span class="sourceLineNo">283</span> abstract boolean areSerializedFieldsEqual(Filter other);<a name="line.283"></a> -<span class="sourceLineNo">284</span><a name="line.284"></a> -<span class="sourceLineNo">285</span> /**<a name="line.285"></a> -<span class="sourceLineNo">286</span> * alter the reversed scan flag<a name="line.286"></a> -<span class="sourceLineNo">287</span> * @param reversed flag<a name="line.287"></a> -<span class="sourceLineNo">288</span> */<a name="line.288"></a> -<span class="sourceLineNo">289</span> public void setReversed(boolean reversed) {<a name="line.289"></a> -<span class="sourceLineNo">290</span> this.reversed = reversed;<a name="line.290"></a> -<span class="sourceLineNo">291</span> }<a name="line.291"></a> -<span class="sourceLineNo">292</span><a name="line.292"></a> -<span class="sourceLineNo">293</span> public boolean isReversed() {<a name="line.293"></a> -<span class="sourceLineNo">294</span> return this.reversed;<a name="line.294"></a> +<span class="sourceLineNo">186</span> SEEK_NEXT_USING_HINT,<a name="line.186"></a> +<span class="sourceLineNo">187</span> /**<a name="line.187"></a> +<span class="sourceLineNo">188</span> * Include KeyValue and done with row, seek to next. See NEXT_ROW.<a name="line.188"></a> +<span class="sourceLineNo">189</span> */<a name="line.189"></a> +<span class="sourceLineNo">190</span> INCLUDE_AND_SEEK_NEXT_ROW,<a name="line.190"></a> +<span class="sourceLineNo">191</span>}<a name="line.191"></a> +<span class="sourceLineNo">192</span><a name="line.192"></a> +<span class="sourceLineNo">193</span> /**<a name="line.193"></a> +<span class="sourceLineNo">194</span> * Chance to alter the list of Cells to be submitted. Modifications to the list will carry on<a name="line.194"></a> +<span class="sourceLineNo">195</span> * <a name="line.195"></a> +<span class="sourceLineNo">196</span> * Concrete implementers can signal a failure condition in their code by throwing an<a name="line.196"></a> +<span class="sourceLineNo">197</span> * {@link IOException}.<a name="line.197"></a> +<span class="sourceLineNo">198</span> * <a name="line.198"></a> +<span class="sourceLineNo">199</span> * @param kvs the list of Cells to be filtered<a name="line.199"></a> +<span class="sourceLineNo">200</span> * @throws IOException in case an I/O or an filter specific failure needs to be signaled.<a name="line.200"></a> +<span class="sourceLineNo">201</span> */<a name="line.201"></a> +<span class="sourceLineNo">202</span> abstract public void filterRowCells(List<Cell> kvs) throws IOException;<a name="line.202"></a> +<span class="sourceLineNo">203</span><a name="line.203"></a> +<span class="sourceLineNo">204</span> /**<a name="line.204"></a> +<span class="sourceLineNo">205</span> * Primarily used to check for conflicts with scans(such as scans that do not read a full row at a<a name="line.205"></a> +<span class="sourceLineNo">206</span> * time).<a name="line.206"></a> +<span class="sourceLineNo">207</span> * <a name="line.207"></a> +<span class="sourceLineNo">208</span> * @return True if this filter actively uses filterRowCells(List) or filterRow().<a name="line.208"></a> +<span class="sourceLineNo">209</span> */<a name="line.209"></a> +<span class="sourceLineNo">210</span> abstract public boolean hasFilterRow();<a name="line.210"></a> +<span class="sourceLineNo">211</span><a name="line.211"></a> +<span class="sourceLineNo">212</span> /**<a name="line.212"></a> +<span class="sourceLineNo">213</span> * Last chance to veto row based on previous {@link #filterKeyValue(Cell)} calls. The filter<a name="line.213"></a> +<span class="sourceLineNo">214</span> * needs to retain state then return a particular value for this call if they wish to exclude a<a name="line.214"></a> +<span class="sourceLineNo">215</span> * row if a certain column is missing (for example).<a name="line.215"></a> +<span class="sourceLineNo">216</span> * <a name="line.216"></a> +<span class="sourceLineNo">217</span> * Concrete implementers can signal a failure condition in their code by throwing an<a name="line.217"></a> +<span class="sourceLineNo">218</span> * {@link IOException}.<a name="line.218"></a> +<span class="sourceLineNo">219</span> * <a name="line.219"></a> +<span class="sourceLineNo">220</span> * @return true to exclude row, false to include row.<a name="line.220"></a> +<span class="sourceLineNo">221</span> * @throws IOException in case an I/O or an filter specific failure needs to be signaled.<a name="line.221"></a> +<span class="sourceLineNo">222</span> */<a name="line.222"></a> +<span class="sourceLineNo">223</span> abstract public boolean filterRow() throws IOException;<a name="line.223"></a> +<span class="sourceLineNo">224</span><a name="line.224"></a> +<span class="sourceLineNo">225</span> /**<a name="line.225"></a> +<span class="sourceLineNo">226</span> * If the filter returns the match code SEEK_NEXT_USING_HINT, then it should also tell which is<a name="line.226"></a> +<span class="sourceLineNo">227</span> * the next key it must seek to. After receiving the match code SEEK_NEXT_USING_HINT, the<a name="line.227"></a> +<span class="sourceLineNo">228</span> * QueryMatcher would call this function to find out which key it must next seek to.<a name="line.228"></a> +<span class="sourceLineNo">229</span> * <a name="line.229"></a> +<span class="sourceLineNo">230</span> * Concrete implementers can signal a failure condition in their code by throwing an<a name="line.230"></a> +<span class="sourceLineNo">231</span> * {@link IOException}.<a name="line.231"></a> +<span class="sourceLineNo">232</span> * <a name="line.232"></a> +<span class="sourceLineNo">233</span> * @return KeyValue which must be next seeked. return null if the filter is not sure which key to<a name="line.233"></a> +<span class="sourceLineNo">234</span> * seek to next.<a name="line.234"></a> +<span class="sourceLineNo">235</span> * @throws IOException in case an I/O or an filter specific failure needs to be signaled.<a name="line.235"></a> +<span class="sourceLineNo">236</span> */<a name="line.236"></a> +<span class="sourceLineNo">237</span> abstract public Cell getNextCellHint(final Cell currentCell) throws IOException;<a name="line.237"></a> +<span class="sourceLineNo">238</span><a name="line.238"></a> +<span class="sourceLineNo">239</span> /**<a name="line.239"></a> +<span class="sourceLineNo">240</span> * Check that given column family is essential for filter to check row. Most filters always return<a name="line.240"></a> +<span class="sourceLineNo">241</span> * true here. But some could have more sophisticated logic which could significantly reduce<a name="line.241"></a> +<span class="sourceLineNo">242</span> * scanning process by not even touching columns until we are 100% sure that it's data is needed<a name="line.242"></a> +<span class="sourceLineNo">243</span> * in result.<a name="line.243"></a> +<span class="sourceLineNo">244</span> * <a name="line.244"></a> +<span class="sourceLineNo">245</span> * Concrete implementers can signal a failure condition in their code by throwing an<a name="line.245"></a> +<span class="sourceLineNo">246</span> * {@link IOException}.<a name="line.246"></a> +<span class="sourceLineNo">247</span> * <a name="line.247"></a> +<span class="sourceLineNo">248</span> * @throws IOException in case an I/O or an filter specific failure needs to be signaled.<a name="line.248"></a> +<span class="sourceLineNo">249</span> */<a name="line.249"></a> +<span class="sourceLineNo">250</span> abstract public boolean isFamilyEssential(byte[] name) throws IOException;<a name="line.250"></a> +<span class="sourceLineNo">251</span><a name="line.251"></a> +<span class="sourceLineNo">252</span> /**<a name="line.252"></a> +<span class="sourceLineNo">253</span> * TODO: JAVADOC<a name="line.253"></a> +<span class="sourceLineNo">254</span> * <a name="line.254"></a> +<span class="sourceLineNo">255</span> * Concrete implementers can signal a failure condition in their code by throwing an<a name="line.255"></a> +<span class="sourceLineNo">256</span> * {@link IOException}.<a name="line.256"></a> +<span class="sourceLineNo">257</span> * <a name="line.257"></a> +<span class="sourceLineNo">258</span> * @return The filter serialized using pb<a name="line.258"></a> +<span class="sourceLineNo">259</span> * @throws IOException in case an I/O or an filter specific failure needs to be signaled.<a name="line.259"></a> +<span class="sourceLineNo">260</span> */<a name="line.260"></a> +<span class="sourceLineNo">261</span> abstract public byte[] toByteArray() throws IOException;<a name="line.261"></a> +<span class="sourceLineNo">262</span><a name="line.262"></a> +<span class="sourceLineNo">263</span> /**<a name="line.263"></a> +<span class="sourceLineNo">264</span> * <a name="line.264"></a> +<span class="sourceLineNo">265</span> * Concrete implementers can signal a failure condition in their code by throwing an<a name="line.265"></a> +<span class="sourceLineNo">266</span> * {@link IOException}.<a name="line.266"></a> +<span class="sourceLineNo">267</span> * <a name="line.267"></a> +<span class="sourceLineNo">268</span> * @param pbBytes A pb serialized {@link Filter} instance<a name="line.268"></a> +<span class="sourceLineNo">269</span> * @return An instance of {@link Filter} made from <code>bytes</code><a name="line.269"></a> +<span class="sourceLineNo">270</span> * @throws DeserializationException<a name="line.270"></a> +<span class="sourceLineNo">271</span> * @see #toByteArray<a name="line.271"></a> +<span class="sourceLineNo">272</span> */<a name="line.272"></a> +<span class="sourceLineNo">273</span> public static Filter parseFrom(final byte [] pbBytes) throws DeserializationException {<a name="line.273"></a> +<span class="sourceLineNo">274</span> throw new DeserializationException(<a name="line.274"></a> +<span class="sourceLineNo">275</span> "parseFrom called on base Filter, but should be called on derived type");<a name="line.275"></a> +<span class="sourceLineNo">276</span> }<a name="line.276"></a> +<span class="sourceLineNo">277</span><a name="line.277"></a> +<span class="sourceLineNo">278</span> /**<a name="line.278"></a> +<span class="sourceLineNo">279</span> * Concrete implementers can signal a failure condition in their code by throwing an<a name="line.279"></a> +<span class="sourceLineNo">280</span> * {@link IOException}.<a name="line.280"></a> +<span class="sourceLineNo">281</span> * <a name="line.281"></a> +<span class="sourceLineNo">282</span> * @param other<a name="line.282"></a> +<span class="sourceLineNo">283</span> * @return true if and only if the fields of the filter that are serialized are equal to the<a name="line.283"></a> +<span class="sourceLineNo">284</span> * corresponding fields in other. Used for testing.<a name="line.284"></a> +<span class="sourceLineNo">285</span> * @throws IOException in case an I/O or an filter specific failure needs to be signaled.<a name="line.285"></a> +<span class="sourceLineNo">286</span> */<a name="line.286"></a> +<span class="sourceLineNo">287</span> abstract boolean areSerializedFieldsEqual(Filter other);<a name="line.287"></a> +<span class="sourceLineNo">288</span><a name="line.288"></a> +<span class="sourceLineNo">289</span> /**<a name="line.289"></a> +<span class="sourceLineNo">290</span> * alter the reversed scan flag<a name="line.290"></a> +<span class="sourceLineNo">291</span> * @param reversed flag<a name="line.291"></a> +<span class="sourceLineNo">292</span> */<a name="line.292"></a> +<span class="sourceLineNo">293</span> public void setReversed(boolean reversed) {<a name="line.293"></a> +<span class="sourceLineNo">294</span> this.reversed = reversed;<a name="line.294"></a> <span class="sourceLineNo">295</span> }<a name="line.295"></a> -<span class="sourceLineNo">296</span>}<a name="line.296"></a> +<span class="sourceLineNo">296</span><a name="line.296"></a> +<span class="sourceLineNo">297</span> public boolean isReversed() {<a name="line.297"></a> +<span class="sourceLineNo">298</span> return this.reversed;<a name="line.298"></a> +<span class="sourceLineNo">299</span> }<a name="line.299"></a> +<span class="sourceLineNo">300</span>}<a name="line.300"></a>
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/21726f5a/apidocs/src-html/org/apache/hadoop/hbase/filter/Filter.html ---------------------------------------------------------------------- diff --git a/apidocs/src-html/org/apache/hadoop/hbase/filter/Filter.html b/apidocs/src-html/org/apache/hadoop/hbase/filter/Filter.html index 2356cfb..35d409c 100644 --- a/apidocs/src-html/org/apache/hadoop/hbase/filter/Filter.html +++ b/apidocs/src-html/org/apache/hadoop/hbase/filter/Filter.html @@ -180,128 +180,132 @@ <span class="sourceLineNo">172</span> */<a name="line.172"></a> <span class="sourceLineNo">173</span> NEXT_COL,<a name="line.173"></a> <span class="sourceLineNo">174</span> /**<a name="line.174"></a> -<span class="sourceLineNo">175</span> * Done with columns, skip to next row. Note that filterRow() will<a name="line.175"></a> -<span class="sourceLineNo">176</span> * still be called.<a name="line.176"></a> -<span class="sourceLineNo">177</span> */<a name="line.177"></a> -<span class="sourceLineNo">178</span> NEXT_ROW,<a name="line.178"></a> -<span class="sourceLineNo">179</span> /**<a name="line.179"></a> -<span class="sourceLineNo">180</span> * Seek to next key which is given as hint by the filter.<a name="line.180"></a> +<span class="sourceLineNo">175</span> * Seek to next row in current family. It may still pass a cell whose family is different but<a name="line.175"></a> +<span class="sourceLineNo">176</span> * row is the same as previous cell to {@link #filterKeyValue(Cell)} , even if we get a NEXT_ROW<a name="line.176"></a> +<span class="sourceLineNo">177</span> * returned for previous cell. For more details see HBASE-18368. <br><a name="line.177"></a> +<span class="sourceLineNo">178</span> * Once reset() method was invoked, then we switch to the next row for all family, and you can<a name="line.178"></a> +<span class="sourceLineNo">179</span> * catch the event by invoking CellUtils.matchingRows(previousCell, currentCell). <br><a name="line.179"></a> +<span class="sourceLineNo">180</span> * Note that filterRow() will still be called. <br><a name="line.180"></a> <span class="sourceLineNo">181</span> */<a name="line.181"></a> -<span class="sourceLineNo">182</span> SEEK_NEXT_USING_HINT,<a name="line.182"></a> +<span class="sourceLineNo">182</span> NEXT_ROW,<a name="line.182"></a> <span class="sourceLineNo">183</span> /**<a name="line.183"></a> -<span class="sourceLineNo">184</span> * Include KeyValue and done with row, seek to next.<a name="line.184"></a> +<span class="sourceLineNo">184</span> * Seek to next key which is given as hint by the filter.<a name="line.184"></a> <span class="sourceLineNo">185</span> */<a name="line.185"></a> -<span class="sourceLineNo">186</span> INCLUDE_AND_SEEK_NEXT_ROW,<a name="line.186"></a> -<span class="sourceLineNo">187</span>}<a name="line.187"></a> -<span class="sourceLineNo">188</span><a name="line.188"></a> -<span class="sourceLineNo">189</span> /**<a name="line.189"></a> -<span class="sourceLineNo">190</span> * Chance to alter the list of Cells to be submitted. Modifications to the list will carry on<a name="line.190"></a> -<span class="sourceLineNo">191</span> * <a name="line.191"></a> -<span class="sourceLineNo">192</span> * Concrete implementers can signal a failure condition in their code by throwing an<a name="line.192"></a> -<span class="sourceLineNo">193</span> * {@link IOException}.<a name="line.193"></a> -<span class="sourceLineNo">194</span> * <a name="line.194"></a> -<span class="sourceLineNo">195</span> * @param kvs the list of Cells to be filtered<a name="line.195"></a> -<span class="sourceLineNo">196</span> * @throws IOException in case an I/O or an filter specific failure needs to be signaled.<a name="line.196"></a> -<span class="sourceLineNo">197</span> */<a name="line.197"></a> -<span class="sourceLineNo">198</span> abstract public void filterRowCells(List<Cell> kvs) throws IOException;<a name="line.198"></a> -<span class="sourceLineNo">199</span><a name="line.199"></a> -<span class="sourceLineNo">200</span> /**<a name="line.200"></a> -<span class="sourceLineNo">201</span> * Primarily used to check for conflicts with scans(such as scans that do not read a full row at a<a name="line.201"></a> -<span class="sourceLineNo">202</span> * time).<a name="line.202"></a> -<span class="sourceLineNo">203</span> * <a name="line.203"></a> -<span class="sourceLineNo">204</span> * @return True if this filter actively uses filterRowCells(List) or filterRow().<a name="line.204"></a> -<span class="sourceLineNo">205</span> */<a name="line.205"></a> -<span class="sourceLineNo">206</span> abstract public boolean hasFilterRow();<a name="line.206"></a> -<span class="sourceLineNo">207</span><a name="line.207"></a> -<span class="sourceLineNo">208</span> /**<a name="line.208"></a> -<span class="sourceLineNo">209</span> * Last chance to veto row based on previous {@link #filterKeyValue(Cell)} calls. The filter<a name="line.209"></a> -<span class="sourceLineNo">210</span> * needs to retain state then return a particular value for this call if they wish to exclude a<a name="line.210"></a> -<span class="sourceLineNo">211</span> * row if a certain column is missing (for example).<a name="line.211"></a> -<span class="sourceLineNo">212</span> * <a name="line.212"></a> -<span class="sourceLineNo">213</span> * Concrete implementers can signal a failure condition in their code by throwing an<a name="line.213"></a> -<span class="sourceLineNo">214</span> * {@link IOException}.<a name="line.214"></a> -<span class="sourceLineNo">215</span> * <a name="line.215"></a> -<span class="sourceLineNo">216</span> * @return true to exclude row, false to include row.<a name="line.216"></a> -<span class="sourceLineNo">217</span> * @throws IOException in case an I/O or an filter specific failure needs to be signaled.<a name="line.217"></a> -<span class="sourceLineNo">218</span> */<a name="line.218"></a> -<span class="sourceLineNo">219</span> abstract public boolean filterRow() throws IOException;<a name="line.219"></a> -<span class="sourceLineNo">220</span><a name="line.220"></a> -<span class="sourceLineNo">221</span> /**<a name="line.221"></a> -<span class="sourceLineNo">222</span> * If the filter returns the match code SEEK_NEXT_USING_HINT, then it should also tell which is<a name="line.222"></a> -<span class="sourceLineNo">223</span> * the next key it must seek to. After receiving the match code SEEK_NEXT_USING_HINT, the<a name="line.223"></a> -<span class="sourceLineNo">224</span> * QueryMatcher would call this function to find out which key it must next seek to.<a name="line.224"></a> -<span class="sourceLineNo">225</span> * <a name="line.225"></a> -<span class="sourceLineNo">226</span> * Concrete implementers can signal a failure condition in their code by throwing an<a name="line.226"></a> -<span class="sourceLineNo">227</span> * {@link IOException}.<a name="line.227"></a> -<span class="sourceLineNo">228</span> * <a name="line.228"></a> -<span class="sourceLineNo">229</span> * @return KeyValue which must be next seeked. return null if the filter is not sure which key to<a name="line.229"></a> -<span class="sourceLineNo">230</span> * seek to next.<a name="line.230"></a> -<span class="sourceLineNo">231</span> * @throws IOException in case an I/O or an filter specific failure needs to be signaled.<a name="line.231"></a> -<span class="sourceLineNo">232</span> */<a name="line.232"></a> -<span class="sourceLineNo">233</span> abstract public Cell getNextCellHint(final Cell currentCell) throws IOException;<a name="line.233"></a> -<span class="sourceLineNo">234</span><a name="line.234"></a> -<span class="sourceLineNo">235</span> /**<a name="line.235"></a> -<span class="sourceLineNo">236</span> * Check that given column family is essential for filter to check row. Most filters always return<a name="line.236"></a> -<span class="sourceLineNo">237</span> * true here. But some could have more sophisticated logic which could significantly reduce<a name="line.237"></a> -<span class="sourceLineNo">238</span> * scanning process by not even touching columns until we are 100% sure that it's data is needed<a name="line.238"></a> -<span class="sourceLineNo">239</span> * in result.<a name="line.239"></a> -<span class="sourceLineNo">240</span> * <a name="line.240"></a> -<span class="sourceLineNo">241</span> * Concrete implementers can signal a failure condition in their code by throwing an<a name="line.241"></a> -<span class="sourceLineNo">242</span> * {@link IOException}.<a name="line.242"></a> -<span class="sourceLineNo">243</span> * <a name="line.243"></a> -<span class="sourceLineNo">244</span> * @throws IOException in case an I/O or an filter specific failure needs to be signaled.<a name="line.244"></a> -<span class="sourceLineNo">245</span> */<a name="line.245"></a> -<span class="sourceLineNo">246</span> abstract public boolean isFamilyEssential(byte[] name) throws IOException;<a name="line.246"></a> -<span class="sourceLineNo">247</span><a name="line.247"></a> -<span class="sourceLineNo">248</span> /**<a name="line.248"></a> -<span class="sourceLineNo">249</span> * TODO: JAVADOC<a name="line.249"></a> -<span class="sourceLineNo">250</span> * <a name="line.250"></a> -<span class="sourceLineNo">251</span> * Concrete implementers can signal a failure condition in their code by throwing an<a name="line.251"></a> -<span class="sourceLineNo">252</span> * {@link IOException}.<a name="line.252"></a> -<span class="sourceLineNo">253</span> * <a name="line.253"></a> -<span class="sourceLineNo">254</span> * @return The filter serialized using pb<a name="line.254"></a> -<span class="sourceLineNo">255</span> * @throws IOException in case an I/O or an filter specific failure needs to be signaled.<a name="line.255"></a> -<span class="sourceLineNo">256</span> */<a name="line.256"></a> -<span class="sourceLineNo">257</span> abstract public byte[] toByteArray() throws IOException;<a name="line.257"></a> -<span class="sourceLineNo">258</span><a name="line.258"></a> -<span class="sourceLineNo">259</span> /**<a name="line.259"></a> -<span class="sourceLineNo">260</span> * <a name="line.260"></a> -<span class="sourceLineNo">261</span> * Concrete implementers can signal a failure condition in their code by throwing an<a name="line.261"></a> -<span class="sourceLineNo">262</span> * {@link IOException}.<a name="line.262"></a> -<span class="sourceLineNo">263</span> * <a name="line.263"></a> -<span class="sourceLineNo">264</span> * @param pbBytes A pb serialized {@link Filter} instance<a name="line.264"></a> -<span class="sourceLineNo">265</span> * @return An instance of {@link Filter} made from <code>bytes</code><a name="line.265"></a> -<span class="sourceLineNo">266</span> * @throws DeserializationException<a name="line.266"></a> -<span class="sourceLineNo">267</span> * @see #toByteArray<a name="line.267"></a> -<span class="sourceLineNo">268</span> */<a name="line.268"></a> -<span class="sourceLineNo">269</span> public static Filter parseFrom(final byte [] pbBytes) throws DeserializationException {<a name="line.269"></a> -<span class="sourceLineNo">270</span> throw new DeserializationException(<a name="line.270"></a> -<span class="sourceLineNo">271</span> "parseFrom called on base Filter, but should be called on derived type");<a name="line.271"></a> -<span class="sourceLineNo">272</span> }<a name="line.272"></a> -<span class="sourceLineNo">273</span><a name="line.273"></a> -<span class="sourceLineNo">274</span> /**<a name="line.274"></a> -<span class="sourceLineNo">275</span> * Concrete implementers can signal a failure condition in their code by throwing an<a name="line.275"></a> -<span class="sourceLineNo">276</span> * {@link IOException}.<a name="line.276"></a> -<span class="sourceLineNo">277</span> * <a name="line.277"></a> -<span class="sourceLineNo">278</span> * @param other<a name="line.278"></a> -<span class="sourceLineNo">279</span> * @return true if and only if the fields of the filter that are serialized are equal to the<a name="line.279"></a> -<span class="sourceLineNo">280</span> * corresponding fields in other. Used for testing.<a name="line.280"></a> -<span class="sourceLineNo">281</span> * @throws IOException in case an I/O or an filter specific failure needs to be signaled.<a name="line.281"></a> -<span class="sourceLineNo">282</span> */<a name="line.282"></a> -<span class="sourceLineNo">283</span> abstract boolean areSerializedFieldsEqual(Filter other);<a name="line.283"></a> -<span class="sourceLineNo">284</span><a name="line.284"></a> -<span class="sourceLineNo">285</span> /**<a name="line.285"></a> -<span class="sourceLineNo">286</span> * alter the reversed scan flag<a name="line.286"></a> -<span class="sourceLineNo">287</span> * @param reversed flag<a name="line.287"></a> -<span class="sourceLineNo">288</span> */<a name="line.288"></a> -<span class="sourceLineNo">289</span> public void setReversed(boolean reversed) {<a name="line.289"></a> -<span class="sourceLineNo">290</span> this.reversed = reversed;<a name="line.290"></a> -<span class="sourceLineNo">291</span> }<a name="line.291"></a> -<span class="sourceLineNo">292</span><a name="line.292"></a> -<span class="sourceLineNo">293</span> public boolean isReversed() {<a name="line.293"></a> -<span class="sourceLineNo">294</span> return this.reversed;<a name="line.294"></a> +<span class="sourceLineNo">186</span> SEEK_NEXT_USING_HINT,<a name="line.186"></a> +<span class="sourceLineNo">187</span> /**<a name="line.187"></a> +<span class="sourceLineNo">188</span> * Include KeyValue and done with row, seek to next. See NEXT_ROW.<a name="line.188"></a> +<span class="sourceLineNo">189</span> */<a name="line.189"></a> +<span class="sourceLineNo">190</span> INCLUDE_AND_SEEK_NEXT_ROW,<a name="line.190"></a> +<span class="sourceLineNo">191</span>}<a name="line.191"></a> +<span class="sourceLineNo">192</span><a name="line.192"></a> +<span class="sourceLineNo">193</span> /**<a name="line.193"></a> +<span class="sourceLineNo">194</span> * Chance to alter the list of Cells to be submitted. Modifications to the list will carry on<a name="line.194"></a> +<span class="sourceLineNo">195</span> * <a name="line.195"></a> +<span class="sourceLineNo">196</span> * Concrete implementers can signal a failure condition in their code by throwing an<a name="line.196"></a> +<span class="sourceLineNo">197</span> * {@link IOException}.<a name="line.197"></a> +<span class="sourceLineNo">198</span> * <a name="line.198"></a> +<span class="sourceLineNo">199</span> * @param kvs the list of Cells to be filtered<a name="line.199"></a> +<span class="sourceLineNo">200</span> * @throws IOException in case an I/O or an filter specific failure needs to be signaled.<a name="line.200"></a> +<span class="sourceLineNo">201</span> */<a name="line.201"></a> +<span class="sourceLineNo">202</span> abstract public void filterRowCells(List<Cell> kvs) throws IOException;<a name="line.202"></a> +<span class="sourceLineNo">203</span><a name="line.203"></a> +<span class="sourceLineNo">204</span> /**<a name="line.204"></a> +<span class="sourceLineNo">205</span> * Primarily used to check for conflicts with scans(such as scans that do not read a full row at a<a name="line.205"></a> +<span class="sourceLineNo">206</span> * time).<a name="line.206"></a> +<span class="sourceLineNo">207</span> * <a name="line.207"></a> +<span class="sourceLineNo">208</span> * @return True if this filter actively uses filterRowCells(List) or filterRow().<a name="line.208"></a> +<span class="sourceLineNo">209</span> */<a name="line.209"></a> +<span class="sourceLineNo">210</span> abstract public boolean hasFilterRow();<a name="line.210"></a> +<span class="sourceLineNo">211</span><a name="line.211"></a> +<span class="sourceLineNo">212</span> /**<a name="line.212"></a> +<span class="sourceLineNo">213</span> * Last chance to veto row based on previous {@link #filterKeyValue(Cell)} calls. The filter<a name="line.213"></a> +<span class="sourceLineNo">214</span> * needs to retain state then return a particular value for this call if they wish to exclude a<a name="line.214"></a> +<span class="sourceLineNo">215</span> * row if a certain column is missing (for example).<a name="line.215"></a> +<span class="sourceLineNo">216</span> * <a name="line.216"></a> +<span class="sourceLineNo">217</span> * Concrete implementers can signal a failure condition in their code by throwing an<a name="line.217"></a> +<span class="sourceLineNo">218</span> * {@link IOException}.<a name="line.218"></a> +<span class="sourceLineNo">219</span> * <a name="line.219"></a> +<span class="sourceLineNo">220</span> * @return true to exclude row, false to include row.<a name="line.220"></a> +<span class="sourceLineNo">221</span> * @throws IOException in case an I/O or an filter specific failure needs to be signaled.<a name="line.221"></a> +<span class="sourceLineNo">222</span> */<a name="line.222"></a> +<span class="sourceLineNo">223</span> abstract public boolean filterRow() throws IOException;<a name="line.223"></a> +<span class="sourceLineNo">224</span><a name="line.224"></a> +<span class="sourceLineNo">225</span> /**<a name="line.225"></a> +<span class="sourceLineNo">226</span> * If the filter returns the match code SEEK_NEXT_USING_HINT, then it should also tell which is<a name="line.226"></a> +<span class="sourceLineNo">227</span> * the next key it must seek to. After receiving the match code SEEK_NEXT_USING_HINT, the<a name="line.227"></a> +<span class="sourceLineNo">228</span> * QueryMatcher would call this function to find out which key it must next seek to.<a name="line.228"></a> +<span class="sourceLineNo">229</span> * <a name="line.229"></a> +<span class="sourceLineNo">230</span> * Concrete implementers can signal a failure condition in their code by throwing an<a name="line.230"></a> +<span class="sourceLineNo">231</span> * {@link IOException}.<a name="line.231"></a> +<span class="sourceLineNo">232</span> * <a name="line.232"></a> +<span class="sourceLineNo">233</span> * @return KeyValue which must be next seeked. return null if the filter is not sure which key to<a name="line.233"></a> +<span class="sourceLineNo">234</span> * seek to next.<a name="line.234"></a> +<span class="sourceLineNo">235</span> * @throws IOException in case an I/O or an filter specific failure needs to be signaled.<a name="line.235"></a> +<span class="sourceLineNo">236</span> */<a name="line.236"></a> +<span class="sourceLineNo">237</span> abstract public Cell getNextCellHint(final Cell currentCell) throws IOException;<a name="line.237"></a> +<span class="sourceLineNo">238</span><a name="line.238"></a> +<span class="sourceLineNo">239</span> /**<a name="line.239"></a> +<span class="sourceLineNo">240</span> * Check that given column family is essential for filter to check row. Most filters always return<a name="line.240"></a> +<span class="sourceLineNo">241</span> * true here. But some could have more sophisticated logic which could significantly reduce<a name="line.241"></a> +<span class="sourceLineNo">242</span> * scanning process by not even touching columns until we are 100% sure that it's data is needed<a name="line.242"></a> +<span class="sourceLineNo">243</span> * in result.<a name="line.243"></a> +<span class="sourceLineNo">244</span> * <a name="line.244"></a> +<span class="sourceLineNo">245</span> * Concrete implementers can signal a failure condition in their code by throwing an<a name="line.245"></a> +<span class="sourceLineNo">246</span> * {@link IOException}.<a name="line.246"></a> +<span class="sourceLineNo">247</span> * <a name="line.247"></a> +<span class="sourceLineNo">248</span> * @throws IOException in case an I/O or an filter specific failure needs to be signaled.<a name="line.248"></a> +<span class="sourceLineNo">249</span> */<a name="line.249"></a> +<span class="sourceLineNo">250</span> abstract public boolean isFamilyEssential(byte[] name) throws IOException;<a name="line.250"></a> +<span class="sourceLineNo">251</span><a name="line.251"></a> +<span class="sourceLineNo">252</span> /**<a name="line.252"></a> +<span class="sourceLineNo">253</span> * TODO: JAVADOC<a name="line.253"></a> +<span class="sourceLineNo">254</span> * <a name="line.254"></a> +<span class="sourceLineNo">255</span> * Concrete implementers can signal a failure condition in their code by throwing an<a name="line.255"></a> +<span class="sourceLineNo">256</span> * {@link IOException}.<a name="line.256"></a> +<span class="sourceLineNo">257</span> * <a name="line.257"></a> +<span class="sourceLineNo">258</span> * @return The filter serialized using pb<a name="line.258"></a> +<span class="sourceLineNo">259</span> * @throws IOException in case an I/O or an filter specific failure needs to be signaled.<a name="line.259"></a> +<span class="sourceLineNo">260</span> */<a name="line.260"></a> +<span class="sourceLineNo">261</span> abstract public byte[] toByteArray() throws IOException;<a name="line.261"></a> +<span class="sourceLineNo">262</span><a name="line.262"></a> +<span class="sourceLineNo">263</span> /**<a name="line.263"></a> +<span class="sourceLineNo">264</span> * <a name="line.264"></a> +<span class="sourceLineNo">265</span> * Concrete implementers can signal a failure condition in their code by throwing an<a name="line.265"></a> +<span class="sourceLineNo">266</span> * {@link IOException}.<a name="line.266"></a> +<span class="sourceLineNo">267</span> * <a name="line.267"></a> +<span class="sourceLineNo">268</span> * @param pbBytes A pb serialized {@link Filter} instance<a name="line.268"></a> +<span class="sourceLineNo">269</span> * @return An instance of {@link Filter} made from <code>bytes</code><a name="line.269"></a> +<span class="sourceLineNo">270</span> * @throws DeserializationException<a name="line.270"></a> +<span class="sourceLineNo">271</span> * @see #toByteArray<a name="line.271"></a> +<span class="sourceLineNo">272</span> */<a name="line.272"></a> +<span class="sourceLineNo">273</span> public static Filter parseFrom(final byte [] pbBytes) throws DeserializationException {<a name="line.273"></a> +<span class="sourceLineNo">274</span> throw new DeserializationException(<a name="line.274"></a> +<span class="sourceLineNo">275</span> "parseFrom called on base Filter, but should be called on derived type");<a name="line.275"></a> +<span class="sourceLineNo">276</span> }<a name="line.276"></a> +<span class="sourceLineNo">277</span><a name="line.277"></a> +<span class="sourceLineNo">278</span> /**<a name="line.278"></a> +<span class="sourceLineNo">279</span> * Concrete implementers can signal a failure condition in their code by throwing an<a name="line.279"></a> +<span class="sourceLineNo">280</span> * {@link IOException}.<a name="line.280"></a> +<span class="sourceLineNo">281</span> * <a name="line.281"></a> +<span class="sourceLineNo">282</span> * @param other<a name="line.282"></a> +<span class="sourceLineNo">283</span> * @return true if and only if the fields of the filter that are serialized are equal to the<a name="line.283"></a> +<span class="sourceLineNo">284</span> * corresponding fields in other. Used for testing.<a name="line.284"></a> +<span class="sourceLineNo">285</span> * @throws IOException in case an I/O or an filter specific failure needs to be signaled.<a name="line.285"></a> +<span class="sourceLineNo">286</span> */<a name="line.286"></a> +<span class="sourceLineNo">287</span> abstract boolean areSerializedFieldsEqual(Filter other);<a name="line.287"></a> +<span class="sourceLineNo">288</span><a name="line.288"></a> +<span class="sourceLineNo">289</span> /**<a name="line.289"></a> +<span class="sourceLineNo">290</span> * alter the reversed scan flag<a name="line.290"></a> +<span class="sourceLineNo">291</span> * @param reversed flag<a name="line.291"></a> +<span class="sourceLineNo">292</span> */<a name="line.292"></a> +<span class="sourceLineNo">293</span> public void setReversed(boolean reversed) {<a name="line.293"></a> +<span class="sourceLineNo">294</span> this.reversed = reversed;<a name="line.294"></a> <span class="sourceLineNo">295</span> }<a name="line.295"></a> -<span class="sourceLineNo">296</span>}<a name="line.296"></a> +<span class="sourceLineNo">296</span><a name="line.296"></a> +<span class="sourceLineNo">297</span> public boolean isReversed() {<a name="line.297"></a> +<span class="sourceLineNo">298</span> return this.reversed;<a name="line.298"></a> +<span class="sourceLineNo">299</span> }<a name="line.299"></a> +<span class="sourceLineNo">300</span>}<a name="line.300"></a>