Package org.apache.accumulo.core.data
Class Condition
java.lang.Object
org.apache.accumulo.core.data.Condition
Conditions that must be met on a particular column in a row.
- Since:
- 1.6.0
-
Constructor Summary
ConstructorDescriptionCondition
(byte[] cf, byte[] cq) Creates a new condition.Condition
(CharSequence cf, CharSequence cq) Creates a new condition.Condition
(ByteSequence cf, ByteSequence cq) Creates a new condition.Condition
(org.apache.hadoop.io.Text cf, org.apache.hadoop.io.Text cq) Creates a new condition. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Gets the column family of this condition.Gets the iterators for this condition.Gets the column qualifier of this condition.Gets the timestamp of this condition.getValue()
Gets the value of this condition.Gets the column visibility of this condition.int
hashCode()
setIterators
(IteratorSetting... iterators) Set iterators to use when reading the columns value.setTimestamp
(long ts) Sets the version for the column to check.setValue
(byte[] value) This method sets the expected value of a column.setValue
(CharSequence value) This method sets the expected value of a column.setValue
(ByteSequence value) This method sets the expected value of a column.setValue
(org.apache.hadoop.io.Text value) This method sets the expected value of a column.Sets the visibility for the column to check.
-
Constructor Details
-
Condition
Creates a new condition. The initial column value and timestamp are null, and the initial column visibility is empty. Characters in the column family and column qualifier are encoded as bytes in the condition using UTF-8.- Parameters:
cf
- column familycq
- column qualifier- Throws:
IllegalArgumentException
- if any argument is null
-
Condition
public Condition(byte[] cf, byte[] cq) Creates a new condition. The initial column value and timestamp are null, and the initial column visibility is empty.- Parameters:
cf
- column familycq
- column qualifier- Throws:
IllegalArgumentException
- if any argument is null
-
Condition
public Condition(org.apache.hadoop.io.Text cf, org.apache.hadoop.io.Text cq) Creates a new condition. The initial column value and timestamp are null, and the initial column visibility is empty.- Parameters:
cf
- column familycq
- column qualifier- Throws:
IllegalArgumentException
- if any argument is null
-
Condition
Creates a new condition. The initial column value and timestamp are null, and the initial column visibility is empty.- Parameters:
cf
- column familycq
- column qualifier- Throws:
IllegalArgumentException
- if any argument is null
-
-
Method Details
-
getFamily
Gets the column family of this condition.- Returns:
- column family
-
getQualifier
Gets the column qualifier of this condition.- Returns:
- column qualifier
-
setTimestamp
Sets the version for the column to check. If this is not set then the latest column will be checked, unless iterators do something different.- Parameters:
ts
- timestamp- Returns:
- this condition
-
getTimestamp
Gets the timestamp of this condition.- Returns:
- timestamp
-
setValue
This method sets the expected value of a column. In order for the condition to pass the column must exist and have this value. If a value is not set, then the column must be absent for the condition to pass. The passed-in character sequence is encoded as UTF-8. SeesetValue(byte[])
.- Parameters:
value
- value- Returns:
- this condition
- Throws:
IllegalArgumentException
- if value is null
-
setValue
This method sets the expected value of a column. In order for the condition to pass the column must exist and have this value. If a value is not set, then the column must be absent for the condition to pass.- Parameters:
value
- value- Returns:
- this condition
- Throws:
IllegalArgumentException
- if value is null
-
setValue
This method sets the expected value of a column. In order for the condition to pass the column must exist and have this value. If a value is not set, then the column must be absent for the condition to pass. SeesetValue(byte[])
.- Parameters:
value
- value- Returns:
- this condition
- Throws:
IllegalArgumentException
- if value is null
-
setValue
This method sets the expected value of a column. In order for the condition to pass the column must exist and have this value. If a value is not set, then the column must be absent for the condition to pass. SeesetValue(byte[])
.- Parameters:
value
- value- Returns:
- this condition
- Throws:
IllegalArgumentException
- if value is null
-
getValue
Gets the value of this condition.- Returns:
- value
-
setVisibility
Sets the visibility for the column to check. If not set it defaults to empty visibility.- Parameters:
cv
- column visibility- Throws:
IllegalArgumentException
- if cv is null
-
getVisibility
Gets the column visibility of this condition.- Returns:
- column visibility
-
setIterators
Set iterators to use when reading the columns value. These iterators will be applied in addition to the iterators configured for the table. Using iterators its possible to test other conditions, besides equality and absence, like less than. On the server side the iterators will be seeked using a range that covers only the family, qualifier, and visibility (if the timestamp is set then it will be used to narrow the range). Value equality will be tested using the first entry returned by the iterator stack.- Parameters:
iterators
- iterators- Returns:
- this condition
- Throws:
IllegalArgumentException
- if iterators or any of its elements are null, or if any two iterators share the same name or priority
-
getIterators
Gets the iterators for this condition.- Returns:
- iterators
-
equals
-
hashCode
public int hashCode()
-