ostore.archive
Class TputGenerateChkptTest.RemoveGuidsHelper

java.lang.Object
  |
  +--ostore.archive.TputGenerateChkptTest.RemoveGuidsHelper
All Implemented Interfaces:
Btree.Callback, Btree.Predicate, Btree.Record
Enclosing class:
TputGenerateChkptTest

public static class TputGenerateChkptTest.RemoveGuidsHelper
extends Object
implements Btree.Callback, Btree.Predicate, Btree.Record

RemoveGuidsHelper removes guids from all previously 'archived' blocks. RemoveGuidsHelper predicate methods test whether to continue descending btree (in DFS order), then call the callback method. The callback method removes the guids. NOTE all blocks should be in cache. If not, we Carp.die.


Constructor Summary
TputGenerateChkptTest.RemoveGuidsHelper(SecureHash versionVHash, DataCache cache, String stageName, SecureHash self_guid, NodeId nodeId)
          Constructor: Initialize class based on specified parameters.
 
Method Summary
 Object callback(BtreeNode node, HandleStore handleStore)
          callback remove child guid pointers and remove fhash from child block.
 boolean predicate(BtreeNode inNode, int index, HandleStore handleStore)
          predicate is a boolean function that determines whether or not RemoveGuidsHelper will continue down the current path in the B-tree.
 void record(BtreeNode node, Object returnObj, int index, HandleStore handleStore, DataCache cache)
          During a DFS, this method is called to record a result produced by the Callback interface.
 void reset(SecureHash versionVHash, DataCache cache, String stageName, SecureHash self_guid, NodeId node_id)
          reset versionVHash.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TputGenerateChkptTest.RemoveGuidsHelper

public TputGenerateChkptTest.RemoveGuidsHelper(SecureHash versionVHash,
                                               DataCache cache,
                                               String stageName,
                                               SecureHash self_guid,
                                               NodeId nodeId)
Constructor: Initialize class based on specified parameters.

Parameters:
versionVHash - version VHash for update.
Method Detail

reset

public void reset(SecureHash versionVHash,
                  DataCache cache,
                  String stageName,
                  SecureHash self_guid,
                  NodeId node_id)
reset versionVHash.

Parameters:
versionVHash - version VHash for object.

callback

public Object callback(BtreeNode node,
                       HandleStore handleStore)
                throws CacheException
callback remove child guid pointers and remove fhash from child block.

Specified by:
callback in interface Btree.Callback
Parameters:
node - current block.
handleStore - data structure that stores handles to blocks.
Returns:
any object that needs to be recorded by the record method. Currently the callback returns null.
CacheException

predicate

public boolean predicate(BtreeNode inNode,
                         int index,
                         HandleStore handleStore)
                  throws CacheException
predicate is a boolean function that determines whether or not RemoveGuidsHelper will continue down the current path in the B-tree. Specifically, this returns true iff the Block in question has no GUID.

Specified by:
predicate in interface Btree.Predicate
Parameters:
inNode - current block of type BtreeNode.
index - index of child block to test.
handleStore - data structure that stores handles to blocks.
Returns:
true iff the Block in question has no GUID.
CacheException

record

public void record(BtreeNode node,
                   Object returnObj,
                   int index,
                   HandleStore handleStore,
                   DataCache cache)
During a DFS, this method is called to record a result produced by the Callback interface. When using dfsPreorder, this method is called when a node is entered. When using dfsPostorder, this method is called just before a node is left.

Specified by:
record in interface Btree.Record
Parameters:
node - = variable of type BtreeNode.
returnObj - = the returned obj from the callback routine.
index - = index of child node.
handleStore - =HandleStore handle_store);