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

Documentation.

上级 341be22e
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.
...@@ -283,10 +283,19 @@ public abstract class Command implements CommandInterface { ...@@ -283,10 +283,19 @@ public abstract class Command implements CommandInterface {
return false; return false;
} }
/**
* Whether the command is already closed (in which case it can be re-used).
*
* @return true if it can be re-used
*/
public boolean canReuse() { public boolean canReuse() {
return canReuse; return canReuse;
} }
/**
* The command is now re-used, therefore reset the canReuse flag, and the
* parameter values.
*/
public void reuse() { public void reuse() {
canReuse = false; canReuse = false;
ArrayList<? extends ParameterInterface> parameters = getParameters(); ArrayList<? extends ParameterInterface> parameters = getParameters();
......
...@@ -598,20 +598,6 @@ public class ConstraintReferential extends Constraint { ...@@ -598,20 +598,6 @@ public class ConstraintReferential extends Constraint {
} }
} }
public boolean containsColumn(Column col) {
for (IndexColumn c : columns) {
if (c.column == col) {
return true;
}
}
for (IndexColumn c : refColumns) {
if (c.column == col) {
return true;
}
}
return false;
}
public boolean isBefore() { public boolean isBefore() {
return false; return false;
} }
......
...@@ -346,8 +346,4 @@ public abstract class FileSystem { ...@@ -346,8 +346,4 @@ public abstract class FileSystem {
*/ */
public abstract String unwrap(String fileName); public abstract String unwrap(String fileName);
protected static FileSystem getFileSystem(String fileName) {
return FileSystem.getInstance(fileName);
}
} }
...@@ -40,8 +40,8 @@ public class FileSystemSplit extends FileSystemWrapper { ...@@ -40,8 +40,8 @@ public class FileSystemSplit extends FileSystemWrapper {
boolean result = false; boolean result = false;
for (int i = 0;; i++) { for (int i = 0;; i++) {
String f = getFileName(fileName, i); String f = getFileName(fileName, i);
if (getFileSystem(f).exists(f)) { if (getInstance(f).exists(f)) {
result = getFileSystem(f).setReadOnly(f); result = getInstance(f).setReadOnly(f);
} else { } else {
break; break;
} }
...@@ -52,12 +52,12 @@ public class FileSystemSplit extends FileSystemWrapper { ...@@ -52,12 +52,12 @@ public class FileSystemSplit extends FileSystemWrapper {
public void copy(String source, String target) { public void copy(String source, String target) {
source = unwrap(source); source = unwrap(source);
target = unwrap(target); target = unwrap(target);
getFileSystem(source).copy(source, target); getInstance(source).copy(source, target);
for (int i = 1;; i++) { for (int i = 1;; i++) {
String o = getFileName(source, i); String o = getFileName(source, i);
if (getFileSystem(o).exists(o)) { if (getInstance(o).exists(o)) {
String c = getFileName(target, i); String c = getFileName(target, i);
getFileSystem(o).copy(o, c); getInstance(o).copy(o, c);
} else { } else {
break; break;
} }
...@@ -68,8 +68,8 @@ public class FileSystemSplit extends FileSystemWrapper { ...@@ -68,8 +68,8 @@ public class FileSystemSplit extends FileSystemWrapper {
fileName = unwrap(fileName); fileName = unwrap(fileName);
for (int i = 0;; i++) { for (int i = 0;; i++) {
String f = getFileName(fileName, i); String f = getFileName(fileName, i);
if (getFileSystem(fileName).exists(f)) { if (getInstance(fileName).exists(f)) {
getFileSystem(fileName).delete(f); getInstance(fileName).delete(f);
} else { } else {
break; break;
} }
...@@ -81,8 +81,8 @@ public class FileSystemSplit extends FileSystemWrapper { ...@@ -81,8 +81,8 @@ public class FileSystemSplit extends FileSystemWrapper {
long lastModified = 0; long lastModified = 0;
for (int i = 0;; i++) { for (int i = 0;; i++) {
String f = getFileName(fileName, i); String f = getFileName(fileName, i);
if (getFileSystem(fileName).exists(f)) { if (getInstance(fileName).exists(f)) {
long l = getFileSystem(fileName).getLastModified(fileName); long l = getInstance(fileName).getLastModified(fileName);
lastModified = Math.max(lastModified, l); lastModified = Math.max(lastModified, l);
} else { } else {
break; break;
...@@ -96,8 +96,8 @@ public class FileSystemSplit extends FileSystemWrapper { ...@@ -96,8 +96,8 @@ public class FileSystemSplit extends FileSystemWrapper {
long length = 0; long length = 0;
for (int i = 0;; i++) { for (int i = 0;; i++) {
String f = getFileName(fileName, i); String f = getFileName(fileName, i);
if (getFileSystem(fileName).exists(f)) { if (getInstance(fileName).exists(f)) {
length += getFileSystem(fileName).length(f); length += getInstance(fileName).length(f);
} else { } else {
break; break;
} }
...@@ -124,11 +124,11 @@ public class FileSystemSplit extends FileSystemWrapper { ...@@ -124,11 +124,11 @@ public class FileSystemSplit extends FileSystemWrapper {
public InputStream openFileInputStream(String fileName) throws IOException { public InputStream openFileInputStream(String fileName) throws IOException {
fileName = unwrap(fileName); fileName = unwrap(fileName);
InputStream input = getFileSystem(fileName).openFileInputStream(fileName); InputStream input = getInstance(fileName).openFileInputStream(fileName);
for (int i = 1;; i++) { for (int i = 1;; i++) {
String f = getFileName(fileName, i); String f = getFileName(fileName, i);
if (getFileSystem(f).exists(f)) { if (getInstance(f).exists(f)) {
InputStream i2 = getFileSystem(f).openFileInputStream(f); InputStream i2 = getInstance(f).openFileInputStream(f);
input = new SequenceInputStream(input, i2); input = new SequenceInputStream(input, i2);
} else { } else {
break; break;
...@@ -140,12 +140,12 @@ public class FileSystemSplit extends FileSystemWrapper { ...@@ -140,12 +140,12 @@ public class FileSystemSplit extends FileSystemWrapper {
public FileObject openFileObject(String fileName, String mode) throws IOException { public FileObject openFileObject(String fileName, String mode) throws IOException {
fileName = unwrap(fileName); fileName = unwrap(fileName);
ArrayList<FileObject> list = New.arrayList(); ArrayList<FileObject> list = New.arrayList();
FileObject o = getFileSystem(fileName).openFileObject(fileName, mode); FileObject o = getInstance(fileName).openFileObject(fileName, mode);
list.add(o); list.add(o);
for (int i = 1;; i++) { for (int i = 1;; i++) {
String f = getFileName(fileName, i); String f = getFileName(fileName, i);
if (getFileSystem(fileName).exists(f)) { if (getInstance(fileName).exists(f)) {
o = getFileSystem(f).openFileObject(f, mode); o = getInstance(f).openFileObject(f, mode);
list.add(o); list.add(o);
} else { } else {
break; break;
...@@ -203,9 +203,9 @@ public class FileSystemSplit extends FileSystemWrapper { ...@@ -203,9 +203,9 @@ public class FileSystemSplit extends FileSystemWrapper {
newName = unwrap(newName); newName = unwrap(newName);
for (int i = 0;; i++) { for (int i = 0;; i++) {
String o = getFileName(oldName, i); String o = getFileName(oldName, i);
if (getFileSystem(o).exists(o)) { if (getInstance(o).exists(o)) {
String n = getFileName(newName, i); String n = getFileName(newName, i);
getFileSystem(n).rename(o, n); getInstance(n).rename(o, n);
} else { } else {
break; break;
} }
...@@ -216,8 +216,8 @@ public class FileSystemSplit extends FileSystemWrapper { ...@@ -216,8 +216,8 @@ public class FileSystemSplit extends FileSystemWrapper {
fileName = unwrap(fileName); fileName = unwrap(fileName);
for (int i = 0;; i++) { for (int i = 0;; i++) {
String f = getFileName(fileName, i); String f = getFileName(fileName, i);
if (getFileSystem(fileName).exists(f)) { if (getInstance(fileName).exists(f)) {
boolean ok = getFileSystem(fileName).tryDelete(f); boolean ok = getInstance(fileName).tryDelete(f);
if (!ok) { if (!ok) {
return false; return false;
} }
......
...@@ -475,6 +475,7 @@ public abstract class Table extends SchemaObjectBase { ...@@ -475,6 +475,7 @@ public abstract class Table extends SchemaObjectBase {
* multi-column index. If it is, an exception is thrown. Single-column * multi-column index. If it is, an exception is thrown. Single-column
* references and indexes are dropped. * references and indexes are dropped.
* *
* @param session the session
* @param col the column * @param col the column
* @throws SQLException if the column is referenced by multi-column * @throws SQLException if the column is referenced by multi-column
* constraints or indexes * constraints or indexes
......
...@@ -35,14 +35,14 @@ public class TestAlter extends TestBase { ...@@ -35,14 +35,14 @@ public class TestAlter extends TestBase {
deleteDb("alter"); deleteDb("alter");
conn = getConnection("alter"); conn = getConnection("alter");
stat = conn.createStatement(); stat = conn.createStatement();
testAlterTableDropColumWithReferences(); testAlterTableDropColumnWithReferences();
testAlterTableAlterColumn(); testAlterTableAlterColumn();
testAlterTableDropIdentityColumn(); testAlterTableDropIdentityColumn();
conn.close(); conn.close();
deleteDb("alter"); deleteDb("alter");
} }
private void testAlterTableDropColumWithReferences() throws SQLException { private void testAlterTableDropColumnWithReferences() throws SQLException {
stat.execute("create table parent(id int, b int)"); stat.execute("create table parent(id int, b int)");
stat.execute("create table child(p int primary key)"); stat.execute("create table child(p int primary key)");
......
...@@ -76,6 +76,9 @@ public class TestFunctions extends TestBase implements AggregateFunction { ...@@ -76,6 +76,9 @@ public class TestFunctions extends TestBase implements AggregateFunction {
conn.close(); conn.close();
} }
/**
* This method is called via reflection from the database.
*/
public static void testDefaultConn() throws SQLException { public static void testDefaultConn() throws SQLException {
DriverManager.getConnection("jdbc:default:connection"); DriverManager.getConnection("jdbc:default:connection");
} }
......
...@@ -28,7 +28,7 @@ public class TestTempTableCrash { ...@@ -28,7 +28,7 @@ public class TestTempTableCrash {
new TestTempTableCrash().test(); new TestTempTableCrash().test();
} }
public void test() throws Exception { private void test() throws Exception {
Connection conn; Connection conn;
Statement stat; Statement stat;
......
...@@ -28,7 +28,7 @@ public class TestUndoLogLarge { ...@@ -28,7 +28,7 @@ public class TestUndoLogLarge {
new TestUndoLogLarge().test(); new TestUndoLogLarge().test();
} }
public void test() throws SQLException { private void test() throws SQLException {
DeleteDbFiles.execute("data", "test", true); DeleteDbFiles.execute("data", "test", true);
Connection conn = DriverManager.getConnection("jdbc:h2:data/test"); Connection conn = DriverManager.getConnection("jdbc:h2:data/test");
Statement stat = conn.createStatement(); Statement stat = conn.createStatement();
......
...@@ -30,7 +30,7 @@ public class TestUndoLogMemory { ...@@ -30,7 +30,7 @@ public class TestUndoLogMemory {
// new TestUndoLogMemory().test(1000, "space(100000)"); // new TestUndoLogMemory().test(1000, "space(100000)");
} }
public void test(int count, String defaultValue) throws SQLException { private void test(int count, String defaultValue) throws SQLException {
// -Xmx1m -XX:+HeapDumpOnOutOfMemoryError // -Xmx1m -XX:+HeapDumpOnOutOfMemoryError
DeleteDbFiles.execute("data", "test", true); DeleteDbFiles.execute("data", "test", true);
......
...@@ -466,10 +466,17 @@ public class BuildBase { ...@@ -466,10 +466,17 @@ public class BuildBase {
if (quiet) { if (quiet) {
System.setOut(filter(System.out, new String[] { System.setOut(filter(System.out, new String[] {
"Loading source files for package", "Loading source files for package",
"Constructing Javadoc information", "Constructing Javadoc information...",
"Generating ", "Generating ",
"Standard Doclet", "Standard Doclet",
"Building " "Building tree for all the packages and classes...",
"Building index for all the packages and classes...",
"Building index for all classes..."
}));
} else {
System.setOut(filter(System.out, new String[] {
"Loading source files for package ",
"Generating ",
})); }));
} }
Class<?> clazz = Class.forName("com.sun.tools.javadoc.Main"); Class<?> clazz = Class.forName("com.sun.tools.javadoc.Main");
......
...@@ -668,4 +668,5 @@ requeried requery closable curr outdated market accurate borg theis welford ...@@ -668,4 +668,5 @@ requeried requery closable curr outdated market accurate borg theis welford
ooq exceeded eye hannibal stels garringer czech prevention propagate ooq exceeded eye hannibal stels garringer czech prevention propagate
compromise portion nodded rapping door stealing napping artifacts lore compromise portion nodded rapping door stealing napping artifacts lore
pondered curious muttered quaint chamber nearly unwrapped flows weary volume pondered curious muttered quaint chamber nearly unwrapped flows weary volume
tapping gently dreary wrapping tis moger udt chafik tapping gently dreary wrapping tis moger udt chafik outfile geom scalable
highly cloud infrastructure
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论