DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
Deveel.Data.Caching.TableCellCache.Cache Class Reference
Inheritance diagram for Deveel.Data.Caching.TableCellCache.Cache:
Deveel.Data.Caching.CacheAdapter Deveel.Data.Caching.CacheAdapter Deveel.Data.Caching.Cache Deveel.Data.Caching.Cache Deveel.Data.Caching.ICache Deveel.Data.Caching.ICache

Public Member Functions

 Cache (TableCellCache tableCache, ICache baseCache, int hashSize, int maxSize)
 
void ChangeSize (int newSize)
 
 Cache (TableCellCache tableCache, ICache baseCache, int hashSize, int maxSize)
 
void ChangeSize (int newSize)
 
- Public Member Functions inherited from Deveel.Data.Caching.CacheAdapter
 CacheAdapter (ICache baseCache)
 
override void Clear ()
 Clear the cache of all the entries. More...
 
- Public Member Functions inherited from Deveel.Data.Caching.Cache
bool Set (object key, object value)
 Puts an object into the cache with the given key. More...
 
bool TryGet (object key, out object value)
 Tries to get an object for the given key from the underlying cache system. More...
 
object Remove (Object key)
 Removes a node for the given key from the cache. More...
 
void Dispose ()
 
- Public Member Functions inherited from Deveel.Data.Caching.ICache
object Remove (object key)
 Removes an object from the cache. More...
 

Protected Member Functions

override void CheckClean ()
 This is called whenever at object is put into the cache. More...
 
override bool WipeMoreNodes ()
 Checks if the clean-up method should clean up more elements from the cache. More...
 
override void OnWipingNode (object ob)
 Notifies that the given object has been wiped from the cache by the clean up procedure. More...
 
override void OnGetWalks (long totalWalks, long totalGetOps)
 Notifies that some statistical information about the hash map has updated. More...
 
override void CheckClean ()
 This is called whenever at object is put into the cache. More...
 
override bool WipeMoreNodes ()
 Checks if the clean-up method should clean up more elements from the cache. More...
 
override void OnWipingNode (object ob)
 Notifies that the given object has been wiped from the cache by the clean up procedure. More...
 
override void OnGetWalks (long totalWalks, long totalGetOps)
 Notifies that some statistical information about the hash map has updated. More...
 
- Protected Member Functions inherited from Deveel.Data.Caching.CacheAdapter
override bool SetObject (object key, object value)
 When overridden in a derived class, it sets the value for the key given. More...
 
override bool TryGetObject (object key, out object value)
 
override object RemoveObject (object key)
 
- Protected Member Functions inherited from Deveel.Data.Caching.Cache
 Cache ()
 
virtual void OnObjectAdded (object key, object value)
 Notifies that the given object and key has been added to the cache. More...
 
virtual void OnObjectRemoved (object key, Object value)
 Notifies that the given object and key has been removed from the cache. More...
 
virtual void OnAllCleared ()
 Notifies that the cache has been entirely cleared of all elements. More...
 
virtual int Clean ()
 Cleans away some old elements in the cache. More...
 
virtual void Dispose (bool disposing)
 

Private Attributes

readonly TableCellCache tableCache
 
int hashSize
 

Additional Inherited Members

- Static Public Member Functions inherited from Deveel.Data.Caching.Cache
static int ClosestPrime (int value)
 
- Properties inherited from Deveel.Data.Caching.CacheAdapter
ICache BaseCache [get, private set]
 
- Properties inherited from Deveel.Data.Caching.Cache
virtual int NodeCount [get]
 Gets the number of nodes that are currently being stored in the cache. More...
 

Detailed Description

Definition at line 160 of file TableCellCache.cs.

Constructor & Destructor Documentation

Deveel.Data.Caching.TableCellCache.Cache.Cache ( TableCellCache  tableCache,
ICache  baseCache,
int  hashSize,
int  maxSize 
)
inline

Definition at line 164 of file TableCellCache.cs.

165  : base(baseCache) {
166  this.tableCache = tableCache;
167  this.hashSize = hashSize;
168  }
Deveel.Data.Caching.TableCellCache.Cache.Cache ( TableCellCache  tableCache,
ICache  baseCache,
int  hashSize,
int  maxSize 
)
inline

Definition at line 130 of file TableCellCache.old.cs.

131  : base(baseCache, maxSize) {
132  this.tableCache = tableCache;
133  this.hashSize = hashSize;
134  }

Member Function Documentation

void Deveel.Data.Caching.TableCellCache.Cache.ChangeSize ( int  newSize)
inline

Definition at line 136 of file TableCellCache.old.cs.

136  {
137  hashSize = newSize;
138  CheckClean();
139  }
override void CheckClean()
This is called whenever at object is put into the cache.
void Deveel.Data.Caching.TableCellCache.Cache.ChangeSize ( int  newSize)
inline

Definition at line 170 of file TableCellCache.cs.

170  {
171  hashSize = newSize;
172  CheckClean();
173  }
override void CheckClean()
This is called whenever at object is put into the cache.
override void Deveel.Data.Caching.TableCellCache.Cache.CheckClean ( )
inlineprotectedvirtual

This is called whenever at object is put into the cache.

This method should determine if the cache should be cleaned and call the clean method if appropriate.

Reimplemented from Deveel.Data.Caching.Cache.

Definition at line 141 of file TableCellCache.old.cs.

141  {
142  if (tableCache.Size >= hashSize) {
143  // TODO: Register the statistics
144 
145  Clean();
146 
147  //TODO: Register the statistics
148  }
149  }
virtual int Clean()
Cleans away some old elements in the cache.
Definition: Cache.cs:204
override void Deveel.Data.Caching.TableCellCache.Cache.CheckClean ( )
inlineprotectedvirtual

This is called whenever at object is put into the cache.

This method should determine if the cache should be cleaned and call the clean method if appropriate.

Reimplemented from Deveel.Data.Caching.Cache.

Definition at line 175 of file TableCellCache.cs.

175  {
176  if (tableCache.Size >= hashSize) {
177  // TODO: Register the statistics
178 
179  Clean();
180 
181  //TODO: Register the statistics
182  }
183  }
virtual int Clean()
Cleans away some old elements in the cache.
Definition: Cache.cs:204
override void Deveel.Data.Caching.TableCellCache.Cache.OnGetWalks ( long  totalWalks,
long  totalGetOps 
)
inlineprotectedvirtual

Notifies that some statistical information about the hash map has updated.

Parameters
totalWalks
totalGetOps

This should be used to compile statistical information about the number of walks a get operation takes to retreive an entry from the hash.

This method is called every 8192 gets.

Reimplemented from Deveel.Data.Caching.Cache.

Definition at line 163 of file TableCellCache.old.cs.

163  {
164  // TODO: Register the statistics ...
165  base.OnGetWalks(totalWalks, totalGetOps);
166  }
override void Deveel.Data.Caching.TableCellCache.Cache.OnGetWalks ( long  totalWalks,
long  totalGetOps 
)
inlineprotectedvirtual

Notifies that some statistical information about the hash map has updated.

Parameters
totalWalks
totalGetOps

This should be used to compile statistical information about the number of walks a get operation takes to retreive an entry from the hash.

This method is called every 8192 gets.

Reimplemented from Deveel.Data.Caching.Cache.

Definition at line 197 of file TableCellCache.cs.

197  {
198  // TODO: Register the statistics ...
199  base.OnGetWalks(totalWalks, totalGetOps);
200  }
override void Deveel.Data.Caching.TableCellCache.Cache.OnWipingNode ( object  value)
inlineprotectedvirtual

Notifies that the given object has been wiped from the cache by the clean up procedure.

Parameters
valueThe node value being wiped.

Reimplemented from Deveel.Data.Caching.Cache.

Definition at line 155 of file TableCellCache.old.cs.

155  {
156  base.OnWipingNode(ob);
157 
158  // Update our memory indicator accordingly.
159  var value = (DataObject)ob;
161  }
static int AmountMemory(DataObject value)
override void Deveel.Data.Caching.TableCellCache.Cache.OnWipingNode ( object  value)
inlineprotectedvirtual

Notifies that the given object has been wiped from the cache by the clean up procedure.

Parameters
valueThe node value being wiped.

Reimplemented from Deveel.Data.Caching.Cache.

Definition at line 189 of file TableCellCache.cs.

189  {
190  base.OnWipingNode(ob);
191 
192  // Update our memory indicator accordingly.
193  var value = (DataObject)ob;
195  }
static int AmountMemory(DataObject value)
override bool Deveel.Data.Caching.TableCellCache.Cache.WipeMoreNodes ( )
inlineprotectedvirtual

Checks if the clean-up method should clean up more elements from the cache.

Returns
Returns true if the clean-up method that periodically cleans up the cache should clean up more elements from the cache, otherwise false.

Reimplemented from Deveel.Data.Caching.Cache.

Definition at line 151 of file TableCellCache.old.cs.

151  {
152  return (tableCache.Size >= (int)((hashSize * 100L) / 115L));
153  }
override bool Deveel.Data.Caching.TableCellCache.Cache.WipeMoreNodes ( )
inlineprotectedvirtual

Checks if the clean-up method should clean up more elements from the cache.

Returns
Returns true if the clean-up method that periodically cleans up the cache should clean up more elements from the cache, otherwise false.

Reimplemented from Deveel.Data.Caching.Cache.

Definition at line 185 of file TableCellCache.cs.

185  {
186  return (tableCache.Size >= (int)((hashSize * 100L) / 115L));
187  }

Member Data Documentation

int Deveel.Data.Caching.TableCellCache.Cache.hashSize
private

Definition at line 162 of file TableCellCache.cs.

readonly TableCellCache Deveel.Data.Caching.TableCellCache.Cache.tableCache
private

Definition at line 161 of file TableCellCache.cs.


The documentation for this class was generated from the following files: