com.datastax.driver.core
Enum WriteType

java.lang.Object
  extended by java.lang.Enum<WriteType>
      extended by com.datastax.driver.core.WriteType
All Implemented Interfaces:
Serializable, Comparable<WriteType>

public enum WriteType
extends Enum<WriteType>

The type of a Cassandra write query.

This information is returned by Cassandra when a write timeout is raised to indicate what type of write timeouted. This information is useful to decide which retry policy to adopt.


Enum Constant Summary
BATCH
          A write to a multiple partition key that used the distributed batch log to ensure atomicity.
BATCH_LOG
          The initial write to the distributed batch log that Cassandra performs internally before a BATCH write.
CAS
          A conditional write.
COUNTER
          A counter write (that can be for one or multiple partition key).
SIMPLE
          A write to a single partition key.
UNLOGGED_BATCH
          A write to a multiple partition key that doesn't use the distributed batch log.
 
Method Summary
static WriteType valueOf(String name)
          Returns the enum constant of this type with the specified name.
static WriteType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

SIMPLE

public static final WriteType SIMPLE
A write to a single partition key. Such writes are guaranteed to be atomic and isolated.


BATCH

public static final WriteType BATCH
A write to a multiple partition key that used the distributed batch log to ensure atomicity.


UNLOGGED_BATCH

public static final WriteType UNLOGGED_BATCH
A write to a multiple partition key that doesn't use the distributed batch log. Atomicity for such writes is not guaranteed


COUNTER

public static final WriteType COUNTER
A counter write (that can be for one or multiple partition key). Such write should not be replayed to avoid overcount.


BATCH_LOG

public static final WriteType BATCH_LOG
The initial write to the distributed batch log that Cassandra performs internally before a BATCH write.


CAS

public static final WriteType CAS
A conditional write. If a timeout has this WriteType, the timeout has happened while doing the compare-and-swap for an conditional update. In this case, the update may or may not have been applied.

Method Detail

values

public static WriteType[] 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 (WriteType c : WriteType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static WriteType valueOf(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:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null


Copyright © 2013. All rights reserved.