org.apache.cassandra.io
Class ChecksumManager

java.lang.Object
  extended by org.apache.cassandra.io.ChecksumManager

public class ChecksumManager
extends java.lang.Object

This class manages the persistence of checksums and keeps them in memory. It maintains a mapping of data files on disk to their corresponding checksum files. It is also loads the checksums in memory on start up.

Author:
alakshman

Method Summary
static int getFileId(java.lang.String file)
           
static ChecksumManager instance(java.lang.String dataFile)
           
static ChecksumManager instance(java.lang.String dataFile, java.lang.String chkSumFile)
           
static boolean isChecksumFile(java.lang.String file)
          This method returns true if the file specified is a checksum file and false otherwise.
static void main(java.lang.String[] args)
           
static void onFileDelete(java.lang.String dataFile)
          On delete of this dataFile remove the checksums associated with this file from memory, remove the check sum manager instance.
static void onStart()
          On start read all the check sum files on disk and pull them into memory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

instance

public static ChecksumManager instance(java.lang.String dataFile)
                                throws java.io.IOException
Throws:
java.io.IOException

instance

public static ChecksumManager instance(java.lang.String dataFile,
                                       java.lang.String chkSumFile)
                                throws java.io.IOException
Throws:
java.io.IOException

isChecksumFile

public static boolean isChecksumFile(java.lang.String file)
This method returns true if the file specified is a checksum file and false otherwise.

Parameters:
file - we are interested in.
Returns:
true if checksum file false otherwise.

onStart

public static void onStart()
                    throws java.io.IOException
On start read all the check sum files on disk and pull them into memory.

Throws:
java.io.IOException

onFileDelete

public static void onFileDelete(java.lang.String dataFile)
                         throws java.io.IOException
On delete of this dataFile remove the checksums associated with this file from memory, remove the check sum manager instance.

Parameters:
dataFile - data file that is being deleted.
Throws:
java.io.IOException

getFileId

public static int getFileId(java.lang.String file)

main

public static void main(java.lang.String[] args)
                 throws java.lang.Throwable
Throws:
java.lang.Throwable


Copyright © 2009 The Apache Software Foundation