[hibernate-commits] Hibernate SVN: r17900 - in search/trunk/src: main/java/org/hibernate/search/backend and 1 other directories.
hibernate-commits at lists.jboss.org
hibernate-commits at lists.jboss.org
Tue Nov 3 09:55:48 EST 2009
Author: sannegrinovero
Date: 2009-11-03 09:55:47 -0500 (Tue, 03 Nov 2009)
New Revision: 17900
Modified:
search/trunk/src/main/docbook/en-US/modules/configuration.xml
search/trunk/src/main/java/org/hibernate/search/backend/LuceneIndexingParameters.java
search/trunk/src/test/java/org/hibernate/search/test/configuration/LuceneIndexingParametersTest.java
Log:
HSEARCH-201 IndexWriter settings meant for transactional operations won't be inherited by the settings meant for batch operations
Modified: search/trunk/src/main/docbook/en-US/modules/configuration.xml
===================================================================
--- search/trunk/src/main/docbook/en-US/modules/configuration.xml 2009-11-03 14:52:05 UTC (rev 17899)
+++ search/trunk/src/main/docbook/en-US/modules/configuration.xml 2009-11-03 14:55:47 UTC (rev 17900)
@@ -709,13 +709,10 @@
<xref linkend="search-batchindex" />), the used properties are those
grouped under the <literal>batch</literal> keyword: <programlisting>hibernate.search.[default|<indexname>].indexwriter.batch.<parameter_name></programlisting></para>
- <para>Unless the corresponding <literal>.batch</literal> property is
- explicitly set, the value will default to the
- <literal>.transaction</literal> property. If no value is set for a
+ <para>If no value is set for a
<literal>.batch</literal> value in a specific shard configuration,
Hibernate Search will look at the index section, then at the default
- section and after that it will look for a <literal>.transaction</literal>
- in the same order: <programlisting>hibernate.search.Animals.2.indexwriter.transaction.max_merge_docs 10
+ section: <programlisting>hibernate.search.Animals.2.indexwriter.transaction.max_merge_docs 10
hibernate.search.Animals.2.indexwriter.transaction.merge_factor 20
hibernate.search.default.indexwriter.batch.max_merge_docs 100</programlisting>
This configuration will result in these settings applied to the second
@@ -735,7 +732,7 @@
</listitem>
<listitem>
- <para><literal>batch.merge_factor</literal> = 20</para>
+ <para><literal>batch.merge_factor</literal> = Lucene default</para>
</listitem>
</itemizedlist>
@@ -746,6 +743,10 @@
of Lucene you are using; values shown are relative to version
<literal>2.4</literal>. For more information about Lucene indexing
performances, please refer to the Lucene documentation.</para>
+
+ <warning><para>Previous versions had the <literal>batch</literal>
+ parameters inherit from <literal>transaction</literal> properties.
+ This needs now to be explicitly set.</para></warning>
<table>
<title>List of indexing performance and behavior properties</title>
Modified: search/trunk/src/main/java/org/hibernate/search/backend/LuceneIndexingParameters.java
===================================================================
--- search/trunk/src/main/java/org/hibernate/search/backend/LuceneIndexingParameters.java 2009-11-03 14:52:05 UTC (rev 17899)
+++ search/trunk/src/main/java/org/hibernate/search/backend/LuceneIndexingParameters.java 2009-11-03 14:55:47 UTC (rev 17900)
@@ -68,8 +68,8 @@
Properties indexingParameters = new MaskedProperty( sourceProps, PROP_GROUP, sourceProps );
//get keys for "transaction"
Properties transactionProps = new MaskedProperty( indexingParameters, TRANSACTION );
- //get keys for "batch" (defaulting to transaction)
- Properties batchProps = new MaskedProperty( indexingParameters, BATCH, transactionProps ); //TODO to close HSEARCH-201 just remove 3° parameter
+ //get keys for "batch"
+ Properties batchProps = new MaskedProperty( indexingParameters, BATCH );
transactionIndexParameters = new ParameterSet( transactionProps, TRANSACTION );
batchIndexParameters = new ParameterSet( batchProps, BATCH );
doSanityChecks( transactionIndexParameters, batchIndexParameters );
Modified: search/trunk/src/test/java/org/hibernate/search/test/configuration/LuceneIndexingParametersTest.java
===================================================================
--- search/trunk/src/test/java/org/hibernate/search/test/configuration/LuceneIndexingParametersTest.java 2009-11-03 14:52:05 UTC (rev 17899)
+++ search/trunk/src/test/java/org/hibernate/search/test/configuration/LuceneIndexingParametersTest.java 2009-11-03 14:55:47 UTC (rev 17900)
@@ -80,7 +80,7 @@
cfg.setProperty( "hibernate.search.Documents.batch.max_field_length", "9" );
}
- public void testDefaultIndexProviderParameters() throws Exception {
+ public void testDefaultIndexProviderParameters() {
assertValueIsSet( Author.class, BATCH, USE_COMPOUND_FILE, 1 );
assertValueIsSet( Author.class, TRANSACTION, RAM_BUFFER_SIZE, 2 );
assertValueIsSet( Author.class, TRANSACTION, MAX_MERGE_DOCS, 9 );
@@ -88,43 +88,37 @@
assertValueIsSet( Author.class, TRANSACTION, MERGE_FACTOR, 100 );
}
- public void testBatchParametersGlobals() throws Exception {
+ public void testBatchParametersGlobals() {
assertValueIsSet( Author.class, BATCH, RAM_BUFFER_SIZE, 1 );
- assertValueIsSet( Author.class, BATCH, MAX_MERGE_DOCS, 9 );
+ assertValueIsDefault( Author.class, BATCH, MAX_MERGE_DOCS );
assertValueIsSet( Author.class, BATCH, MAX_BUFFERED_DOCS, 1000 );
- assertValueIsSet( Author.class, BATCH, MERGE_FACTOR, 100 );
}
- public void testUnsetBatchValueTakesTransaction() throws Exception {
- assertValueIsSet( Document.class, BATCH, MERGE_FACTOR, 6 );
- assertValueIsSet( Document.class, BATCH, MAX_BUFFERED_DOCS, 1000 );
- }
-
- public void testMaxFieldLength() throws Exception {
+ public void testMaxFieldLength() {
// there should also be logged a warning being logged about these:
assertValueIsSet( Document.class, TRANSACTION, MAX_FIELD_LENGTH, 7 );
assertValueIsSet( Document.class, BATCH, MAX_FIELD_LENGTH, 9 );
}
- public void testExplicitBatchParameters() throws Exception {
+ public void testExplicitBatchParameters() {
assertValueIsSet( Book.class, BATCH, MAX_MERGE_DOCS, 12 );
assertValueIsSet( Book.class, BATCH, MAX_BUFFERED_DOCS, 14 );
assertValueIsSet( Book.class, BATCH, MERGE_FACTOR, 13 );
assertValueIsSet( Book.class, TRANSACTION, USE_COMPOUND_FILE, 0 );
}
- public void testInheritedBatchParametersFromTranscation() throws Exception {
+ public void testInheritedBatchParameters() {
assertValueIsSet( Book.class, BATCH, RAM_BUFFER_SIZE, 1 );
}
- public void testTransactionParameters() throws Exception {
+ public void testTransactionParameters() {
assertValueIsSet( Book.class, TRANSACTION, RAM_BUFFER_SIZE, 4 );
assertValueIsSet( Book.class, TRANSACTION, MAX_MERGE_DOCS, 15 );
assertValueIsSet( Book.class, TRANSACTION, MAX_BUFFERED_DOCS, 17 );
assertValueIsSet( Book.class, TRANSACTION, MERGE_FACTOR, 16 );
}
- public void testDefaultKeywordOverwritesInherited() throws Exception {
+ public void testDefaultKeywordOverwritesInherited() {
assertValueIsDefault( Document.class, TRANSACTION, RAM_BUFFER_SIZE );
assertValueIsDefault( Document.class, TRANSACTION, RAM_BUFFER_SIZE );
}
@@ -137,7 +131,7 @@
assertEquals( param.getTransactionIndexParameters(), paramCopy.getTransactionIndexParameters() );
}
- protected Class[] getMappings() {
+ protected Class<?>[] getMappings() {
return new Class[] {
Book.class,
Author.class,
More information about the hibernate-commits
mailing list