com.netflix.astyanax
Interface WriteAheadLog

All Known Implementing Classes:
NoOpWriteAheadLog

public interface WriteAheadLog

Base interface for a write ahead log. The purpose of the WAL is to provide atomicity and durability when writing to Cassandra. Before writing to cassandra a record is written to the WAL which is assumed to stable storage able to survive from a crash or hardware failure. After a crash the system will inspect the WAL for records and replay them. If a record is successfully written to cassandra it will be removed from the WAL.


Method Summary
 WriteAheadEntry createEntry()
          Add an entry to WAL before it is sent to Cassandra.
 WriteAheadEntry readNextEntry()
          Read the next entry to retry from the wall.
 void removeEntry(WriteAheadEntry entry)
          Remove an entry from the WAL after it was successfully written to cassandra
 void retryEntry(WriteAheadEntry entry)
          Retry an entry retrieved by calling getNextEntry();
 

Method Detail

createEntry

WriteAheadEntry createEntry()
                            throws com.netflix.astyanax.connectionpool.exceptions.WalException
Add an entry to WAL before it is sent to Cassandra.

Parameters:
batch -
Returns:
Throws:
com.netflix.astyanax.connectionpool.exceptions.WalException

removeEntry

void removeEntry(WriteAheadEntry entry)
Remove an entry from the WAL after it was successfully written to cassandra

Parameters:
entry -

readNextEntry

WriteAheadEntry readNextEntry()
Read the next entry to retry from the wall. Call remove if successful or retryEntry if unable to write to cassandra.

Returns:

retryEntry

void retryEntry(WriteAheadEntry entry)
Retry an entry retrieved by calling getNextEntry();

Parameters:
entry -