|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.hbase.filter.FilterBase
org.apache.hadoop.hbase.filter.RandomRowFilter
public class RandomRowFilter
A filter that includes rows based on a chance.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.apache.hadoop.hbase.filter.Filter |
|---|
Filter.ReturnCode |
| Field Summary | |
|---|---|
protected float |
chance
|
protected boolean |
filterOutRow
|
protected static Random |
random
|
| Constructor Summary | |
|---|---|
RandomRowFilter()
Writable constructor, do not use. |
|
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()
|
void |
readFields(DataInput in)
|
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. |
void |
write(DataOutput out)
|
| Methods inherited from class org.apache.hadoop.hbase.filter.FilterBase |
|---|
createFilterFromArguments, filterRow, getNextKeyHint, hasFilterRow, transform |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final Random random
protected float chance
protected boolean filterOutRow
| Constructor Detail |
|---|
public RandomRowFilter()
public RandomRowFilter(float chance)
chance - | Method Detail |
|---|
public float getChance()
public void setChance(float chance)
chance - public boolean filterAllRemaining()
FilterBase
filterAllRemaining in interface FilterfilterAllRemaining in class FilterBasepublic Filter.ReturnCode filterKeyValue(KeyValue v)
FilterBase
filterKeyValue in interface FilterfilterKeyValue 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 interface FilterfilterRow in class FilterBase
public boolean filterRowKey(byte[] buffer,
int offset,
int length)
FilterBase
filterRowKey in interface FilterfilterRowKey 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 interface Filterreset in class FilterBase
public void readFields(DataInput in)
throws IOException
IOException
public void write(DataOutput out)
throws IOException
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||