Переглянути джерело

enable big index support by default

git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@460 f203690c-595d-4dc9-a70b-905162fa7fd2
tags/jackcess-1.2.0
James Ahlborn 14 роки тому
джерело
коміт
e94abeff3a

+ 19
- 12
src/java/com/healthmarketscience/jackcess/Database.java Переглянути файл

@@ -62,14 +62,14 @@ import org.apache.commons.logging.LogFactory;
/**
* An Access database.
* <p>
* There is now experimental, optional support for large indexes (disabled by
* default). This optional support can be enabled via a few different means:
* There is optional support for large indexes (enabled by default). This
* optional support can be disabled via a few different means:
* <ul>
* <li>Setting the system property {@value #USE_BIG_INDEX_PROPERTY} to
* {@code "true"} will enable "large" index support accross the jvm</li>
* <li>Calling {@link #setUseBigIndex} with {@code true} on a Database
* instance will enable "large" index support for all tables subsequently
* created from that instance</li>
* {@code "false"} will disable "large" index support across the jvm</li>
* <li>Calling {@link #setUseBigIndex} on a Database instance will override
* any system property setting for "large" index support for all tables
* subsequently created from that instance</li>
* <li>Calling {@link #getTable(String,boolean)} can selectively
* enable/disable "large" index support on a per-table basis (overriding
* any Database or system property setting)</li>
@@ -295,8 +295,8 @@ public class Database
private Table _queries;
/** SIDs to use for the ACEs added for new tables */
private final List<byte[]> _newTableSIDs = new ArrayList<byte[]>();
/** for now, "big index support" is optional */
private boolean _useBigIndex;
/** "big index support" is optional, but enabled by default */
private Boolean _useBigIndex;
/** optional error handler to use when row errors are encountered */
private ErrorHandler _dbErrorHandler;
/** the file format of the database */
@@ -513,7 +513,7 @@ public class Database
* Whether or not big index support is enabled for tables.
*/
public boolean doUseBigIndex() {
return _useBigIndex;
return (_useBigIndex != null ? _useBigIndex : true);
}

/**
@@ -1227,11 +1227,18 @@ public class Database
}

/**
* Returns {@code true} if "big index support" has been enabled explicity on
* the this Database or via a system property, {@code false} otherwise.
* Returns {@code false} if "big index support" has been disabled explicity
* on the this Database or via a system property, {@code true} otherwise.
*/
public boolean defaultUseBigIndex() {
return doUseBigIndex() || Boolean.getBoolean(USE_BIG_INDEX_PROPERTY);
if(_useBigIndex != null) {
return _useBigIndex;
}
String prop = System.getProperty(USE_BIG_INDEX_PROPERTY);
if(prop != null) {
return Boolean.TRUE.toString().equalsIgnoreCase(prop);
}
return true;
}
/**

+ 2
- 2
src/java/com/healthmarketscience/jackcess/Table.java Переглянути файл

@@ -125,7 +125,7 @@ public class Table
/** page buffer used to write out-of-line "long value" data */
private final TempPageHolder _longValueBufferH =
TempPageHolder.newHolder(TempBufferHolder.Type.SOFT);
/** for now, "big index support" is optional */
/** "big index support" is optional */
private final boolean _useBigIndex;
/** optional error handler to use when row errors are encountered */
private ErrorHandler _tableErrorHandler;
@@ -144,7 +144,7 @@ public class Table
_database = null;
_tableDefPageNumber = PageChannel.INVALID_PAGE_NUMBER;
_name = null;
_useBigIndex = false;
_useBigIndex = true;
setColumns(columns);
}

+ 4
- 3
src/site/fml/faq.fml Переглянути файл

@@ -203,9 +203,10 @@
of rows. When the index size limit was reached an
UnsupportedOperationException (or possibly an IOException) was thrown.
As of the 1.1.14 release, experimental, optional large index support
has been added. This support is disabled by default but can be
enabled via a few different means. Please see the <a href="apidocs/com/healthmarketscience/jackcess/Database.html">Database javadocs</a>
for details on enabling large index support.
has been added. As of the 1.2.0 release, large index support is
enabled by default. This support is enabled/disabled via a few
different means. Please see the <a href="apidocs/com/healthmarketscience/jackcess/Database.html">Database
javadocs</a> for details on enabling/disabling large index support.
</answer>
</faq>


Завантаження…
Відмінити
Зберегти