|
||||||||||
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
|
Fields inherited from class org.apache.hadoop.hbase.filter.Filter |
---|
reversed |
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(Cell v)
Filters that dont filter by key value can inherit this implementation that includes all Cells. |
boolean |
filterRow()
Filters that never filter by rows based on previously gathered state from FilterBase.filterKeyValue(Cell) 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 Cells 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, filterRowCells, getNextCellHint, getNextKeyHint, isFamilyEssential, toString, transform, transformCell |
Methods inherited from class org.apache.hadoop.hbase.filter.Filter |
---|
isReversed, setReversed |
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()
org.apache.hadoop.hbase.filter.FilterBase
filterAllRemaining
in class org.apache.hadoop.hbase.filter.FilterBase
public Filter.ReturnCode filterKeyValue(Cell v)
org.apache.hadoop.hbase.filter.FilterBase
filterKeyValue
in class org.apache.hadoop.hbase.filter.FilterBase
v
- the Cell in question
Filter.ReturnCode
public boolean filterRow()
org.apache.hadoop.hbase.filter.FilterBase
FilterBase.filterKeyValue(Cell)
can inherit this implementation that
never filters a row.
filterRow
in class org.apache.hadoop.hbase.filter.FilterBase
public boolean hasFilterRow()
org.apache.hadoop.hbase.filter.FilterBase
hasFilterRow
in class org.apache.hadoop.hbase.filter.FilterBase
public boolean filterRowKey(byte[] buffer, int offset, int length)
org.apache.hadoop.hbase.filter.FilterBase
filterRowKey
in class org.apache.hadoop.hbase.filter.FilterBase
buffer
- buffer containing row keyoffset
- offset into buffer where row key startslength
- length of the row key
public void reset()
org.apache.hadoop.hbase.filter.FilterBase
reset
in class org.apache.hadoop.hbase.filter.FilterBase
public byte[] toByteArray()
org.apache.hadoop.hbase.filter.FilterBase
toByteArray
in class org.apache.hadoop.hbase.filter.FilterBase
public static RandomRowFilter parseFrom(byte[] pbBytes) throws org.apache.hadoop.hbase.exceptions.DeserializationException
pbBytes
- A pb serialized RandomRowFilter
instance
RandomRowFilter
made from bytes
org.apache.hadoop.hbase.exceptions.DeserializationException
toByteArray()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |