Class ColumnMask
java.lang.Object
org.apache.cassandra.cql3.functions.masking.ColumnMask
Dynamic data mask that can be applied to a schema column.
It consists on a partial application of a certain MaskingFunction to the values of a column, with the
precondition that the type of any masked column is compatible with the type of the first argument of the function.
This partial application is meant to be associated to specific columns in the schema, acting as a mask for the values of those columns. It's associated to queries such as:
CREATE TABLE t (k int PRIMARY KEY, v int MASKED WITH mask_inner(1, 1));
ALTER TABLE t ALTER v MASKED WITH mask_inner(2, 1);
ALTER TABLE t ALTER v DROP MASKED;
Note that in the example above we are referencing the mask_inner function with two arguments. However, that
CQL function actually has three arguments. The first argument is always ommitted when attaching the function to a
schema column. The value of that first argument is always the value of the masked column, in this case an int.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic final classA parsed but not prepared column mask. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringfinal ScalarFunctionThe CQL function used for masking.protected final ByteBuffer[]The values of the arguments of the partially applied masking function. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidappendCqlTo(CqlBuilder builder) static voidbooleaninthashCode()masker(ProtocolVersion version) List<AbstractType<?>>toString()
-
Field Details
-
DISABLED_ERROR_MESSAGE
- See Also:
-
function
The CQL function used for masking. -
partialArgumentValues
The values of the arguments of the partially applied masking function.
-
-
Constructor Details
-
ColumnMask
-
-
Method Details
-
partialArgumentTypes
- Returns:
- The types of the arguments of the partially applied masking function, as an unmodifiable list.
-
partialArgumentValues
- Returns:
- The values of the arguments of the partially applied masking function, as an unmodifiable list that can contain nulls.
-
withReversedType
- Returns:
- A copy of this mask for a version of its masked column that has its type reversed.
-
masker
- Parameters:
version- the used version of the transport protocol- Returns:
- a masker instance that caches the terminal masking function arguments
-
ensureEnabled
public static void ensureEnabled() -
equals
-
hashCode
public int hashCode() -
toString
-
appendCqlTo
-