|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.hbase.filter.Filter
org.apache.hadoop.hbase.filter.FilterBase
org.apache.hadoop.hbase.filter.RandomRowFilter
@InterfaceAudience.Public @InterfaceStability.Stable public class RandomRowFilter
A filter that includes rows based on a chance.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.apache.hadoop.hbase.filter.Filter |
|---|
Filter.ReturnCode |
| Field Summary | |
|---|---|
protected float |
chance
|
protected boolean |
filterOutRow
|
protected static Random |
random
|
| Constructor Summary | |
|---|---|
RandomRowFilter(float chance)
Create a new filter with a specified chance for a row to be included. |
|
| Method Summary | |
|---|---|
boolean |
filterAllRemaining()
Filters that never filter all remaining can inherit this implementation that never stops the filter early. |
Filter.ReturnCode |
filterKeyValue(KeyValue v)
Filters that dont filter by key value can inherit this implementation that includes all KeyValues. |
boolean |
filterRow()
Filters that never filter by rows based on previously gathered state from FilterBase.filterKeyValue(KeyValue) can inherit this implementation that
never filters a row. |
boolean |
filterRowKey(byte[] buffer,
int offset,
int length)
Filters that do not filter by row key can inherit this implementation that never filters anything. |
float |
getChance()
|
boolean |
hasFilterRow()
Fitlers that never filter by modifying the returned List of KeyValues can inherit this implementation that does nothing. |
static RandomRowFilter |
parseFrom(byte[] pbBytes)
|
void |
reset()
Filters that are purely stateless and do nothing in their reset() methods can inherit this null/empty implementation. |
void |
setChance(float chance)
Set the chance that a row is included. |
byte[] |
toByteArray()
Return length 0 byte array for Filters that don't require special serialization |
| Methods inherited from class org.apache.hadoop.hbase.filter.FilterBase |
|---|
createFilterFromArguments, filterRow, getNextKeyHint, isFamilyEssential, toString, transform |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final Random random
protected float chance
protected boolean filterOutRow
| Constructor Detail |
|---|
public RandomRowFilter(float chance)
chance - | Method Detail |
|---|
public float getChance()
public void setChance(float chance)
chance - public boolean filterAllRemaining()
FilterBase
filterAllRemaining in class FilterBasepublic Filter.ReturnCode filterKeyValue(KeyValue v)
FilterBase
filterKeyValue in class FilterBasev - the KeyValue in question
Filter.ReturnCodepublic boolean filterRow()
FilterBaseFilterBase.filterKeyValue(KeyValue) can inherit this implementation that
never filters a row.
filterRow in class FilterBasepublic boolean hasFilterRow()
FilterBase
hasFilterRow in class FilterBase
public boolean filterRowKey(byte[] buffer,
int offset,
int length)
FilterBase
filterRowKey in class FilterBasebuffer - buffer containing row keyoffset - offset into buffer where row key startslength - length of the row key
public void reset()
FilterBase
reset in class FilterBasepublic byte[] toByteArray()
FilterBase
toByteArray in class FilterBase
public static RandomRowFilter parseFrom(byte[] pbBytes)
throws DeserializationException
pbBytes - A pb serialized RandomRowFilter instance
RandomRowFilter made from bytes
DeserializationExceptiontoByteArray()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||