提交 6c2381e7 authored 作者: Thomas Mueller's avatar Thomas Mueller

Documentation

上级 4712d9f8
...@@ -18,7 +18,7 @@ Change Log ...@@ -18,7 +18,7 @@ Change Log
<h1>Change Log</h1> <h1>Change Log</h1>
<h2>Next Version (unreleased)</h2> <h2>Next Version (unreleased)</h2>
<ul><li>Indexes on column that are larger than half the page size (wide indexes) <ul><li>Indexes on column that are larger than half the page size (wide indexes)
could sometimes get corrupt, resulting in an ArrayIndexOutOfBoundsException in PageBtree.getRow could sometimes get corrupt, resulting in an ArrayIndexOutOfBoundsException in PageBtree.getRow
or "Row not found" in PageBtreeLeaf. Also, such indexes used too much disk space. or "Row not found" in PageBtreeLeaf. Also, such indexes used too much disk space.
</li><li>Server mode: when retrieving more than 64 rows each containing a CLOB or BLOB, </li><li>Server mode: when retrieving more than 64 rows each containing a CLOB or BLOB,
......
...@@ -780,8 +780,9 @@ In a GUI, or in an XML file, only one backslash is required: ...@@ -780,8 +780,9 @@ In a GUI, or in an XML file, only one backslash is required:
/&gt; /&gt;
</pre> </pre>
<p> <p>
Backslashed within the init script (for example within a runscript statement, to specify the folder names in Windows) Backslashes within the init script (for example within a runscript statement, to specify the folder names in Windows)
would need to be escaped as well (using a backslash). It might be simpler to avoid backslashes in folder names for this reason. need to be escaped as well (using a second backslash). It might be simpler to avoid backslashes in folder names for this reason;
use forward slashes instead.
</p> </p>
<h2 id="ignore_unknown_settings">Ignore Unknown Settings</h2> <h2 id="ignore_unknown_settings">Ignore Unknown Settings</h2>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -158,7 +158,7 @@ public class Set extends Prepared { ...@@ -158,7 +158,7 @@ public class Set extends Prepared {
case SetTypes.DB_CLOSE_DELAY: { case SetTypes.DB_CLOSE_DELAY: {
int x = getIntValue(); int x = getIntValue();
if (x == -1) { if (x == -1) {
// -1 is a special value for in-memory databases, // -1 is a special value for in-memory databases,
// which means "keep the DB alive and use the same DB for all connections" // which means "keep the DB alive and use the same DB for all connections"
} else if (x < 0) { } else if (x < 0) {
throw DbException.getInvalidValueException("DB_CLOSE_DELAY", x); throw DbException.getInvalidValueException("DB_CLOSE_DELAY", x);
......
...@@ -698,4 +698,4 @@ minecraft videos youtube dataflyer bukkit alessio adamo jacopo angel leon frost ...@@ -698,4 +698,4 @@ minecraft videos youtube dataflyer bukkit alessio adamo jacopo angel leon frost
deserializing eckenfelder daniel serodio dirname semicolons whose stretch deserializing eckenfelder daniel serodio dirname semicolons whose stretch
stabilize succeeded widening optimise deprecate increasing leaning rotate git stabilize succeeded widening optimise deprecate increasing leaning rotate git
hub rewind spawn shimizu fumiyuki nelson github laird rollover millions hub rewind spawn shimizu fumiyuki nelson github laird rollover millions
ljnelson edugility ljnelson edugility sormula pushed backslashes slashes
\ No newline at end of file \ No newline at end of file
...@@ -300,7 +300,7 @@ public class BtreeMapStore { ...@@ -300,7 +300,7 @@ public class BtreeMapStore {
pageId = r.updatePageIds(pageId); pageId = r.updatePageIds(pageId);
} }
} }
int metaRootOffset = (int) (pageId - getId(blockId, 0)); int metaRootOffset = (int) (pageId - getId(blockId, 0));
// add a dummy entry so the count is correct // add a dummy entry so the count is correct
meta.put("block." + b.id, b.toString()); meta.put("block." + b.id, b.toString());
...@@ -657,7 +657,7 @@ public class BtreeMapStore { ...@@ -657,7 +657,7 @@ public class BtreeMapStore {
* @param string the string to log * @param string the string to log
*/ */
public void log(String string) { public void log(String string) {
// System.out.println(string); // System.out.println(string);
} }
} }
...@@ -32,8 +32,9 @@ class Page { ...@@ -32,8 +32,9 @@ class Page {
* Create a new page. * Create a new page.
* *
* @param map the map * @param map the map
* @param key the keys * @param keys the keys
* @param values the values * @param values the values
* @param children the children
* @return the page * @return the page
*/ */
static Page create(BtreeMap<?, ?> map, Object[] keys, Object[] values, long[] children) { static Page create(BtreeMap<?, ?> map, Object[] keys, Object[] values, long[] children) {
...@@ -111,6 +112,12 @@ class Page { ...@@ -111,6 +112,12 @@ class Page {
this.id = id; this.id = id;
} }
/**
* Get the value for the given key, or null if not found.
*
* @param key the key
* @return the value or null
*/
Object find(Object key) { Object find(Object key) {
int x = findKey(key); int x = findKey(key);
if (children != null) { if (children != null) {
...@@ -148,10 +155,25 @@ class Page { ...@@ -148,10 +155,25 @@ class Page {
* A position in a cursor * A position in a cursor
*/ */
static class CursorPos { static class CursorPos {
/**
* The current page.
*/
Page page; Page page;
/**
* The current index.
*/
int index; int index;
} }
/**
* Go to the first element for the given key.
*
* @param p the current page
* @param parents the stack of parent page positions
* @param key the key
*/
static void min(Page p, ArrayList<CursorPos> parents, Object key) { static void min(Page p, ArrayList<CursorPos> parents, Object key) {
int todo; int todo;
while (p != null) { while (p != null) {
...@@ -180,6 +202,12 @@ class Page { ...@@ -180,6 +202,12 @@ class Page {
} }
} }
/**
* Get the next key.
*
* @param parents the stack of parent page positions
* @return the next key
*/
public static Object nextKey(ArrayList<CursorPos> parents) { public static Object nextKey(ArrayList<CursorPos> parents) {
int todoTest; int todoTest;
if (parents.size() == 0) { if (parents.size() == 0) {
...@@ -390,7 +418,7 @@ class Page { ...@@ -390,7 +418,7 @@ class Page {
return p; return p;
} }
void insert(int index, Object key, Object value, long child) { private void insert(int index, Object key, Object value, long child) {
Object[] newKeys = new Object[keys.length + 1]; Object[] newKeys = new Object[keys.length + 1];
copyWithGap(keys, newKeys, keys.length, index); copyWithGap(keys, newKeys, keys.length, index);
newKeys[index] = key; newKeys[index] = key;
...@@ -409,7 +437,7 @@ class Page { ...@@ -409,7 +437,7 @@ class Page {
} }
} }
void remove(int index) { private void remove(int index) {
Object[] newKeys = new Object[keys.length - 1]; Object[] newKeys = new Object[keys.length - 1];
copyExcept(keys, newKeys, keys.length, index); copyExcept(keys, newKeys, keys.length, index);
keys = newKeys; keys = newKeys;
...@@ -493,10 +521,6 @@ class Page { ...@@ -493,10 +521,6 @@ class Page {
*/ */
int lengthIncludingTempChildren() { int lengthIncludingTempChildren() {
int len = length(); int len = length();
if (len > 1024) {
int test;
System.out.println("??");
}
if (children != null) { if (children != null) {
int size = children.length; int size = children.length;
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++) {
...@@ -509,6 +533,12 @@ if (len > 1024) { ...@@ -509,6 +533,12 @@ if (len > 1024) {
return len; return len;
} }
/**
* Update the page ids recursively.
*
* @param pageId the new page id
* @return the next page id
*/
long updatePageIds(long pageId) { long updatePageIds(long pageId) {
this.storedId = pageId; this.storedId = pageId;
pageId += length(); pageId += length();
...@@ -524,6 +554,12 @@ if (len > 1024) { ...@@ -524,6 +554,12 @@ if (len > 1024) {
return pageId; return pageId;
} }
/**
* Store this page.
*
* @param buff the target buffer
* @return the page id
*/
long storeTemp(ByteBuffer buff) { long storeTemp(ByteBuffer buff) {
write(buff); write(buff);
if (children != null) { if (children != null) {
...@@ -539,6 +575,11 @@ if (len > 1024) { ...@@ -539,6 +575,11 @@ if (len > 1024) {
return id; return id;
} }
/**
* Count the temporary pages recursively.
*
* @return the number of temporary pages
*/
int countTemp() { int countTemp() {
int count = 1; int count = 1;
if (children != null) { if (children != null) {
...@@ -598,8 +639,4 @@ if (len > 1024) { ...@@ -598,8 +639,4 @@ if (len > 1024) {
} }
} }
public Object getKey(int index) {
return keys[index];
}
} }
...@@ -361,7 +361,7 @@ public class TreeMapStore { ...@@ -361,7 +361,7 @@ public class TreeMapStore {
meta.put("map." + m.getName(), String.valueOf(p) + "," + m.getKeyType().getName() + "," + m.getValueType().getName()); meta.put("map." + m.getName(), String.valueOf(p) + "," + m.getKeyType().getName() + "," + m.getValueType().getName());
nodeId = updateId(r, nodeId); nodeId = updateId(r, nodeId);
} }
int metaNodeOffset = (int) (nodeId - getId(blockId, 0)); int metaNodeOffset = (int) (nodeId - getId(blockId, 0));
// add a dummy entry so the count is correct // add a dummy entry so the count is correct
meta.put("block." + b.id, b.toString()); meta.put("block." + b.id, b.toString());
...@@ -710,7 +710,7 @@ public class TreeMapStore { ...@@ -710,7 +710,7 @@ public class TreeMapStore {
* @param string the string to log * @param string the string to log
*/ */
public void log(String string) { public void log(String string) {
// System.out.println(string); // System.out.println(string);
} }
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论