Mercurial > hg > blitz_condensed
comparison src/org/dancres/blitz/entry/ci/BitCacheLine.java @ 0:3dc0c5604566
Initial checkin of blitz 2.0 fcs - no installer yet.
author | Dan Creswell <dan.creswell@gmail.com> |
---|---|
date | Sat, 21 Mar 2009 11:00:06 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:3dc0c5604566 |
---|---|
1 package org.dancres.blitz.entry.ci; | |
2 | |
3 import java.util.Set; | |
4 import java.util.HashSet; | |
5 | |
6 import java.util.ArrayList; | |
7 import java.util.LinkedList; | |
8 import java.util.List; | |
9 | |
10 import org.dancres.blitz.entry.TupleLocator; | |
11 import org.dancres.blitz.entry.EntrySleeve; | |
12 | |
13 import org.dancres.struct.BitIndex; | |
14 | |
15 /** | |
16 Maintains a list of all entries with the same hashcode for a particular | |
17 field. | |
18 */ | |
19 class BitCacheLine { | |
20 private BitIndex theIndex; | |
21 | |
22 BitCacheLine(int aSize) { | |
23 theIndex = new BitIndex(aSize); | |
24 } | |
25 | |
26 BitIndex getSlots() { | |
27 // return theIndex.copy(); | |
28 /* | |
29 We can afford to return the live reference because anything new | |
30 will be considered a recent write and caught elsewhere. | |
31 | |
32 Anything that moves out of cache and thus we miss will be moving | |
33 down the cache hierarchy which we will also search. Ultimately | |
34 in the worst case we'll find the match on disk. Note that | |
35 WriteBuffer will not flush it's dirty cache (which we search) | |
36 until the entry has been forced to disk. This ensures that we | |
37 cannot chase the Entry through all the caches and ultimately miss | |
38 it. | |
39 */ | |
40 return theIndex; | |
41 } | |
42 | |
43 void insert(EntrySleeve aSleeve, int aSlot) { | |
44 theIndex.set(aSlot); | |
45 } | |
46 | |
47 void remove(EntrySleeve aSleeve, int aSlot) { | |
48 theIndex.clear(aSlot); | |
49 } | |
50 | |
51 int getSize() { | |
52 return theIndex.count(); | |
53 } | |
54 } |