exo-jcr SVN: r5677 - parent.
by do-not-reply@jboss.org
Author: tolusha
Date: 2012-02-21 05:58:56 -0500 (Tue, 21 Feb 2012)
New Revision: 5677
Added:
parent/branches/
Log:
EXOJCR-1769: add branches folder
12 years, 4 months
exo-jcr SVN: r5675 - in jcr/branches/1.15.x: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query and 2 other directories.
by do-not-reply@jboss.org
Author: andrew.plotnikov
Date: 2012-02-21 04:53:07 -0500 (Tue, 21 Feb 2012)
New Revision: 5675
Modified:
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/QueryHandlerParams.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchIndexConfigurationHelper.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java
jcr/branches/1.15.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/query-handler-config.xml
Log:
EXOJCR-1770: Allowed to configure the total amount of indexing threads
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/QueryHandlerParams.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/QueryHandlerParams.java 2012-02-21 09:43:54 UTC (rev 5674)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/QueryHandlerParams.java 2012-02-21 09:53:07 UTC (rev 5675)
@@ -119,4 +119,6 @@
public static final String PARAM_INDEX_RECOVERY_FILTER = "index-recovery-filter";
+ public static final String PARAM_INDEXING_THREAD_POOL_SIZE = "indexing-thread-pool-size";
+
}
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchIndexConfigurationHelper.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchIndexConfigurationHelper.java 2012-02-21 09:43:54 UTC (rev 5674)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchIndexConfigurationHelper.java 2012-02-21 09:53:07 UTC (rev 5675)
@@ -206,6 +206,10 @@
{
searchIndex.addRecoveryFilterClass(value);
}
+ else if (QueryHandlerParams.PARAM_INDEXING_THREAD_POOL_SIZE.equals(name))
+ {
+ searchIndex.setIndexingThreadPoolSize(Integer.parseInt(value));
+ }
else
{
searchIndex.addOptionalParameter(name, value);
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java 2012-02-21 09:43:54 UTC (rev 5674)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java 2012-02-21 09:53:07 UTC (rev 5675)
@@ -3479,7 +3479,7 @@
/**
* The total amount of threads used for the indexing
*/
- private final int nThreads = Runtime.getRuntime().availableProcessors();
+ private final int nThreads = handler.getIndexingThreadPoolSize();
/**
* The {@link CountDownLatch} used to notify that the indexing is over
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java 2012-02-21 09:43:54 UTC (rev 5674)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java 2012-02-21 09:53:07 UTC (rev 5675)
@@ -183,6 +183,11 @@
*/
public static final boolean DEFAULT_ASYNC_REINDEXING = false;
+ /**
+ * The default value for {@link #indexingThreadPoolSize}
+ */
+ private static final Integer DEFAULT_INDEXING_THREAD_POOL_SIZE = Runtime.getRuntime().availableProcessors();
+
/**
* The default value for {@link #indexRecoveryMode}.
*/
@@ -524,6 +529,8 @@
protected Map<String, String> optionalParameters = new HashMap<String, String>();
+ protected Integer indexingThreadPoolSize = DEFAULT_INDEXING_THREAD_POOL_SIZE;
+
/**
* Working constructor.
*
@@ -3425,4 +3432,20 @@
{
return PRIORITY_NORMAL;
}
+
+ /**
+ * @return the indexingThreadPoolSize
+ */
+ public Integer getIndexingThreadPoolSize()
+ {
+ return indexingThreadPoolSize;
+ }
+
+ /**
+ * @param indexingThreadPoolSize the indexingThreadPoolSize to set
+ */
+ public void setIndexingThreadPoolSize(Integer indexingThreadPoolSize)
+ {
+ this.indexingThreadPoolSize = indexingThreadPoolSize;
+ }
}
Modified: jcr/branches/1.15.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/query-handler-config.xml
===================================================================
--- jcr/branches/1.15.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/query-handler-config.xml 2012-02-21 09:43:54 UTC (rev 5674)
+++ jcr/branches/1.15.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/query-handler-config.xml 2012-02-21 09:53:07 UTC (rev 5675)
@@ -25,7 +25,7 @@
<mediaobject>
<imageobject>
<imagedata align="center"
- fileref="images/diagram-standalone-index.png" />
+ fileref="images/diagram-standalone-index.png"/>
</imageobject>
</mediaobject>
@@ -41,7 +41,7 @@
<mediaobject>
<imageobject>
- <imagedata align="center" fileref="images/diagram-local-index.png" />
+ <imagedata align="center" fileref="images/diagram-local-index.png"/>
</imageobject>
</mediaobject>
@@ -64,7 +64,7 @@
<mediaobject>
<imageobject>
- <imagedata align="center" fileref="images/diagram-shared-index.png" />
+ <imagedata align="center" fileref="images/diagram-shared-index.png"/>
</imageobject>
</mediaobject>
@@ -108,6 +108,7 @@
<property name="reindexing-page-size" value="1000" />
<property name="index-recovery-mode" value="from-coordinator" />
<property name="index-recovery-filter" value="org.exoplatform.services.jcr.impl.core.query.lucene.DocNumberRecoveryFilter" />
+ <property name="indexing-thread-pool-size" value="16" />
</properties>
</query-handler>
</workspace>
@@ -213,6 +214,12 @@
flag set, indexing will be launched asynchronously, without
blocking the JCR. Default is "false".</entry>
</row>
+
+ <row>
+ <entry>indexing-thread-pool-size</entry>
+
+ <entry>Define the total amount of indexing threads.</entry>
+ </row>
</tbody>
</tgroup>
</table>
@@ -460,11 +467,11 @@
<para>"OFFLINE" state means that index is currently re-creating. When
state changed, corresponding log event is printed. From the start of
background task index is switched to "OFFLINE", with following log event
- : </para>
+ :</para>
<programlisting>[INFO] Setting index OFFLINE (repository/production[system]).</programlisting>
- <para>When process finished, two events are logged : </para>
+ <para>When process finished, two events are logged :</para>
<programlisting>[INFO] Created initial index for 143018 nodes (repository/production[system]).
[INFO] Setting index ONLINE (repository/production[system]).</programlisting>
@@ -486,7 +493,7 @@
blocking whole application by using any JMX-compatible console (see
screenshot below, "JConsole in action").<mediaobject>
<imageobject>
- <imagedata align="center" fileref="images/jmx-jconsole.png" />
+ <imagedata align="center" fileref="images/jmx-jconsole.png"/>
</imageobject>
</mediaobject>Server can continue working as expected while index is
recreated. This depends on the flag "allow queries", passed via JMX
12 years, 4 months
exo-jcr SVN: r5674 - in jcr/trunk: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query and 2 other directories.
by do-not-reply@jboss.org
Author: andrew.plotnikov
Date: 2012-02-21 04:43:54 -0500 (Tue, 21 Feb 2012)
New Revision: 5674
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/QueryHandlerParams.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchIndexConfigurationHelper.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/query-handler-config.xml
Log:
EXOJCR-1770: Allowed to configure the total amount of indexing threads
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/QueryHandlerParams.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/QueryHandlerParams.java 2012-02-20 15:17:24 UTC (rev 5673)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/QueryHandlerParams.java 2012-02-21 09:43:54 UTC (rev 5674)
@@ -119,4 +119,6 @@
public static final String PARAM_INDEX_RECOVERY_FILTER = "index-recovery-filter";
+ public static final String PARAM_INDEXING_THREAD_POOL_SIZE = "indexing-thread-pool-size";
+
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchIndexConfigurationHelper.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchIndexConfigurationHelper.java 2012-02-20 15:17:24 UTC (rev 5673)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchIndexConfigurationHelper.java 2012-02-21 09:43:54 UTC (rev 5674)
@@ -206,6 +206,10 @@
{
searchIndex.addRecoveryFilterClass(value);
}
+ else if (QueryHandlerParams.PARAM_INDEXING_THREAD_POOL_SIZE.equals(name))
+ {
+ searchIndex.setIndexingThreadPoolSize(Integer.parseInt(value));
+ }
else
{
searchIndex.addOptionalParameter(name, value);
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java 2012-02-20 15:17:24 UTC (rev 5673)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java 2012-02-21 09:43:54 UTC (rev 5674)
@@ -3520,7 +3520,7 @@
/**
* The total amount of threads used for the indexing
*/
- private final int nThreads = Runtime.getRuntime().availableProcessors();
+ private final int nThreads = handler.getIndexingThreadPoolSize();
/**
* The {@link CountDownLatch} used to notify that the indexing is over
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java 2012-02-20 15:17:24 UTC (rev 5673)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java 2012-02-21 09:43:54 UTC (rev 5674)
@@ -192,6 +192,11 @@
*/
public static final boolean DEFAULT_ASYNC_REINDEXING = false;
+ /**
+ * The default value for {@link #indexingThreadPoolSize}
+ */
+ private static final Integer DEFAULT_INDEXING_THREAD_POOL_SIZE = Runtime.getRuntime().availableProcessors();
+
/**
* The default value for {@link #indexRecoveryMode}.
*/
@@ -206,7 +211,7 @@
* Default name of the error log file
*/
private static final String ERROR_LOG = "error.log";
-
+
/**
* The actual index
*/
@@ -533,6 +538,8 @@
protected Map<String, String> optionalParameters = new HashMap<String, String>();
+ protected Integer indexingThreadPoolSize = DEFAULT_INDEXING_THREAD_POOL_SIZE;
+
/**
* Working constructor.
*
@@ -3435,4 +3442,20 @@
{
return PRIORITY_NORMAL;
}
+
+ /**
+ * @return the indexingThreadPoolSize
+ */
+ public Integer getIndexingThreadPoolSize()
+ {
+ return indexingThreadPoolSize;
+ }
+
+ /**
+ * @param indexingThreadPoolSize the indexingThreadPoolSize to set
+ */
+ public void setIndexingThreadPoolSize(Integer indexingThreadPoolSize)
+ {
+ this.indexingThreadPoolSize = indexingThreadPoolSize;
+ }
}
Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/query-handler-config.xml
===================================================================
--- jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/query-handler-config.xml 2012-02-20 15:17:24 UTC (rev 5673)
+++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/query-handler-config.xml 2012-02-21 09:43:54 UTC (rev 5674)
@@ -25,7 +25,7 @@
<mediaobject>
<imageobject>
<imagedata align="center"
- fileref="images/diagram-standalone-index.png" />
+ fileref="images/diagram-standalone-index.png"/>
</imageobject>
</mediaobject>
@@ -41,7 +41,7 @@
<mediaobject>
<imageobject>
- <imagedata align="center" fileref="images/diagram-local-index.png" />
+ <imagedata align="center" fileref="images/diagram-local-index.png"/>
</imageobject>
</mediaobject>
@@ -64,7 +64,7 @@
<mediaobject>
<imageobject>
- <imagedata align="center" fileref="images/diagram-shared-index.png" />
+ <imagedata align="center" fileref="images/diagram-shared-index.png"/>
</imageobject>
</mediaobject>
@@ -108,6 +108,7 @@
<property name="reindexing-page-size" value="1000" />
<property name="index-recovery-mode" value="from-coordinator" />
<property name="index-recovery-filter" value="org.exoplatform.services.jcr.impl.core.query.lucene.DocNumberRecoveryFilter" />
+ <property name="indexing-thread-pool-size" value="16" />
</properties>
</query-handler>
</workspace>
@@ -213,6 +214,12 @@
flag set, indexing will be launched asynchronously, without
blocking the JCR. Default is "false".</entry>
</row>
+
+ <row>
+ <entry>indexing-thread-pool-size</entry>
+
+ <entry>Define the total amount of indexing threads.</entry>
+ </row>
</tbody>
</tgroup>
</table>
@@ -460,11 +467,11 @@
<para>"OFFLINE" state means that index is currently re-creating. When
state changed, corresponding log event is printed. From the start of
background task index is switched to "OFFLINE", with following log event
- : </para>
+ :</para>
<programlisting>[INFO] Setting index OFFLINE (repository/production[system]).</programlisting>
- <para>When process finished, two events are logged : </para>
+ <para>When process finished, two events are logged :</para>
<programlisting>[INFO] Created initial index for 143018 nodes (repository/production[system]).
[INFO] Setting index ONLINE (repository/production[system]).</programlisting>
@@ -486,7 +493,7 @@
blocking whole application by using any JMX-compatible console (see
screenshot below, "JConsole in action").<mediaobject>
<imageobject>
- <imagedata align="center" fileref="images/jmx-jconsole.png" />
+ <imagedata align="center" fileref="images/jmx-jconsole.png"/>
</imageobject>
</mediaobject>Server can continue working as expected while index is
recreated. This depends on the flag "allow queries", passed via JMX
12 years, 4 months
exo-jcr SVN: r5673 - jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl.
by do-not-reply@jboss.org
Author: andrew.plotnikov
Date: 2012-02-20 10:17:24 -0500 (Mon, 20 Feb 2012)
New Revision: 5673
Modified:
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupManagerImpl.java
Log:
EXOJCR-1767: Fixed BackupManager throws NPE in case of wrong configuration of backup logs folder
Modified: jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupManagerImpl.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupManagerImpl.java 2012-02-20 15:01:20 UTC (rev 5672)
+++ jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupManagerImpl.java 2012-02-20 15:17:24 UTC (rev 5673)
@@ -1092,7 +1092,11 @@
logsDirectory = new File(backupDir);
if (!PrivilegedFileHelper.exists(logsDirectory))
{
- PrivilegedFileHelper.mkdirs(logsDirectory);
+ if (!PrivilegedFileHelper.mkdirs(logsDirectory))
+ {
+ throw new IllegalStateException("Could not create the backup directory at "
+ + logsDirectory.getAbsolutePath());
+ }
}
if (defIncrPeriod == null)
12 years, 4 months
exo-jcr SVN: r5672 - jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl.
by do-not-reply@jboss.org
Author: andrew.plotnikov
Date: 2012-02-20 10:01:20 -0500 (Mon, 20 Feb 2012)
New Revision: 5672
Modified:
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupManagerImpl.java
Log:
EXOJCR-1767: Fixed BackupManager throws NPE in case of wrong configuration of backup logs folder
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupManagerImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupManagerImpl.java 2012-02-20 14:26:21 UTC (rev 5671)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupManagerImpl.java 2012-02-20 15:01:20 UTC (rev 5672)
@@ -1201,7 +1201,11 @@
logsDirectory = new File(backupDir);
if (!PrivilegedFileHelper.exists(logsDirectory))
{
- PrivilegedFileHelper.mkdirs(logsDirectory);
+ if (!PrivilegedFileHelper.mkdirs(logsDirectory))
+ {
+ throw new IllegalStateException("Could not create the backup directory at "
+ + logsDirectory.getAbsolutePath());
+ }
}
if (defIncrPeriod == null)
12 years, 4 months
exo-jcr SVN: r5671 - jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl.
by do-not-reply@jboss.org
Author: andrew.plotnikov
Date: 2012-02-20 09:26:21 -0500 (Mon, 20 Feb 2012)
New Revision: 5671
Modified:
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupManagerImpl.java
Log:
EXOJCR-1767: Fixed BackupManager throws NPE in case of wrong configuration of backup logs folder
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupManagerImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupManagerImpl.java 2012-02-20 14:11:26 UTC (rev 5670)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupManagerImpl.java 2012-02-20 14:26:21 UTC (rev 5671)
@@ -939,12 +939,6 @@
readParamsFromFile();
}
- if (!PrivilegedFileHelper.exists(logsDirectory))
- {
- throw new IllegalStateException("Directory " + logsDirectory.getAbsolutePath()
- + " not found. Please create it.");
- }
-
// scan for task files
File[] tasks = PrivilegedFileHelper.listFiles(this.logsDirectory, new TaskFilter());
for (File task : tasks)
12 years, 4 months
exo-jcr SVN: r5670 - jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl.
by do-not-reply@jboss.org
Author: andrew.plotnikov
Date: 2012-02-20 09:11:26 -0500 (Mon, 20 Feb 2012)
New Revision: 5670
Modified:
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupManagerImpl.java
Log:
EXOJCR-1767: Fixed BackupManager throws NPE in case of wrong configuration of backup logs folder
Modified: jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupManagerImpl.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupManagerImpl.java 2012-02-20 14:02:22 UTC (rev 5669)
+++ jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupManagerImpl.java 2012-02-20 14:11:26 UTC (rev 5670)
@@ -830,6 +830,11 @@
*/
public void start()
{
+ if (!PrivilegedFileHelper.exists(tempDir))
+ {
+ throw new IllegalStateException("Directory " + tempDir.getAbsolutePath() + " not found. Please create it.");
+ }
+
//remove if exists all old jcrrestorewi*.tmp files.
File[] files = PrivilegedFileHelper.listFiles(tempDir, new JcrRestoreWiFilter());
for (int i = 0; i < files.length; i++)
12 years, 4 months
exo-jcr SVN: r5669 - jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl.
by do-not-reply@jboss.org
Author: andrew.plotnikov
Date: 2012-02-20 09:02:22 -0500 (Mon, 20 Feb 2012)
New Revision: 5669
Modified:
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupManagerImpl.java
Log:
EXOJCR-1767: Fixed BackupManager throws NPE in case of wrong configuration of backup logs folder
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupManagerImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupManagerImpl.java 2012-02-20 12:00:00 UTC (rev 5668)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupManagerImpl.java 2012-02-20 14:02:22 UTC (rev 5669)
@@ -897,6 +897,10 @@
*/
public void start()
{
+ if (!PrivilegedFileHelper.exists(tempDir))
+ {
+ throw new IllegalStateException("Directory " + tempDir.getAbsolutePath() + " not found. Please create it.");
+ }
//remove if exists all old jcrrestorewi*.tmp files.
File[] files = PrivilegedFileHelper.listFiles(tempDir, new JcrRestoreWiFilter());
@@ -935,6 +939,12 @@
readParamsFromFile();
}
+ if (!PrivilegedFileHelper.exists(logsDirectory))
+ {
+ throw new IllegalStateException("Directory " + logsDirectory.getAbsolutePath()
+ + " not found. Please create it.");
+ }
+
// scan for task files
File[] tasks = PrivilegedFileHelper.listFiles(this.logsDirectory, new TaskFilter());
for (File task : tasks)
12 years, 4 months