Modifier and Type | Class and Description |
---|---|
private class |
Table.rowIterator |
private class |
Table.rowIteratorNoOrder |
static class |
Table.StatKeys |
Modifier and Type | Field and Description |
---|---|
private int |
buffersize |
private BufferedRecords |
file |
private HandleMap |
index |
private static ConcurrentLog |
log |
private static long |
maxarraylength |
private long |
minmemremaining |
private Row |
rowdef |
private RowSet |
table |
private static java.util.TreeMap<java.lang.String,Table> |
tableTracker |
private Row |
taildef |
Constructor and Description |
---|
Table(java.io.File tablefile,
Row rowdef,
int buffersize,
int initialSpace,
boolean useTailCache,
boolean exceed134217727,
boolean warmUp) |
Modifier and Type | Method and Description |
---|---|
private boolean |
abandonTable() |
void |
addUnique(java.util.List<Row.Entry> rows) |
void |
addUnique(Row.Entry row) |
static void |
bigtest(int elements,
java.io.File testFile,
boolean useTailCache,
boolean exceed134217727) |
void |
clear() |
void |
close() |
boolean |
consistencyCheck() |
private static int |
countElements(Table t) |
boolean |
delete(byte[] key) |
void |
deleteOnExit() |
java.lang.String |
filename() |
static java.util.Iterator<java.lang.String> |
filenames() |
protected void |
finalize() |
Row.Entry |
get(byte[] key,
boolean _forcecopy) |
java.util.Map<byte[],Row.Entry> |
get(java.util.Collection<byte[]> keys,
boolean forcecopy) |
private Row.Entry |
get0(byte[] key) |
boolean |
has(byte[] key) |
boolean |
isEmpty() |
java.util.Iterator<Row.Entry> |
iterator() |
CloneableIterator<byte[]> |
keys(boolean up,
byte[] firstKey) |
byte[] |
largestKey() |
static void |
main(java.lang.String[] args) |
long |
mem() |
private java.util.Map<Table.StatKeys,java.lang.String> |
memoryStats() |
static java.util.Map<Table.StatKeys,java.lang.String> |
memoryStats(java.lang.String filename) |
void |
optimize() |
private static java.lang.String[] |
permutations(int letters) |
private static java.lang.String[] |
permutations(java.lang.String source) |
void |
print() |
boolean |
put(Row.Entry row)
Adds the row to the index.
|
java.util.List<Row.Entry> |
random(int count) |
Row.Entry |
remove(byte[] key) |
java.util.List<RowCollection> |
removeDoubles() |
private void |
removeInFile(int i)
remove one entry from the file
|
Row.Entry |
removeOne() |
Row.Entry |
replace(Row.Entry row) |
Row |
row() |
CloneableIterator<Row.Entry> |
rows() |
CloneableIterator<Row.Entry> |
rows(boolean up,
byte[] firstKey) |
int |
size() |
byte[] |
smallestKey() |
static long |
staticRAMIndexNeed(java.io.File f,
Row rowdef) |
static long |
tableSize(java.io.File tablefile,
int recordsize,
boolean fixIfCorrupted) |
private static Table |
testTable(java.io.File f,
java.lang.String testentities,
boolean useTailCache,
boolean exceed134217727) |
private static byte[] |
testWord(char c) |
java.util.List<Row.Entry> |
top(int count) |
boolean |
usesFullCopy() |
void |
warmUp() |
private void |
warmUp0() |
private static final ConcurrentLog log
private static final java.util.TreeMap<java.lang.String,Table> tableTracker
private static final long maxarraylength
private final long minmemremaining
private final int buffersize
private final Row rowdef
private final Row taildef
private HandleMap index
private BufferedRecords file
private RowSet table
public Table(java.io.File tablefile, Row rowdef, int buffersize, int initialSpace, boolean useTailCache, boolean exceed134217727, boolean warmUp) throws SpaceExceededException, kelondroException
public void warmUp()
private void warmUp0()
private boolean abandonTable()
public byte[] smallestKey()
smallestKey
in interface Index
public byte[] largestKey()
largestKey
in interface Index
public static long tableSize(java.io.File tablefile, int recordsize, boolean fixIfCorrupted) throws kelondroException
kelondroException
public static final java.util.Iterator<java.lang.String> filenames()
public static final java.util.Map<Table.StatKeys,java.lang.String> memoryStats(java.lang.String filename)
private final java.util.Map<Table.StatKeys,java.lang.String> memoryStats()
public boolean usesFullCopy()
public static long staticRAMIndexNeed(java.io.File f, Row rowdef)
public boolean consistencyCheck()
public void addUnique(Row.Entry row) throws java.io.IOException, SpaceExceededException
addUnique
in interface Index
java.io.IOException
SpaceExceededException
public void addUnique(java.util.List<Row.Entry> rows) throws java.io.IOException, SpaceExceededException
java.io.IOException
SpaceExceededException
public java.util.List<RowCollection> removeDoubles() throws java.io.IOException, SpaceExceededException
removeDoubles
in interface Index
SpaceExceededException
- remove double-entries from the table
this process calls the underlying removeDoubles() method from the table index
and
java.io.IOException
protected void finalize()
finalize
in class java.lang.Object
public Row.Entry get(byte[] key, boolean _forcecopy) throws java.io.IOException
private Row.Entry get0(byte[] key) throws java.io.IOException
java.io.IOException
public java.util.Map<byte[],Row.Entry> get(java.util.Collection<byte[]> keys, boolean forcecopy) throws java.io.IOException, java.lang.InterruptedException
public CloneableIterator<byte[]> keys(boolean up, byte[] firstKey) throws java.io.IOException
public Row.Entry replace(Row.Entry row) throws java.io.IOException, SpaceExceededException
replace
in interface Index
java.io.IOException
SpaceExceededException
public boolean put(Row.Entry row) throws java.io.IOException, SpaceExceededException
put
in interface Index
row
- a index rowjava.io.IOException
SpaceExceededException
private void removeInFile(int i) throws java.io.IOException, SpaceExceededException
i
- an index position within the file (not a byte position)java.io.IOException
SpaceExceededException
public boolean delete(byte[] key) throws java.io.IOException
public Row.Entry remove(byte[] key) throws java.io.IOException
public Row.Entry removeOne() throws java.io.IOException
public java.util.List<Row.Entry> top(int count) throws java.io.IOException
public java.util.List<Row.Entry> random(int count) throws java.io.IOException
public void clear() throws java.io.IOException
public java.util.Iterator<Row.Entry> iterator()
public CloneableIterator<Row.Entry> rows() throws java.io.IOException
public CloneableIterator<Row.Entry> rows(boolean up, byte[] firstKey) throws java.io.IOException
private static byte[] testWord(char c)
private static java.lang.String[] permutations(int letters)
private static java.lang.String[] permutations(java.lang.String source)
private static Table testTable(java.io.File f, java.lang.String testentities, boolean useTailCache, boolean exceed134217727) throws java.io.IOException, SpaceExceededException
java.io.IOException
SpaceExceededException
private static int countElements(Table t)
public static void bigtest(int elements, java.io.File testFile, boolean useTailCache, boolean exceed134217727)
public void print() throws java.io.IOException
java.io.IOException
public static void main(java.lang.String[] args)
public void deleteOnExit()
deleteOnExit
in interface Index