提交 1993a074 authored 作者: Thomas Mueller's avatar Thomas Mueller

Formatting

上级 fad0012c
...@@ -326,7 +326,7 @@ public class Insert extends Prepared implements ResultTarget { ...@@ -326,7 +326,7 @@ public class Insert extends Prepared implements ResultTarget {
variableNames.add(key); variableNames.add(key);
session.setVariable(key, list.get(getCurrentRowNumber() - 1)[i].getValue(session)); session.setVariable(key, list.get(getCurrentRowNumber() - 1)[i].getValue(session));
} }
StatementBuilder buff = new StatementBuilder("UPDATE "); StatementBuilder buff = new StatementBuilder("UPDATE ");
buff.append(table.getSQL()).append(" SET "); buff.append(table.getSQL()).append(" SET ");
for (Column column : duplicateKeyAssignmentMap.keySet()) { for (Column column : duplicateKeyAssignmentMap.keySet()) {
...@@ -341,7 +341,7 @@ public class Insert extends Prepared implements ResultTarget { ...@@ -341,7 +341,7 @@ public class Insert extends Prepared implements ResultTarget {
} }
buff.append(prepareUpdateCondition(foundIndex).getSQL()); buff.append(prepareUpdateCondition(foundIndex).getSQL());
String sql = buff.toString(); String sql = buff.toString();
Prepared command = session.prepare(sql); Prepared command = session.prepare(sql);
for (Parameter param : command.getParameters()) { for (Parameter param : command.getParameters()) {
Parameter insertParam = parameters.get(param.getIndex()); Parameter insertParam = parameters.get(param.getIndex());
param.setValue(insertParam.getValue(session)); param.setValue(insertParam.getValue(session));
...@@ -384,11 +384,11 @@ public class Insert extends Prepared implements ResultTarget { ...@@ -384,11 +384,11 @@ public class Insert extends Prepared implements ResultTarget {
for (int i = 0; i < columns.length; i++) { for (int i = 0; i < columns.length; i++) {
if (expr.getColumnName().equals(columns[i].getName())) { if (expr.getColumnName().equals(columns[i].getName())) {
if (condition == null) { if (condition == null) {
condition = new Comparison(session, Comparison.EQUAL, condition = new Comparison(session, Comparison.EQUAL,
expr, list.get(getCurrentRowNumber() - 1)[i++]); expr, list.get(getCurrentRowNumber() - 1)[i++]);
} else { } else {
condition = new ConditionAndOr(ConditionAndOr.AND, condition, condition = new ConditionAndOr(ConditionAndOr.AND, condition,
new Comparison(session, Comparison.EQUAL, new Comparison(session, Comparison.EQUAL,
expr, list.get(0)[i++])); expr, list.get(0)[i++]));
} }
} }
......
...@@ -327,7 +327,7 @@ public class DbSettings extends SettingsBase { ...@@ -327,7 +327,7 @@ public class DbSettings extends SettingsBase {
* Use the MVStore storage engine. * Use the MVStore storage engine.
*/ */
public final boolean mvStore = get("MV_STORE", false); public final boolean mvStore = get("MV_STORE", false);
/** /**
* Database setting <code>COMPRESS</code> * Database setting <code>COMPRESS</code>
* (default: false).<br /> * (default: false).<br />
......
...@@ -1725,7 +1725,7 @@ public class MVStore { ...@@ -1725,7 +1725,7 @@ public class MVStore {
/** /**
* How many versions to retain for in-memory stores. If not set, 5 old * How many versions to retain for in-memory stores. If not set, 5 old
* versions are retained. * versions are retained.
* *
* @param count the number of versions to keep * @param count the number of versions to keep
*/ */
public void setVersionsToKeep(int count) { public void setVersionsToKeep(int count) {
...@@ -2327,7 +2327,7 @@ public class MVStore { ...@@ -2327,7 +2327,7 @@ public class MVStore {
* there is still a small risk that password stays in memory (due to * there is still a small risk that password stays in memory (due to
* Java garbage collection). Also, the hashed encryption key is kept in * Java garbage collection). Also, the hashed encryption key is kept in
* memory as long as the file is open. * memory as long as the file is open.
* *
* @param password the password * @param password the password
* @return this * @return this
*/ */
...@@ -2407,7 +2407,7 @@ public class MVStore { ...@@ -2407,7 +2407,7 @@ public class MVStore {
* that any kind of store (including an off-heap store) is considered a * that any kind of store (including an off-heap store) is considered a
* "persistence", while an "in-memory store" means objects are not * "persistence", while an "in-memory store" means objects are not
* persisted and fully kept in the JVM heap. * persisted and fully kept in the JVM heap.
* *
* @param store the file store * @param store the file store
* @return this * @return this
*/ */
......
...@@ -849,7 +849,7 @@ public class Page { ...@@ -849,7 +849,7 @@ public class Page {
chunk.pageCountLive++; chunk.pageCountLive++;
return typePos + 1; return typePos + 1;
} }
private void writeChildren(WriteBuffer buff) { private void writeChildren(WriteBuffer buff) {
int len = keyCount; int len = keyCount;
for (int i = 0; i <= len; i++) { for (int i = 0; i <= len; i++) {
......
...@@ -1471,7 +1471,7 @@ public class ObjectDataType implements DataType { ...@@ -1471,7 +1471,7 @@ public class ObjectDataType implements DataType {
* The type for serialized objects. * The type for serialized objects.
*/ */
class SerializedObjectType extends AutoDetectDataType { class SerializedObjectType extends AutoDetectDataType {
private int averageSize = 10000; private int averageSize = 10000;
SerializedObjectType(ObjectDataType base) { SerializedObjectType(ObjectDataType base) {
......
...@@ -46,7 +46,8 @@ public class LobStorageMap implements LobStorageInterface { ...@@ -46,7 +46,8 @@ public class LobStorageMap implements LobStorageInterface {
* (which is a long) to the stream store id (which is a byte array). * (which is a long) to the stream store id (which is a byte array).
* *
* Key: lobId (long) * Key: lobId (long)
* Value: { streamStoreId (byte[]), tableId (int), byteCount (long), hash (long) }. * Value: { streamStoreId (byte[]), tableId (int),
* byteCount (long), hash (long) }.
*/ */
private MVMap<Long, Object[]> lobMap; private MVMap<Long, Object[]> lobMap;
......
...@@ -194,7 +194,7 @@ public class TestDuplicateKeyUpdate extends TestBase { ...@@ -194,7 +194,7 @@ public class TestDuplicateKeyUpdate extends TestBase {
ResultSet rs = stat.executeQuery("select count from test where key = 'a'"); ResultSet rs = stat.executeQuery("select count from test where key = 'a'");
rs.next(); rs.next();
assertEquals(3, rs.getInt(1)); assertEquals(3, rs.getInt(1));
stat.execute("drop table test"); stat.execute("drop table test");
} }
...@@ -206,7 +206,7 @@ public class TestDuplicateKeyUpdate extends TestBase { ...@@ -206,7 +206,7 @@ public class TestDuplicateKeyUpdate extends TestBase {
// Insert multiple values in single insert operation // Insert multiple values in single insert operation
for (int i = 0; i <= 2; ++i) { for (int i = 0; i <= 2; ++i) {
PreparedStatement prep = conn.prepareStatement( PreparedStatement prep = conn.prepareStatement(
"insert into test(key, count) values(?, ?), (?, ?), (?, ?) " + "insert into test(key, count) values(?, ?), (?, ?), (?, ?) " +
"on duplicate key update count = count + 1"); "on duplicate key update count = count + 1");
prep.setString(1, "a"); prep.setString(1, "a");
prep.setInt(2, 1); prep.setInt(2, 1);
...@@ -222,7 +222,7 @@ public class TestDuplicateKeyUpdate extends TestBase { ...@@ -222,7 +222,7 @@ public class TestDuplicateKeyUpdate extends TestBase {
ResultSet rs = stat.executeQuery("select count from test where key = 'a'"); ResultSet rs = stat.executeQuery("select count from test where key = 'a'");
rs.next(); rs.next();
assertEquals(3, rs.getInt(1)); assertEquals(3, rs.getInt(1));
stat.execute("drop table test"); stat.execute("drop table test");
} }
......
...@@ -106,7 +106,7 @@ public class TestMVStore extends TestBase { ...@@ -106,7 +106,7 @@ public class TestMVStore extends TestBase {
// longer running tests // longer running tests
testLargerThan2G(); testLargerThan2G();
} }
private void testCompressEmptyPage() { private void testCompressEmptyPage() {
String fileName = getBaseDir() + "/testDeletedMap.h3"; String fileName = getBaseDir() + "/testDeletedMap.h3";
MVStore store = new MVStore.Builder(). MVStore store = new MVStore.Builder().
...@@ -123,7 +123,7 @@ public class TestMVStore extends TestBase { ...@@ -123,7 +123,7 @@ public class TestMVStore extends TestBase {
open(); open();
store.close(); store.close();
} }
private void testCompressed() { private void testCompressed() {
String fileName = getBaseDir() + "/testCompressed.h3"; String fileName = getBaseDir() + "/testCompressed.h3";
MVStore s = new MVStore.Builder().fileName(fileName).compressData().open(); MVStore s = new MVStore.Builder().fileName(fileName).compressData().open();
...@@ -214,7 +214,7 @@ public class TestMVStore extends TestBase { ...@@ -214,7 +214,7 @@ public class TestMVStore extends TestBase {
} }
} }
} }
private void testVersionsToKeep2() { private void testVersionsToKeep2() {
MVStore s = new MVStore.Builder().autoCommitDisabled().open(); MVStore s = new MVStore.Builder().autoCommitDisabled().open();
s.setVersionsToKeep(2); s.setVersionsToKeep(2);
...@@ -1130,7 +1130,7 @@ public class TestMVStore extends TestBase { ...@@ -1130,7 +1130,7 @@ public class TestMVStore extends TestBase {
// System.out.println("size: " + FileUtils.size(fileName)); // System.out.println("size: " + FileUtils.size(fileName));
} }
} }
private void testOldVersion() { private void testOldVersion() {
MVStore s; MVStore s;
for (int op = 0; op <= 1; op++) { for (int op = 0; op <= 1; op++) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论