Class SimpleMapperOptions
- java.lang.Object
-
- org.apache.flink.streaming.connectors.cassandra.SimpleMapperOptions
-
- All Implemented Interfaces:
Serializable
,MapperOptions
public class SimpleMapperOptions extends Object implements MapperOptions
A simple MapperOptions implementation.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SimpleMapperOptions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SimpleMapperOptions
consistencyLevel(com.datastax.driver.core.ConsistencyLevel cl)
Adds a consistency level value option to a mapper operation.com.datastax.driver.mapping.Mapper.Option[]
getMapperOptions()
Returns an array ofMapper.Option
that are used configure the mapper.SimpleMapperOptions
ifNotExists(boolean enabled)
Specifies whether an IF NOT EXISTS clause should be included in insert queries.SimpleMapperOptions
saveNullFields(boolean enabled)
Specifies whether null entity fields should be included in insert queries.SimpleMapperOptions
timestamp(long timestamp)
Adds a timestamp option to a mapper operation.SimpleMapperOptions
tracing(boolean enabled)
Enables query tracing for a mapper operation.SimpleMapperOptions
ttl(int ttl)
Adds time-to-live option to a mapper operation.
-
-
-
Method Detail
-
ttl
public SimpleMapperOptions ttl(int ttl)
Adds time-to-live option to a mapper operation. This is only valid for save operations.Note that this option is only available if using
ProtocolVersion.V2
or above.- Parameters:
ttl
- the TTL (in seconds).
-
timestamp
public SimpleMapperOptions timestamp(long timestamp)
Adds a timestamp option to a mapper operation. This is only valid for save and delete operations.Note that this option is only available if using
ProtocolVersion.V2
or above.- Parameters:
timestamp
- the timestamp (in microseconds).
-
consistencyLevel
public SimpleMapperOptions consistencyLevel(com.datastax.driver.core.ConsistencyLevel cl)
Adds a consistency level value option to a mapper operation. This is valid for save, delete and get operations.Note that the consistency level can also be defined at the mapper level, as a parameter of the
Table
annotation (this is redundant for backward compatibility). This option, whether defined on a specific call or as the default, will always take precedence over the annotation.- Parameters:
cl
- theConsistencyLevel
to use for the operation.
-
tracing
public SimpleMapperOptions tracing(boolean enabled)
Enables query tracing for a mapper operation. This is valid for save, delete and get operations.- Parameters:
enabled
- whether to enable tracing.
-
saveNullFields
public SimpleMapperOptions saveNullFields(boolean enabled)
Specifies whether null entity fields should be included in insert queries. This option is valid only for save operations.If this option is not specified, it defaults to
true
(null fields are saved).- Parameters:
enabled
- whether to include null fields in queries.
-
ifNotExists
public SimpleMapperOptions ifNotExists(boolean enabled)
Specifies whether an IF NOT EXISTS clause should be included in insert queries. This option is valid only for save operations.If this option is not specified, it defaults to
false
(IF NOT EXISTS statements are not used).- Parameters:
enabled
- whether to include an IF NOT EXISTS clause in queries.
-
getMapperOptions
public com.datastax.driver.mapping.Mapper.Option[] getMapperOptions()
Description copied from interface:MapperOptions
Returns an array ofMapper.Option
that are used configure the mapper.- Specified by:
getMapperOptions
in interfaceMapperOptions
- Returns:
- array of options used to configure the mapper.
-
-