提交 ac913fb4 authored 作者: Thomas Mueller's avatar Thomas Mueller

Documentation.

上级 43701f3f
...@@ -138,7 +138,7 @@ should never be used for columns with a maximum size below about 200 bytes. ...@@ -138,7 +138,7 @@ should never be used for columns with a maximum size below about 200 bytes.
The best threshold depends on the use case; reading in-place objects is faster The best threshold depends on the use case; reading in-place objects is faster
than reading from separate files, but slows down the performance of operations than reading from separate files, but slows down the performance of operations
that don't involve this column. that don't involve this column.
<p> </p><p>
It is possible to configure the database to store LOB objects outside the database file, It is possible to configure the database to store LOB objects outside the database file,
see the <a href="../javadoc/org/h2/constant/SysProperties.html#h2.lobInDatabase">h2.lobInDatabase</a> property. see the <a href="../javadoc/org/h2/constant/SysProperties.html#h2.lobInDatabase">h2.lobInDatabase</a> property.
</p> </p>
......
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.
...@@ -96,8 +96,8 @@ public class CreateView extends SchemaCommand { ...@@ -96,8 +96,8 @@ public class CreateView extends SchemaCommand {
} }
querySQL = select.getPlanSQL(); querySQL = select.getPlanSQL();
} }
// The view creates a Prepared command object, which belongs to a session, so we pass // The view creates a Prepared command object, which belongs to a
// the system session down. // session, so we pass the system session down.
Session sysSession = db.getSystemSession(); Session sysSession = db.getSystemSession();
try { try {
if (view == null) { if (view == null) {
......
...@@ -45,7 +45,8 @@ public class LobStorageFrontend implements LobStorageInterface { ...@@ -45,7 +45,8 @@ public class LobStorageFrontend implements LobStorageInterface {
*/ */
@Override @Override
public void removeLob(long lob) { public void removeLob(long lob) {
// TODO this should not be called at all, but that's a refactoring for another day // TODO this should not be called at all,
// but that's a refactoring for another day
} }
/** /**
......
...@@ -54,7 +54,8 @@ public interface LobStorageInterface { ...@@ -54,7 +54,8 @@ public interface LobStorageInterface {
* @param byteCount the number of bytes to read, or -1 if not known * @param byteCount the number of bytes to read, or -1 if not known
* @return the stream * @return the stream
*/ */
InputStream getInputStream(long lobId, byte[] hmac, long byteCount) throws IOException; InputStream getInputStream(long lobId, byte[] hmac, long byteCount)
throws IOException;
/** /**
* Set the table reference of this lob. * Set the table reference of this lob.
......
/*
* Copyright 2004-2013 H2 Group. Multiple-Licensed under the H2 License,
* Version 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
*/
package org.h2.store; package org.h2.store;
import java.io.IOException; import java.io.IOException;
......
...@@ -265,8 +265,8 @@ public class SourceCompiler { ...@@ -265,8 +265,8 @@ public class SourceCompiler {
/** /**
* Access the groovy compiler using reflection, so that we do not gain a compile-time dependency * Access the Groovy compiler using reflection, so that we do not gain a
* unnecessarily. * compile-time dependency unnecessarily.
*/ */
private static final class GroovyCompiler { private static final class GroovyCompiler {
private static final Object LOADER; private static final Object LOADER;
...@@ -279,12 +279,13 @@ public class SourceCompiler { ...@@ -279,12 +279,13 @@ public class SourceCompiler {
// create an instance of ImportCustomizer // create an instance of ImportCustomizer
Class<?> importCustomizerClass = Class.forName("org.codehaus.groovy.control.customizers.ImportCustomizer"); Class<?> importCustomizerClass = Class.forName("org.codehaus.groovy.control.customizers.ImportCustomizer");
Object importCustomizer = Utils.newInstance("org.codehaus.groovy.control.customizers.ImportCustomizer"); Object importCustomizer = Utils.newInstance("org.codehaus.groovy.control.customizers.ImportCustomizer");
// Call the method ImportCustomizer#addImports(String[]) // Call the method ImportCustomizer.addImports(String[])
String[] importsArray = new String[] { "java.sql.Connection", "java.sql.Types", "java.sql.ResultSet", String[] importsArray = new String[] { "java.sql.Connection", "java.sql.Types", "java.sql.ResultSet",
"groovy.sql.Sql", "org.h2.tools.SimpleResultSet" }; "groovy.sql.Sql", "org.h2.tools.SimpleResultSet" };
Utils.callMethod(importCustomizer, "addImports", new Object[] { importsArray }); Utils.callMethod(importCustomizer, "addImports", new Object[] { importsArray });
// Call the method CompilerConfiguration#addCompilationCustomizers(ImportCustomizer...) // Call the method
// CompilerConfiguration.addCompilationCustomizers(ImportCustomizer...)
Object importCustomizerArray = java.lang.reflect.Array.newInstance(importCustomizerClass, 1); Object importCustomizerArray = java.lang.reflect.Array.newInstance(importCustomizerClass, 1);
java.lang.reflect.Array.set(importCustomizerArray, 0, importCustomizer); java.lang.reflect.Array.set(importCustomizerArray, 0, importCustomizer);
Object configuration = Utils.newInstance("org.codehaus.groovy.control.CompilerConfiguration"); Object configuration = Utils.newInstance("org.codehaus.groovy.control.CompilerConfiguration");
......
...@@ -31,7 +31,8 @@ import org.h2.util.StringUtils; ...@@ -31,7 +31,8 @@ import org.h2.util.StringUtils;
import org.h2.util.Utils; import org.h2.util.Utils;
/** /**
* An alternate LOB implementation, where LOB data is stored inside the database, instead of in external files. * An alternate LOB implementation, where LOB data is stored inside the
* database, instead of in external files.
*/ */
public class ValueLobDb extends Value implements Value.ValueClob, Value.ValueBlob { public class ValueLobDb extends Value implements Value.ValueClob, Value.ValueBlob {
...@@ -504,7 +505,8 @@ public class ValueLobDb extends Value implements Value.ValueClob, Value.ValueBlo ...@@ -504,7 +505,8 @@ public class ValueLobDb extends Value implements Value.ValueClob, Value.ValueBlo
} }
} }
private void createTempFromStream(byte[] buff, int len, InputStream in, long remaining, DataHandler h) throws IOException { private void createTempFromStream(byte[] buff, int len, InputStream in,
long remaining, DataHandler h) throws IOException {
FileStoreOutputStream out = initTemp(h); FileStoreOutputStream out = initTemp(h);
boolean compress = h.getLobCompressionAlgorithm(Value.BLOB) != null; boolean compress = h.getLobCompressionAlgorithm(Value.BLOB) != null;
try { try {
......
...@@ -100,8 +100,10 @@ public class TestCluster extends TestBase { ...@@ -100,8 +100,10 @@ public class TestCluster extends TestBase {
String url2 = "jdbc:h2:tcp://localhost:" + port2 + "/test"; String url2 = "jdbc:h2:tcp://localhost:" + port2 + "/test";
String urlCluster = "jdbc:h2:tcp://" + serverList + "/test"; String urlCluster = "jdbc:h2:tcp://" + serverList + "/test";
Server server1 = org.h2.tools.Server.createTcpServer("-tcpPort", "" + port1, "-baseDir", getBaseDir() + "/node1").start(); Server server1 = org.h2.tools.Server.createTcpServer(
Server server2 = org.h2.tools.Server.createTcpServer("-tcpPort", "" + port2 , "-baseDir", getBaseDir() + "/node2").start(); "-tcpPort", "" + port1, "-baseDir", getBaseDir() + "/node1").start();
Server server2 = org.h2.tools.Server.createTcpServer(
"-tcpPort", "" + port2 , "-baseDir", getBaseDir() + "/node2").start();
CreateCluster.main("-urlSource", url1, "-urlTarget", url2, "-user", user, "-password", password, "-serverList", CreateCluster.main("-urlSource", url1, "-urlTarget", url2, "-user", user, "-password", password, "-serverList",
serverList); serverList);
......
...@@ -95,21 +95,6 @@ int test; ...@@ -95,21 +95,6 @@ int test;
PreparedStatement prep = conn PreparedStatement prep = conn
.prepareStatement("insert into test values(?, ?)"); .prepareStatement("insert into test values(?, ?)");
// -mx4g
// fast size
// 10 / 800000
// 1272 mvstore;LOCK_MODE=0 before
// 1449 mvstore;LOCK_MODE=0 after
// 1076 mvstore;DEFAULT_TABLE_ENGINE=org.h2.mvstore.db.MVTableEngine;LOCK_MODE=0;LOG=0 before
// 1086 mvstore;DEFAULT_TABLE_ENGINE=org.h2.mvstore.db.MVTableEngine;LOCK_MODE=0;LOG=0 after
// 100 / 800000
// 2010 mvstore;LOCK_MODE=0 before
// 2261 mvstore;LOCK_MODE=0 after
// 1536 mvstore;DEFAULT_TABLE_ENGINE=org.h2.mvstore.db.MVTableEngine;LOCK_MODE=0;LOG=0 before
// 1546 mvstore;DEFAULT_TABLE_ENGINE=org.h2.mvstore.db.MVTableEngine;LOCK_MODE=0;LOG=0 after
prep.setString(2, new String(new char[10]).replace((char) 0, 'x')); prep.setString(2, new String(new char[10]).replace((char) 0, 'x'));
// for (int i = 0; i < 20000; i++) { // for (int i = 0; i < 20000; i++) {
for (int i = 0; i < 800000; i++) { for (int i = 0; i < 800000; i++) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论