提交 8678a122 authored 作者: thomasmueller's avatar thomasmueller

Javadocs

上级 cebc13f1
...@@ -44,7 +44,11 @@ import java.util.HashSet; ...@@ -44,7 +44,11 @@ import java.util.HashSet;
*/ */
public class Select extends Query { public class Select extends Query {
/**
* The main (top) table filter.
*/
TableFilter topTableFilter; TableFilter topTableFilter;
private final ArrayList<TableFilter> filters = New.arrayList(); private final ArrayList<TableFilter> filters = New.arrayList();
private final ArrayList<TableFilter> topFilters = New.arrayList(); private final ArrayList<TableFilter> topFilters = New.arrayList();
......
...@@ -955,6 +955,12 @@ public class FullText { ...@@ -955,6 +955,12 @@ public class FullText {
} }
} }
/**
* Check whether the database is in multi-threaded mode.
*
* @param conn the connection
* @return true if the multi-threaded mode is used
*/
static boolean isMultiThread(Connection conn) static boolean isMultiThread(Connection conn)
throws SQLException { throws SQLException {
try (Statement stat = conn.createStatement()) { try (Statement stat = conn.createStatement()) {
......
...@@ -703,11 +703,21 @@ public class FullTextLucene extends FullText { ...@@ -703,11 +703,21 @@ public class FullTextLucene extends FullText {
searcher = new IndexSearcher(reader); searcher = new IndexSearcher(reader);
} }
/**
* Start using the searcher.
*
* @return the searcher
*/
synchronized IndexSearcher getSearcher() { synchronized IndexSearcher getSearcher() {
++counter; ++counter;
return searcher; return searcher;
} }
/**
* Stop using the searcher.
*
* @param searcher the searcher
*/
synchronized void returnSearcher(IndexSearcher searcher) { synchronized void returnSearcher(IndexSearcher searcher) {
if (this.searcher == searcher) { if (this.searcher == searcher) {
--counter; --counter;
...@@ -738,6 +748,9 @@ public class FullTextLucene extends FullText { ...@@ -738,6 +748,9 @@ public class FullTextLucene extends FullText {
searcher = new IndexSearcher(IndexReader.open(writer, true)); searcher = new IndexSearcher(IndexReader.open(writer, true));
} }
/**
* Close the index.
*/
public synchronized void close() throws IOException { public synchronized void close() throws IOException {
for (IndexSearcher searcher : counters.keySet()) { for (IndexSearcher searcher : counters.keySet()) {
closeSearcher(searcher); closeSearcher(searcher);
......
...@@ -896,6 +896,9 @@ public class TransactionStore { ...@@ -896,6 +896,9 @@ public class TransactionStore {
*/ */
final MVMap<K, VersionedValue> map; final MVMap<K, VersionedValue> map;
/**
* The transaction which is used for this map.
*/
final Transaction transaction; final Transaction transaction;
TransactionMap(Transaction transaction, MVMap<K, VersionedValue> map, TransactionMap(Transaction transaction, MVMap<K, VersionedValue> map,
......
...@@ -37,6 +37,11 @@ public class TableSynonym extends SchemaObjectBase { ...@@ -37,6 +37,11 @@ public class TableSynonym extends SchemaObjectBase {
return synonymFor; return synonymFor;
} }
/**
* Set (update) the data.
*
* @param data the new data
*/
public void updateData(CreateSynonymData data) { public void updateData(CreateSynonymData data) {
this.data = data; this.data = data;
} }
...@@ -46,7 +51,6 @@ public class TableSynonym extends SchemaObjectBase { ...@@ -46,7 +51,6 @@ public class TableSynonym extends SchemaObjectBase {
return SYNONYM; return SYNONYM;
} }
@Override @Override
public String getCreateSQLForCopy(Table table, String quotedName) { public String getCreateSQLForCopy(Table table, String quotedName) {
return synonymFor.getCreateSQLForCopy(table, quotedName); return synonymFor.getCreateSQLForCopy(table, quotedName);
......
...@@ -76,9 +76,11 @@ public class TableView extends Table { ...@@ -76,9 +76,11 @@ public class TableView extends Table {
* dependent views. * dependent views.
* *
* @param querySQL the SQL statement * @param querySQL the SQL statement
* @param newColumnTemplates the columns
* @param session the session * @param session the session
* @param recursive whether this is a recursive view * @param recursive whether this is a recursive view
* @param force if errors should be ignored * @param force if errors should be ignored
* @param literalsChecked if literals have been checked
*/ */
public void replace(String querySQL, Column[] newColumnTemplates, Session session, public void replace(String querySQL, Column[] newColumnTemplates, Session session,
boolean recursive, boolean force, boolean literalsChecked) { boolean recursive, boolean force, boolean literalsChecked) {
...@@ -715,6 +717,22 @@ public class TableView extends Table { ...@@ -715,6 +717,22 @@ public class TableView extends Table {
return isPersistent; return isPersistent;
} }
/**
* Create a view.
*
* @param schema the schema
* @param id the view id
* @param name the view name
* @param querySQL the query
* @param parameters the parameters
* @param columnTemplates the columns
* @param session the session
* @param literalsChecked whether literals in the query are checked
* @param isTableExpression if this is a table expression
* @param isPersistent whether the view is persisted
* @param db the database
* @return the view
*/
public static TableView createTableViewMaybeRecursive(Schema schema, int id, String name, String querySQL, public static TableView createTableViewMaybeRecursive(Schema schema, int id, String name, String querySQL,
ArrayList<Parameter> parameters, Column[] columnTemplates, Session session, ArrayList<Parameter> parameters, Column[] columnTemplates, Session session,
boolean literalsChecked, boolean isTableExpression, boolean isPersistent, Database db) { boolean literalsChecked, boolean isTableExpression, boolean isPersistent, Database db) {
...@@ -805,6 +823,17 @@ public class TableView extends Table { ...@@ -805,6 +823,17 @@ public class TableView extends Table {
return columnTemplateList; return columnTemplateList;
} }
/**
* Create a table for a recursive query.
*
* @param isPersistent whether the table is persisted
* @param targetSession the session
* @param cteViewName the name
* @param schema the schema
* @param columns the columns
* @param db the database
* @return the table
*/
public static Table createShadowTableForRecursiveTableExpression(boolean isPersistent, Session targetSession, public static Table createShadowTableForRecursiveTableExpression(boolean isPersistent, Session targetSession,
String cteViewName, Schema schema, List<Column> columns, Database db) { String cteViewName, Schema schema, List<Column> columns, Database db) {
...@@ -834,6 +863,13 @@ public class TableView extends Table { ...@@ -834,6 +863,13 @@ public class TableView extends Table {
return recursiveTable; return recursiveTable;
} }
/**
* Remove a table for a recursive query.
*
* @param isPersistent whether the table is persisted
* @param targetSession the session
* @param recursiveTable the table
*/
public static void destroyShadowTableForRecursiveExpression(boolean isPersistent, Session targetSession, public static void destroyShadowTableForRecursiveExpression(boolean isPersistent, Session targetSession,
Table recursiveTable) { Table recursiveTable) {
if (recursiveTable != null) { if (recursiveTable != null) {
......
...@@ -15,6 +15,9 @@ import java.util.Comparator; ...@@ -15,6 +15,9 @@ import java.util.Comparator;
*/ */
public class CharsetCollator extends Collator { public class CharsetCollator extends Collator {
/**
* The comparator used to compare byte arrays.
*/
static final Comparator<byte[]> COMPARATOR = new Comparator<byte[]>() { static final Comparator<byte[]> COMPARATOR = new Comparator<byte[]>() {
@Override @Override
public int compare(byte[] b1, byte[] b2) { public int compare(byte[] b1, byte[] b2) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论