com.aerospike.client.policy
Enum GenerationPolicy

java.lang.Object
  extended by java.lang.Enum<GenerationPolicy>
      extended by com.aerospike.client.policy.GenerationPolicy
All Implemented Interfaces:
Serializable, Comparable<GenerationPolicy>

public enum GenerationPolicy
extends Enum<GenerationPolicy>

How to handle record writes based on record generation.


Enum Constant Summary
DUPLICATE
          Create duplicate record if expected generation is not equal to server generation.
EXPECT_GEN_EQUAL
          Update/delete record if expected generation is equal to server generation.
EXPECT_GEN_GT
          Update/delete record if expected generation greater than the server generation.
NONE
          Do not use record generation to restrict writes.
 
Method Summary
static GenerationPolicy valueOf(String name)
          Returns the enum constant of this type with the specified name.
static GenerationPolicy[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

NONE

public static final GenerationPolicy NONE
Do not use record generation to restrict writes.


EXPECT_GEN_EQUAL

public static final GenerationPolicy EXPECT_GEN_EQUAL
Update/delete record if expected generation is equal to server generation. Otherwise, fail.


EXPECT_GEN_GT

public static final GenerationPolicy EXPECT_GEN_GT
Update/delete record if expected generation greater than the server generation. Otherwise, fail. This is useful for restore after backup.


DUPLICATE

public static final GenerationPolicy DUPLICATE
Create duplicate record if expected generation is not equal to server generation. Duplicates are only created when the server configuration option "allow-versions" is true (default is false).

Method Detail

values

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

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

valueOf

public static GenerationPolicy 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 © 2012–2014 Aerospike, Inc. All rights reserved.