Enum WriteComputeOperation
- java.lang.Object
-
- java.lang.Enum<WriteComputeOperation>
-
- com.linkedin.venice.schema.writecompute.WriteComputeOperation
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<WriteComputeOperation>
public enum WriteComputeOperation extends java.lang.Enum<WriteComputeOperation>
This enum describe the possible write compute operations Venice supports.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description LIST_OPS
Perform list operations on top of the original array.MAP_OPS
Perform map operations on top of the original map.NO_OP_ON_FIELD
Mark to ignore the field.PUT_NEW_FIELD
Put a new value on an existing field.
-
Field Summary
Fields Modifier and Type Field Description java.lang.String
name
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static WriteComputeOperation
getFieldOperationType(java.lang.Object writeComputeFieldValue)
java.lang.String
getName()
static boolean
isPartialUpdateOp(org.apache.avro.generic.GenericRecord writeComputeRecord)
static WriteComputeOperation
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static WriteComputeOperation[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NO_OP_ON_FIELD
public static final WriteComputeOperation NO_OP_ON_FIELD
Mark to ignore the field. It's used for "partial put" and can be applied to any kind of schema. It's also the default for all record fields in the write compute schema.
-
PUT_NEW_FIELD
public static final WriteComputeOperation PUT_NEW_FIELD
Put a new value on an existing field. It's used for "partial put".
-
LIST_OPS
public static final WriteComputeOperation LIST_OPS
Perform list operations on top of the original array. It can be only applied to Avro array. Currently support: 1. setUnion: add elements into the original array, as if it was a sorted set. (e.g.: duplicates will be pruned.) 2. setDiff: remove elements from the original array, as if it was a sorted set.
-
MAP_OPS
public static final WriteComputeOperation MAP_OPS
Perform map operations on top of the original map. It can be only applied to Avro map. Currently support: 1. mapUnion: add new entries into the original map. It overrides the value if a key has already existed in the map. 2. mapDiff: remove entries from the original array.
-
-
Method Detail
-
values
public static WriteComputeOperation[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (WriteComputeOperation c : WriteComputeOperation.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static WriteComputeOperation valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
getName
public java.lang.String getName()
-
getFieldOperationType
public static WriteComputeOperation getFieldOperationType(java.lang.Object writeComputeFieldValue)
-
isPartialUpdateOp
public static boolean isPartialUpdateOp(org.apache.avro.generic.GenericRecord writeComputeRecord)
-
-