|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.basex.io.random.TableAccess
org.basex.io.random.TableDiskAccess
public final class TableDiskAccess
This class stores the table on disk and reads it block-wise. NOTE: this class is not thread-safe.
Field Summary |
---|
Fields inherited from class org.basex.io.random.TableAccess |
---|
dirty, meta |
Constructor Summary | |
---|---|
TableDiskAccess(MetaData md,
boolean lock)
Constructor. |
Method Summary | |
---|---|
void |
close()
Closes the table access. |
protected void |
copy(byte[] entries,
int pre,
int last)
Copies the specified values into the database. |
void |
delete(int pre,
int nr)
Deletes the specified number of entries from the database. |
void |
flush()
Flushes the table contents. |
void |
insert(int pre,
byte[] entries)
Inserts the specified entries into the database. |
boolean |
lock(boolean lock)
Tries to acquires a lock on the table. |
static boolean |
locked(java.lang.String db,
Context ctx)
Checks if the table of the specified database is locked. |
int |
read1(int pre,
int off)
Reads a byte value and returns it as an integer value. |
int |
read2(int pre,
int off)
Reads a short value and returns it as an integer value. |
int |
read4(int pre,
int off)
Reads an integer value. |
long |
read5(int pre,
int off)
Reads a 5-byte value and returns it as a long value. |
void |
write1(int pre,
int off,
int v)
Writes a byte value to the specified position. |
void |
write2(int pre,
int off,
int v)
Writes a short value to the specified position. |
void |
write4(int pre,
int off,
int v)
Writes an integer value to the specified position. |
void |
write5(int pre,
int off,
long v)
Writes a 5-byte value to the specified position. |
Methods inherited from class org.basex.io.random.TableAccess |
---|
replace, set |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TableDiskAccess(MetaData md, boolean lock) throws java.io.IOException
md
- meta datalock
- exclusive access
java.io.IOException
- I/O exceptionMethod Detail |
---|
public static boolean locked(java.lang.String db, Context ctx)
db
- name of databasectx
- database context
public void flush() throws java.io.IOException
TableAccess
flush
in class TableAccess
java.io.IOException
- I/O exceptionpublic void close() throws java.io.IOException
TableAccess
close
in class TableAccess
java.io.IOException
- I/O exceptionpublic boolean lock(boolean lock)
TableAccess
lock
in class TableAccess
lock
- exclusive/shared lock
public int read1(int pre, int off)
TableAccess
read1
in class TableAccess
pre
- pre valueoff
- offset
public int read2(int pre, int off)
TableAccess
read2
in class TableAccess
pre
- pre valueoff
- offset
public int read4(int pre, int off)
TableAccess
read4
in class TableAccess
pre
- pre valueoff
- offset
public long read5(int pre, int off)
TableAccess
read5
in class TableAccess
pre
- pre valueoff
- offset
public void write1(int pre, int off, int v)
TableAccess
write1
in class TableAccess
pre
- pre valueoff
- offsetv
- value to be writtenpublic void write2(int pre, int off, int v)
TableAccess
write2
in class TableAccess
pre
- pre valueoff
- offsetv
- value to be writtenpublic void write4(int pre, int off, int v)
TableAccess
write4
in class TableAccess
pre
- pre valueoff
- offsetv
- value to be writtenpublic void write5(int pre, int off, long v)
TableAccess
write5
in class TableAccess
pre
- pre valueoff
- offsetv
- value to be writtenprotected void copy(byte[] entries, int pre, int last)
TableAccess
copy
in class TableAccess
entries
- entries to copypre
- first target pre valuelast
- last pre valuepublic void delete(int pre, int nr)
TableAccess
delete
in class TableAccess
pre
- pre value of the first node to deletenr
- number of entries to be deletedpublic void insert(int pre, byte[] entries)
TableAccess
insert
in class TableAccess
pre
- pre valueentries
- array of bytes containing the entries to insert
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |