org.scale7.cassandra.pelops
Class OperandPolicy

java.lang.Object
  extended by org.scale7.cassandra.pelops.OperandPolicy

public class OperandPolicy
extends Object

General policy configuration.


Constructor Summary
OperandPolicy()
           
OperandPolicy(int maxOpRetries, boolean deleteIfNull)
           
OperandPolicy(int maxOpRetries, boolean deleteIfNull, IExceptionTranslator exceptionTranslator)
           
 
Method Summary
 IExceptionTranslator getExceptionTranslator()
          The translater used to convert checked Thirft/Cassandra exceptions into unchecked PelopsExceptions.
 int getMaxOpRetries()
           
 boolean isDeleteIfNull()
          Dictates if pelops should issue deletes when it detects null values being written in a mutation batch.
 void setDeleteIfNull(boolean deleteIfNull)
          Dictates if pelops should issue deletes when it detects null values being written in a mutation batch.
 void setExceptionTranslator(IExceptionTranslator exceptionTranslator)
          The translater used to convert checked Thirft/Cassandra exceptions into unchecked PelopsExceptions.
 void setMaxOpRetries(int maxOpRetries)
          Max number of times to retry an operation before giving up.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OperandPolicy

public OperandPolicy()

OperandPolicy

public OperandPolicy(int maxOpRetries,
                     boolean deleteIfNull)

OperandPolicy

public OperandPolicy(int maxOpRetries,
                     boolean deleteIfNull,
                     IExceptionTranslator exceptionTranslator)
Method Detail

getMaxOpRetries

public int getMaxOpRetries()

setMaxOpRetries

public void setMaxOpRetries(int maxOpRetries)
Max number of times to retry an operation before giving up. Default to 2.

Parameters:
maxOpRetries - the value

isDeleteIfNull

public boolean isDeleteIfNull()
Dictates if pelops should issue deletes when it detects null values being written in a mutation batch.

Returns:
true if deletes should be issued by default

setDeleteIfNull

public void setDeleteIfNull(boolean deleteIfNull)
Dictates if pelops should issue deletes when it detects null values being written in a mutation batch.

Parameters:
deleteIfNull - true if deletes should be issued by default

getExceptionTranslator

public IExceptionTranslator getExceptionTranslator()
The translater used to convert checked Thirft/Cassandra exceptions into unchecked PelopsExceptions.

Returns:
the translator

setExceptionTranslator

public void setExceptionTranslator(IExceptionTranslator exceptionTranslator)
The translater used to convert checked Thirft/Cassandra exceptions into unchecked PelopsExceptions.

Note: by default IExceptionTranslator.ExceptionTranslator is used.

Parameters:
exceptionTranslator - the translator


Copyright © 2011. All Rights Reserved.