|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.basex.index.value.DiskValues
public class DiskValues
This class provides access to attribute values and text contents stored on
disk. The data structure is described in the ValueIndexBuilder
class.
Field Summary | |
---|---|
protected IndexCache |
cache
Cached tokens. |
protected IntObjMap<byte[]> |
ctext
Cached texts. |
protected Data |
data
Data reference. |
protected DataAccess |
idxl
ID lists. |
protected DataAccess |
idxr
ID references. |
protected java.lang.Object |
monitor
Synchronization object. |
protected java.util.concurrent.atomic.AtomicInteger |
size
Number of current index entries. |
protected boolean |
text
Value type (texts/attributes). |
Constructor Summary | |
---|---|
|
DiskValues(Data d,
boolean txt)
Constructor, initializing the index structure. |
protected |
DiskValues(Data d,
boolean txt,
java.lang.String pref)
Constructor, initializing the index structure. |
Method Summary | |
---|---|
void |
close()
Closes the index. |
int |
count(IndexToken it)
Returns the (approximate/estimated) number of hits for the specified token. |
void |
delete(TokenObjMap<IntList> m)
Delete records from the index. |
EntryIterator |
entries(IndexEntries input)
Returns all entries that match the specified token. |
void |
flush()
Flushes the buffered data. |
protected int |
get(byte[] key)
Binary search for key in the idxr . |
protected int |
get(byte[] key,
int first,
int last)
Binary search for key in the idxr . |
protected IndexIterator |
idRange(NumericRange tok)
Performs a range query. |
void |
index(TokenObjMap<IntList> m)
Add entries to the index. |
byte[] |
info()
Returns information on the index structure. |
void |
init()
Initializes the index. |
IndexIterator |
iter(IndexToken it)
Returns an iterator for the index results. |
protected static IndexIterator |
iter(IntList ids)
Returns an iterator for the specified id list. |
protected int |
pre(int id)
Returns the pre value for the specified id. |
void |
replace(byte[] o,
byte[] n,
int id)
Remove record from the index. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final DataAccess idxr
protected final DataAccess idxl
protected final boolean text
protected final Data data
protected final IndexCache cache
protected final IntObjMap<byte[]> ctext
protected final java.lang.Object monitor
protected final java.util.concurrent.atomic.AtomicInteger size
Constructor Detail |
---|
public DiskValues(Data d, boolean txt) throws java.io.IOException
d
- data referencetxt
- value type (texts/attributes)
java.io.IOException
- I/O Exceptionprotected DiskValues(Data d, boolean txt, java.lang.String pref) throws java.io.IOException
d
- data referencetxt
- value type (texts/attributes)pref
- file prefix
java.io.IOException
- I/O ExceptionMethod Detail |
---|
public void init()
Index
init
in interface Index
public byte[] info()
Index
info
in interface Index
public int count(IndexToken it)
Index
count
in interface Index
it
- token to be found
public IndexIterator iter(IndexToken it)
Index
iter
in interface Index
it
- token to be found
public EntryIterator entries(IndexEntries input)
Index
entries
in interface Index
input
- index entries
protected final IndexIterator idRange(NumericRange tok)
Important: This method is thread-safe.
tok
- index term
protected static IndexIterator iter(IntList ids)
ids
- id list
protected int pre(int id)
pre
value for the specified id.
id
- id value
protected int get(byte[] key)
idxr
.
Important: This method is thread-safe.
key
- token to be found
protected int get(byte[] key, int first, int last)
idxr
.
Important: This method is thread-safe.
key
- token to be foundfirst
- begin of the search intervallast
- end of the search interval
public void flush()
public void close()
Index
close
in interface Index
public void index(TokenObjMap<IntList> m)
m
- a set of public void delete(TokenObjMap<IntList> m)
m
- a set of public void replace(byte[] o, byte[] n, int id)
o
- old record keyn
- new record keyid
- record id
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |