exo-jcr SVN: r5959 - parent/trunk.
by do-not-reply@jboss.org
Author: tolusha
Date: 2012-03-26 07:45:38 -0400 (Mon, 26 Mar 2012)
New Revision: 5959
Modified:
parent/trunk/pom.xml
Log:
EXOJCR-1823: Relate on foundation-parent v10-SNAPSHOT instead of 1.15.0-SNAPSHOT
Modified: parent/trunk/pom.xml
===================================================================
--- parent/trunk/pom.xml 2012-03-26 10:53:12 UTC (rev 5958)
+++ parent/trunk/pom.xml 2012-03-26 11:45:38 UTC (rev 5959)
@@ -24,7 +24,7 @@
<parent>
<groupId>org.jboss</groupId>
<artifactId>jboss-parent</artifactId>
- <version>5</version>
+ <version>8</version>
</parent>
<groupId>org.exoplatform</groupId>
<artifactId>foundation-parent</artifactId>
@@ -188,8 +188,8 @@
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
- <manifestEntries>
- <SCM-URL>${project.scm.connection}</SCM-URL>
+ <index>fasle</index>
+ <manifestEntries combine.self="override">
<Specification-Title>${exo.product.name}</Specification-Title>
<Specification-Version>${exo.product.specification}</Specification-Version>
<Specification-Vendor>${project.organization.name}</Specification-Vendor>
@@ -215,7 +215,8 @@
<artifactId>maven-war-plugin</artifactId>
<configuration>
<archive>
- <manifestEntries>
+ <index>fasle</index>
+ <manifestEntries combine.self="override">
<SCM-URL>${project.scm.connection}</SCM-URL>
<Specification-Title>${exo.product.name}</Specification-Title>
<Specification-Version>${exo.product.specification}</Specification-Version>
@@ -316,7 +317,8 @@
<artifactId>maven-war-plugin</artifactId>
<configuration>
<archive>
- <manifestEntries>
+ <index>fasle</index>
+ <manifestEntries combine.self="override">
<SCM-Revision>${buildNumber}</SCM-Revision>
<SCM-URL>${project.scm.connection}</SCM-URL>
<Specification-Title>${exo.product.name}</Specification-Title>
@@ -336,7 +338,8 @@
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
- <manifestEntries>
+ <index>fasle</index>
+ <manifestEntries combine.self="override">
<SCM-Revision>${buildNumber}</SCM-Revision>
<SCM-URL>${project.scm.connection}</SCM-URL>
<Specification-Title>${exo.product.name}</Specification-Title>
12 years, 1 month
exo-jcr SVN: r5958 - jcr/branches/1.14.x/patch/1.14.8-GA/JCR-1725.
by do-not-reply@jboss.org
Author: nzamosenchuk
Date: 2012-03-26 06:53:12 -0400 (Mon, 26 Mar 2012)
New Revision: 5958
Modified:
jcr/branches/1.14.x/patch/1.14.8-GA/JCR-1725/JCR-1725.patch
Log:
JCR-1725 : make AtomicReference final for latchers. Avoid code-reformatting. Make some other fileds as Atomic types.
Modified: jcr/branches/1.14.x/patch/1.14.8-GA/JCR-1725/JCR-1725.patch
===================================================================
--- jcr/branches/1.14.x/patch/1.14.8-GA/JCR-1725/JCR-1725.patch 2012-03-26 07:49:46 UTC (rev 5957)
+++ jcr/branches/1.14.x/patch/1.14.8-GA/JCR-1725/JCR-1725.patch 2012-03-26 10:53:12 UTC (rev 5958)
@@ -1,6 +1,6 @@
Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java
===================================================================
---- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java (revision 5945)
+--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java (revision 5957)
+++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java (working copy)
@@ -81,8 +81,20 @@
import java.lang.reflect.Constructor;
@@ -33,12 +33,27 @@
/**
* The actual index
*/
+@@ -464,12 +476,12 @@
+ * Indicates if this <code>SearchIndex</code> is closed and cannot be used
+ * anymore.
+ */
+- private boolean closed = false;
++ private final AtomicBoolean closed = new AtomicBoolean(false);
+
+ /**
+ * Allows or denies queries while index is offline.
+ */
+- private boolean allowQuery = true;
++ private final AtomicBoolean allowQuery = new AtomicBoolean(true);
+
+ /**
+ * Text extractor for extracting text content of binary properties.
@@ -516,12 +528,12 @@
/**
* Waiting query execution until resume.
*/
- protected CountDownLatch latcher = null;
-+ protected AtomicReference<CountDownLatch> latcher = new AtomicReference<CountDownLatch>();
++ protected final AtomicReference<CountDownLatch> latcher = new AtomicReference<CountDownLatch>();
/**
* Indicates if component suspended or not.
@@ -48,52 +63,58 @@
protected final Set<String> recoveryFilterClasses;
-@@ -674,10 +686,9 @@
- }
- catch (IOException e)
- {
-- log
-- .error(
-- "Error while reindexing the workspace. Please fix the problem, delete index and restart server.",
-- e);
-+ log.error(
-+ "Error while reindexing the workspace. Please fix the problem, delete index and restart server.",
-+ e);
- }
- }
- }, "Reindexing-" + context.getRepositoryName() + "-" + context.getContainer().getWorkspaceName()).start();
-@@ -1120,8 +1131,7 @@
- }
- catch (RepositoryException e)
- {
-- log
-- .warn("Exception while creating document for node: " + state.getIdentifier() + ": " + e.toString(), e);
-+ log.warn("Exception while creating document for node: " + state.getIdentifier() + ": " + e.toString(), e);
- }
- return doc;
- }
-@@ -1148,8 +1158,7 @@
- }
- catch (RepositoryException e)
- {
-- log
-- .warn("Exception while creating document for node: " + state.getIdentifier() + ": " + e.toString());
-+ log.warn("Exception while creating document for node: " + state.getIdentifier() + ": " + e.toString());
- }
- return null;
- }
-@@ -2029,8 +2038,7 @@
- catch (Exception e)
- {
- // do not fail if aggregate cannot be created
-- log
-- .warn("Exception while building indexing aggregate for" + " node with UUID: " + state.getIdentifier(), e);
-+ log.warn("Exception while building indexing aggregate for" + " node with UUID: " + state.getIdentifier(), e);
- }
+@@ -1237,7 +1249,7 @@
+ */
+ public void close()
+ {
+- if (!closed)
++ if (!closed.get())
+ {
+ // cleanup resources obtained by filters
+ if (recoveryFilters != null)
+@@ -1268,7 +1280,7 @@
+ errorLog.close();
+ index.close();
+ getContext().destroy();
+- closed = true;
++ closed.set(true);
+ log.info("Index closed: " + path);
}
}
-@@ -3380,10 +3388,10 @@
+@@ -1546,7 +1558,7 @@
+ protected IndexReader getIndexReader(boolean includeSystemIndex) throws IOException
+ {
+ // deny query execution if index in offline mode and allowQuery is false
+- if (!index.isOnline() && !allowQuery)
++ if (!index.isOnline() && !allowQuery.get())
+ {
+ throw new IndexOfflineIOException("Index is offline");
+ }
+@@ -3202,7 +3214,7 @@
*/
+ private void checkOpen() throws IOException
+ {
+- if (closed)
++ if (closed.get())
+ {
+ throw new IOException("query handler closed and cannot be used anymore.");
+ }
+@@ -3358,11 +3370,11 @@
+ checkOpen();
+ if (isOnline)
+ {
+- this.allowQuery = true;
++ this.allowQuery.set(true);
+ }
+ else
+ {
+- this.allowQuery = allowQuery;
++ this.allowQuery.set(allowQuery);
+ }
+ index.setOnline(isOnline, dropStaleIndexes);
+ }
+@@ -3380,10 +3392,10 @@
+ */
public void suspend() throws SuspendException
{
- latcher = new CountDownLatch(1);
@@ -105,8 +126,12 @@
}
/**
-@@ -3396,9 +3404,9 @@
- closed = false;
+@@ -3393,12 +3405,12 @@
+ {
+ try
+ {
+- closed = false;
++ closed.set(false);
doInit();
- latcher.countDown();
@@ -117,7 +142,7 @@
}
catch (IOException e)
{
-@@ -3415,7 +3423,7 @@
+@@ -3415,7 +3427,7 @@
*/
public boolean isSuspended()
{
@@ -126,7 +151,7 @@
}
/**
-@@ -3426,11 +3434,11 @@
+@@ -3426,11 +3438,11 @@
*/
private void waitForResuming() throws IOException
{
@@ -142,10 +167,102 @@
{
Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java
===================================================================
---- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java (revision 5945)
+--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java (revision 5957)
+++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java (working copy)
-@@ -1388,15 +1388,6 @@
+@@ -65,6 +65,7 @@
+ import java.util.concurrent.Callable;
+ import java.util.concurrent.CountDownLatch;
+ import java.util.concurrent.LinkedBlockingQueue;
++import java.util.concurrent.atomic.AtomicBoolean;
+ import java.util.concurrent.atomic.AtomicInteger;
+ import java.util.concurrent.atomic.AtomicLong;
+ import java.util.concurrent.atomic.AtomicReference;
+@@ -242,12 +243,12 @@
+ * Or for any other reason it should be switched
+ * to offline mode.
*/
+- private boolean online = true;
++ private final AtomicBoolean online = new AtomicBoolean(true);
+
+ /**
+ * Flag indicating whether the index is stopped.
+ */
+- private volatile boolean stopped;
++ private final AtomicBoolean stopped = new AtomicBoolean();
+
+ /**
+ * The index format version of this multi index.
+@@ -267,7 +268,7 @@
+ @Override
+ public void run()
+ {
+- stopped = true;
++ stopped.set(true);
+ }
+ };
+
+@@ -592,12 +593,12 @@
+ */
+ public void reindex(ItemDataConsumer stateMgr) throws IOException, RepositoryException
+ {
+- if (stopped)
++ if (stopped.get())
+ {
+ throw new IllegalStateException("Can't invoke reindexing on closed index.");
+ }
+
+- if (online)
++ if (online.get())
+ {
+ throw new IllegalStateException("Can't invoke reindexing while index still online.");
+ }
+@@ -645,7 +646,7 @@
+ */
+ synchronized void update(final Collection<String> remove, final Collection<Document> add) throws IOException
+ {
+- if (!online)
++ if (!online.get())
+ {
+ doUpdateOffline(remove, add);
+ }
+@@ -1215,7 +1216,7 @@
+ try
+ {
+ // if we are reindexing there is already an active transaction
+- if (online)
++ if (online.get())
+ {
+ executeAndLog(new Start(Action.INTERNAL_TRANS_REPL_INDEXES));
+ }
+@@ -1246,7 +1247,7 @@
+ }
+ index.commit();
+
+- if (online)
++ if (online.get())
+ {
+ // only commit if we are not reindexing
+ // when reindexing the final commit is done at the very end
+@@ -1271,7 +1272,7 @@
+ }
+ }
+ }
+- if (!online)
++ if (!online.get())
+ {
+ // do some cleanup right away when reindexing
+ attemptDelete();
+@@ -1335,7 +1336,7 @@
+ // if index in offline mode, due to hot async reindexing,
+ // need to return the reader containing only stale indexes (old),
+ // without newly created.
+- List<PersistentIndex> persistedIndexesList = online ? indexes : staleIndexes;
++ List<PersistentIndex> persistedIndexesList = online.get() ? indexes : staleIndexes;
+ List<ReadOnlyIndexReader> readerList = new ArrayList<ReadOnlyIndexReader>();
+ for (int i = 0; i < persistedIndexesList.size(); i++)
+ {
+@@ -1388,15 +1389,6 @@
+ */
void close()
{
- // stop index merger
@@ -160,7 +277,16 @@
synchronized (this)
{
// stop timer
-@@ -1465,6 +1456,14 @@
+@@ -1445,7 +1437,7 @@
+ }
+ modeHandler.removeIndexerIoModeListener(this);
+ indexUpdateMonitor.removeIndexUpdateMonitorListener(this);
+- this.stopped = true;
++ this.stopped.set(true);
+ // Remove the hook that will stop the threads if they are still running
+ SecurityHelper.doPrivilegedAction(new PrivilegedAction<Object>()
+ {
+@@ -1465,6 +1457,14 @@
}
});
}
@@ -175,9 +301,94 @@
}
/**
+@@ -1869,7 +1869,7 @@
+ private void createIndex(final Queue<Callable<Void>> tasks, final NodeData node, final ItemDataConsumer stateMgr,
+ final AtomicLong count) throws IOException, RepositoryException, InterruptedException
+ {
+- if (stopped)
++ if (stopped.get())
+ {
+ throw new InterruptedException();
+ }
+@@ -2016,7 +2016,7 @@
+ {
+ for (NodeDataIndexing node : iterator.next())
+ {
+- if (stopped)
++ if (stopped.get())
+ {
+ throw new InterruptedException();
+ }
+@@ -2142,7 +2142,7 @@
+ private synchronized void checkFlush()
+ {
+ // avoid frequent flushes during reindexing;
+- long idleTime = online ? System.currentTimeMillis() - lastFlushTime : 0;
++ long idleTime = online.get() ? System.currentTimeMillis() - lastFlushTime : 0;
+ long volatileTime = System.currentTimeMillis() - lastFileSystemFlushTime;
+ // do not flush if volatileIdleTime is zero or negative
+ if ((handler.getVolatileIdleTime() > 0 && idleTime > handler.getVolatileIdleTime() * 1000)
+@@ -3470,7 +3470,7 @@
+ */
+ public boolean isOnline()
+ {
+- return online;
++ return online.get();
+ }
+
+ /**
+@@ -3478,7 +3478,7 @@
+ */
+ public boolean isStopped()
+ {
+- return stopped;
++ return stopped.get();
+ }
+
+ /**
+@@ -3490,7 +3490,7 @@
+ public synchronized void setOnline(boolean isOnline, boolean dropStaleIndexes) throws IOException
+ {
+ // if mode really changed
+- if (online != isOnline)
++ if (online.get() != isOnline)
+ {
+ // switching to ONLINE
+ if (isOnline)
+@@ -3499,7 +3499,7 @@
+ if (modeHandler.getMode() == IndexerIoMode.READ_WRITE)
+ {
+ offlineIndex.commit(true);
+- online = true;
++ online.set(true);
+ // cleaning stale indexes
+ for (PersistentIndex staleIndex : staleIndexes)
+ {
+@@ -3512,7 +3512,7 @@
+ }
+ else
+ {
+- online = true;
++ online.set(true);
+ staleIndexes.clear();
+ }
+ }
+@@ -3538,10 +3538,10 @@
+ staleIndexes.addAll(indexes);
+ }
+
+- online = false;
++ online.set(false);
+ }
+ }
+- else if (!online)
++ else if (!online.get())
+ {
+ throw new IOException("Index is already in OFFLINE mode.");
+ }
Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java
===================================================================
---- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java (revision 5945)
+--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java (revision 5957)
+++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java (working copy)
@@ -104,6 +104,7 @@
import java.util.NoSuchElementException;
@@ -187,7 +398,7 @@
import javax.jcr.Node;
import javax.jcr.PropertyType;
-@@ -212,7 +213,7 @@
+@@ -212,12 +213,12 @@
/**
* Indicates if component suspended or not.
*/
@@ -196,6 +407,12 @@
/**
* Indicates that node keep responsible for resuming.
+ */
+- protected Boolean isResponsibleForResuming = false;
++ protected final AtomicBoolean isResponsibleForResuming = new AtomicBoolean(false);
+
+ /**
+ * Suspend remote command.
@@ -403,7 +404,7 @@
public void checkIndex(final InspectionReport report, final boolean isSystem) throws RepositoryException,
IOException
@@ -223,6 +440,15 @@
{
parentSearchManager.suspend();
}
+@@ -1202,7 +1203,7 @@
+ {
+ if (rpcService != null)
+ {
+- isResponsibleForResuming = true;
++ isResponsibleForResuming.set(true);
+
+ try
+ {
@@ -1228,7 +1229,7 @@
*/
public boolean isSuspended()
@@ -232,6 +458,15 @@
}
/**
+@@ -1275,7 +1276,7 @@
+ throw new ResumeException(e);
+ }
+
+- isResponsibleForResuming = false;
++ isResponsibleForResuming.set(false);
+ }
+ else
+ {
@@ -1303,10 +1304,10 @@
throw new IllegalStateException(
"Index is not in READ_WRITE mode and reindexing can't be launched. Please start reindexing on coordinator node.");
@@ -245,6 +480,33 @@
}
log.info("Starting hot reindexing on the " + handler.getContext().getRepositoryName() + "/"
+@@ -1321,7 +1322,7 @@
+ hotReindexingState = "Running. Started at " + sdf.format(Calendar.getInstance().getTime());
+ try
+ {
+- isResponsibleForResuming = true;
++ isResponsibleForResuming.set(true);
+ // set offline cluster wide (will make merger disposed and volatile flushed)
+ if (rpcService != null && changesFilter.isShared())
+ {
+@@ -1399,7 +1400,7 @@
+ hotReindexingState = "Stopped with errors at " + sdf.format(Calendar.getInstance().getTime());
+ log.info("Reindexing halted with errors.");
+ }
+- isResponsibleForResuming = false;
++ isResponsibleForResuming.set(false);
+ }
+ }
+ }, "HotReindexing-" + handler.getContext().getRepositoryName() + "-"
+@@ -1512,7 +1513,7 @@
+
+ public Serializable execute(Serializable[] args) throws Throwable
+ {
+- return isResponsibleForResuming;
++ return isResponsibleForResuming.get();
+ }
+ });
+
@@ -1542,27 +1543,27 @@
throw new SuspendException("Can't suspend index, while reindexing in progeress.");
}
@@ -288,7 +550,7 @@
{
Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java
===================================================================
---- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java (revision 5945)
+--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java (revision 5957)
+++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java (working copy)
@@ -74,6 +74,7 @@
import java.util.concurrent.CountDownLatch;
@@ -298,7 +560,7 @@
import javax.jcr.RepositoryException;
import javax.transaction.Status;
-@@ -141,12 +142,12 @@
+@@ -141,17 +142,17 @@
/**
* Indicates if component suspended or not.
*/
@@ -309,10 +571,16 @@
* Allows to make all threads waiting until resume.
*/
- protected CountDownLatch latcher = null;
-+ protected AtomicReference<CountDownLatch> latcher = new AtomicReference<CountDownLatch>();
++ protected final AtomicReference<CountDownLatch> latcher = new AtomicReference<CountDownLatch>();
/**
* Indicates that node keep responsible for resuming.
+ */
+- protected Boolean isResponsibleForResuming = false;
++ protected final AtomicBoolean isResponsibleForResuming = new AtomicBoolean(false);
+
+ /**
+ * Request to all nodes to check if there is someone who responsible for resuming.
@@ -927,11 +928,11 @@
*/
public void save(final ItemStateChangesLog changesLog) throws RepositoryException
@@ -336,6 +604,24 @@
{
synchronized (workingThreads)
{
+@@ -1933,7 +1934,7 @@
+ {
+ if (rpcService != null)
+ {
+- isResponsibleForResuming = true;
++ isResponsibleForResuming.set(true);
+
+ try
+ {
+@@ -1974,7 +1975,7 @@
+ throw new ResumeException(e);
+ }
+
+- isResponsibleForResuming = false;
++ isResponsibleForResuming.set(false);
+ }
+ else
+ {
@@ -1987,15 +1988,15 @@
*/
public boolean isSuspended()
@@ -379,3 +665,12 @@
{
new Thread()
{
+@@ -2127,7 +2128,7 @@
+
+ public Serializable execute(Serializable[] args) throws Throwable
+ {
+- return isResponsibleForResuming;
++ return isResponsibleForResuming.get();
+ }
+ });
+
12 years, 1 month
exo-jcr SVN: r5957 - jcr/branches/1.12.x/patch/1.12.13-GA/JCR-1717.
by do-not-reply@jboss.org
Author: nzamosenchuk
Date: 2012-03-26 03:49:46 -0400 (Mon, 26 Mar 2012)
New Revision: 5957
Modified:
jcr/branches/1.12.x/patch/1.12.13-GA/JCR-1717/JCR-1717.patch
Log:
JCR-1717 : make AtomicReference final for latchers. Avoid code-reformatting
Modified: jcr/branches/1.12.x/patch/1.12.13-GA/JCR-1717/JCR-1717.patch
===================================================================
--- jcr/branches/1.12.x/patch/1.12.13-GA/JCR-1717/JCR-1717.patch 2012-03-26 07:48:10 UTC (rev 5956)
+++ jcr/branches/1.12.x/patch/1.12.13-GA/JCR-1717/JCR-1717.patch 2012-03-26 07:49:46 UTC (rev 5957)
@@ -1,6 +1,6 @@
Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/PersistentDataManager.java
===================================================================
---- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/PersistentDataManager.java (revision 5951)
+--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/PersistentDataManager.java (revision 5955)
+++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/PersistentDataManager.java (working copy)
@@ -20,6 +20,7 @@
@@ -21,7 +21,7 @@
void addItemPersistenceListener(ItemsPersistenceListener listener);
Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java
===================================================================
---- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java (revision 5951)
+--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java (revision 5955)
+++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java (working copy)
@@ -39,6 +39,9 @@
import org.exoplatform.services.jcr.datamodel.QPath;
@@ -64,100 +64,7 @@
private final ExoContainerContext ctx;
/**
-@@ -164,8 +173,8 @@
- * @throws RepositoryConfigurationException
- */
-
-- public SearchManager(ExoContainerContext ctx, QueryHandlerEntry config, NamespaceRegistryImpl nsReg, NodeTypeDataManager ntReg,
-- WorkspacePersistentDataManager itemMgr, SystemSearchManagerHolder parentSearchManager,
-+ public SearchManager(ExoContainerContext ctx, QueryHandlerEntry config, NamespaceRegistryImpl nsReg,
-+ NodeTypeDataManager ntReg, WorkspacePersistentDataManager itemMgr, SystemSearchManagerHolder parentSearchManager,
- DocumentReaderService extractor, ConfigurationManager cfm, final RepositoryIndexSearcherHolder indexSearcherHolder)
- throws RepositoryException, RepositoryConfigurationException
- {
-@@ -276,7 +285,9 @@
- try
- {
- if (reader != null)
-+ {
- reader.close();
-+ }
- }
- catch (IOException e)
- {
-@@ -389,7 +400,9 @@
- {
-
- if (log.isDebugEnabled())
-+ {
- log.debug("start");
-+ }
- try
- {
- if (indexingTree == null)
-@@ -411,7 +424,9 @@
- {
- ItemData excludeData = itemMgr.getItemData(stringTokenizer.nextToken());
- if (excludeData != null)
-+ {
- excludedPath.add(excludeData.getQPath());
-+ }
- }
- catch (RepositoryException e)
- {
-@@ -428,7 +443,9 @@
- {
- ItemData indexingRootDataItem = itemMgr.getItemData(rootNodeIdentifer);
- if (indexingRootDataItem != null && indexingRootDataItem.isNode())
-+ {
- indexingRootData = (NodeData)indexingRootDataItem;
-+ }
- }
- catch (RepositoryException e)
- {
-@@ -509,14 +526,20 @@
- if (item.isNode())
- {
- if (!indexingTree.isExcluded(item))
-+ {
- return (NodeData)item;
-+ }
- }
- else
-+ {
- log.warn("Node not found, but property " + id + ", " + item.getQPath().getAsString()
- + " found. ");
-+ }
- }
- else
-+ {
- log.warn("Unable to index node with id " + id + ", node does not exist.");
-+ }
-
- }
- catch (RepositoryException e)
-@@ -667,8 +690,8 @@
- if (parentSearchManager != null)
- {
- newChangesFilter =
-- constuctor.newInstance(this, parentSearchManager, config, indexingTree, parentSearchManager
-- .getIndexingTree(), handler, parentSearchManager.getHandler(), cfm);
-+ constuctor.newInstance(this, parentSearchManager, config, indexingTree,
-+ parentSearchManager.getIndexingTree(), handler, parentSearchManager.getHandler(), cfm);
- }
- }
- catch (SecurityException e)
-@@ -715,7 +738,9 @@
- // initialize query handler
- String className = config.getType();
- if (className == null)
-+ {
- throw new RepositoryConfigurationException("Content hanler configuration fail");
-+ }
-
- try
- {
-@@ -856,4 +881,62 @@
+@@ -856,4 +865,62 @@
return false;
}
@@ -222,7 +129,7 @@
}
Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java
===================================================================
---- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java (revision 5951)
+--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java (revision 5955)
+++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java (working copy)
@@ -45,6 +45,9 @@
import org.exoplatform.services.jcr.datamodel.PropertyData;
@@ -259,7 +166,7 @@
/**
+ * Waiting query execution until resume.
+ */
-+ protected AtomicReference<CountDownLatch> latcher = new AtomicReference<CountDownLatch>();
++ protected final AtomicReference<CountDownLatch> latcher = new AtomicReference<CountDownLatch>();
+
+ /**
+ * Indicates if component suspended or not.
@@ -270,27 +177,7 @@
* Working constructor.
*
* @throws RepositoryConfigurationException
-@@ -708,8 +724,7 @@
- }
- catch (RepositoryException e)
- {
-- log
-- .warn("Exception while creating document for node: " + state.getIdentifier() + ": " + e.toString(), e);
-+ log.warn("Exception while creating document for node: " + state.getIdentifier() + ": " + e.toString(), e);
- }
- return doc;
- }
-@@ -736,8 +751,7 @@
- }
- catch (RepositoryException e)
- {
-- log
-- .warn("Exception while creating document for node: " + state.getIdentifier() + ": " + e.toString());
-+ log.warn("Exception while creating document for node: " + state.getIdentifier() + ": " + e.toString());
- }
- return null;
- }
-@@ -819,26 +833,29 @@
+@@ -819,26 +835,29 @@
*/
public void close()
{
@@ -334,7 +221,7 @@
}
/**
-@@ -866,6 +883,8 @@
+@@ -866,6 +885,8 @@
public MultiColumnQueryHits executeQuery(SessionImpl session, AbstractQueryImpl queryImpl, Query query,
QPath[] orderProps, boolean[] orderSpecs, long resultFetchHint) throws IOException, RepositoryException
{
@@ -343,7 +230,7 @@
checkOpen();
Sort sort = new Sort(createSortFields(orderProps, orderSpecs));
-@@ -914,6 +933,8 @@
+@@ -914,6 +935,8 @@
public MultiColumnQueryHits executeQuery(SessionImpl session, MultiColumnQuery query, QPath[] orderProps,
boolean[] orderSpecs, long resultFetchHint) throws IOException, RepositoryException
{
@@ -352,28 +239,7 @@
checkOpen();
Sort sort = new Sort(createSortFields(orderProps, orderSpecs));
-@@ -1330,8 +1351,8 @@
- {
- File root = new File(path, synonymProviderConfigPath.substring(0, lastSeparator));
- fsr =
-- new BufferedInputStream(new FileInputStream(new File(root, synonymProviderConfigPath
-- .substring(lastSeparator + 1))));
-+ new BufferedInputStream(new FileInputStream(new File(root,
-+ synonymProviderConfigPath.substring(lastSeparator + 1))));
- }
- else
- {
-@@ -1540,8 +1561,7 @@
- catch (Exception e)
- {
- // do not fail if aggregate cannot be created
-- log
-- .warn("Exception while building indexing aggregate for" + " node with UUID: " + state.getIdentifier(), e);
-+ log.warn("Exception while building indexing aggregate for" + " node with UUID: " + state.getIdentifier(), e);
- }
- }
- }
-@@ -2710,6 +2730,8 @@
+@@ -2710,6 +2733,8 @@
*/
public QueryHits executeQuery(Query query) throws IOException
{
@@ -382,7 +248,7 @@
checkOpen();
IndexReader reader = getIndexReader(true);
-@@ -2742,4 +2764,76 @@
+@@ -2742,4 +2767,76 @@
log.error("Can not recover error log.", e);
}
}
@@ -461,7 +327,7 @@
}
Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java
===================================================================
---- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java (revision 5951)
+--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java (revision 5955)
+++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java (working copy)
@@ -177,7 +177,7 @@
/**
@@ -472,15 +338,6 @@
/**
* Timer to schedule flushes of this index after some idle time.
-@@ -224,7 +224,7 @@
- * Flag indicating whether the index is stopped.
- */
- private volatile boolean stopped;
--
-+
- /**
- * The index format version of this multi index.
- */
@@ -270,12 +270,6 @@
// as of 1.5 deletable file is not used anymore
removeDeletable();
@@ -566,102 +423,7 @@
// -------------------------< internal
// >-------------------------------------
-@@ -1324,13 +1341,12 @@
- * @throws RepositoryException
- * if any other error occurs
- */
-- private long createIndex(NodeData node, ItemDataConsumer stateMgr) throws IOException,
-- RepositoryException
-+ private long createIndex(NodeData node, ItemDataConsumer stateMgr) throws IOException, RepositoryException
- {
- MultithreadedIndexing indexing = new MultithreadedIndexing(node, stateMgr);
- return indexing.launch(false);
- }
--
-+
- /**
- * Recursively creates an index starting with the NodeState
- * <code>node</code>.
-@@ -1352,8 +1368,8 @@
- * @throws InterruptedException
- * if the task has been interrupted
- */
-- private void createIndex(final Queue<Callable<Void>> tasks, final NodeData node, final ItemDataConsumer stateMgr, final AtomicLong count) throws IOException,
-- RepositoryException, InterruptedException
-+ private void createIndex(final Queue<Callable<Void>> tasks, final NodeData node, final ItemDataConsumer stateMgr,
-+ final AtomicLong count) throws IOException, RepositoryException, InterruptedException
- {
- if (stopped)
- {
-@@ -1397,7 +1413,7 @@
- }
- }
- }
--
-+
- /**
- * Recursively creates an index starting with the NodeState
- * <code>node</code>.
-@@ -1421,9 +1437,8 @@
- * @throws InterruptedException
- * if the task has been interrupted
- */
-- private void createIndex(final Queue<Callable<Void>> tasks, final NodeData node,
-- final ItemDataConsumer stateMgr, final AtomicLong count, final NodeData nodeData)
-- throws RepositoryException, IOException, InterruptedException
-+ private void createIndex(final Queue<Callable<Void>> tasks, final NodeData node, final ItemDataConsumer stateMgr,
-+ final AtomicLong count, final NodeData nodeData) throws RepositoryException, IOException, InterruptedException
- {
- NodeData childState = (NodeData)stateMgr.getItemData(nodeData.getIdentifier());
- if (childState == null)
-@@ -1937,8 +1952,8 @@
- /**
- * The maximum length of a AddNode String.
- */
-- private static final int ENTRY_LENGTH =
-- Long.toString(Long.MAX_VALUE).length() + Action.ADD_NODE.length() + Constants.UUID_FORMATTED_LENGTH + 2;
-+ private static final int ENTRY_LENGTH = Long.toString(Long.MAX_VALUE).length() + Action.ADD_NODE.length()
-+ + Constants.UUID_FORMATTED_LENGTH + 2;
-
- /**
- * The uuid of the node to add.
-@@ -1952,7 +1967,7 @@
- private Document doc;
-
- private boolean synch;
--
-+
- /**
- * Creates a new AddNode action.
- *
-@@ -2042,12 +2057,12 @@
- {
- synchronized (index)
- {
-- index.volatileIndex.addDocuments(new Document[]{doc});
-- }
-+ index.volatileIndex.addDocuments(new Document[]{doc});
-+ }
- }
- else
- {
-- index.volatileIndex.addDocuments(new Document[]{doc});
-+ index.volatileIndex.addDocuments(new Document[]{doc});
- }
- }
- }
-@@ -2305,8 +2320,8 @@
- /**
- * The maximum length of a DeleteNode String.
- */
-- private static final int ENTRY_LENGTH =
-- Long.toString(Long.MAX_VALUE).length() + Action.DELETE_NODE.length() + Constants.UUID_FORMATTED_LENGTH + 2;
-+ private static final int ENTRY_LENGTH = Long.toString(Long.MAX_VALUE).length() + Action.DELETE_NODE.length()
-+ + Constants.UUID_FORMATTED_LENGTH + 2;
-
- /**
- * The uuid of the node to remove.
-@@ -2550,7 +2565,12 @@
+@@ -2550,7 +2567,12 @@
protected void setReadOny()
{
// try to stop merger in safe way
@@ -675,7 +437,7 @@
flushTask.cancel();
FLUSH_TIMER.purge();
this.redoLog = null;
-@@ -2582,7 +2602,8 @@
+@@ -2582,7 +2604,8 @@
attemptDelete();
// now that we are ready, start index merger
@@ -685,108 +447,9 @@
if (redoLogApplied)
{
// wait for the index merge to finish pending jobs
-@@ -2660,7 +2681,7 @@
- }
- }
- }
--
-+
- /**
- * This class is used to index a node and its descendants nodes with several threads
- */
-@@ -2670,27 +2691,27 @@
- * This instance of {@link AtomicReference} will contain the exception meet if any exception has occurred
- */
- private final AtomicReference<Exception> exception = new AtomicReference<Exception>();
--
-+
- /**
- * The total amount of threads used for the indexing
- */
- private final int nThreads = Runtime.getRuntime().availableProcessors();
--
-+
- /**
- * The {@link CountDownLatch} used to notify that the indexing is over
- */
- private final CountDownLatch endSignal = new CountDownLatch(nThreads);
--
-+
- /**
- * The total amount of threads currently working
- */
- private final AtomicInteger runningThreads = new AtomicInteger();
--
-+
- /**
- * The total amount of nodes already indexed
- */
- private final AtomicLong count = new AtomicLong();
--
-+
- /**
- * The list of indexing tasks left to do
- */
-@@ -2706,7 +2727,7 @@
- {
- if ((task = super.poll()) != null)
- {
-- runningThreads.incrementAndGet();
-+ runningThreads.incrementAndGet();
- }
- }
- return task;
-@@ -2714,7 +2735,7 @@
-
- @Override
- public boolean offer(Callable<Void> o)
-- {
-+ {
- if (super.offer(o))
- {
- synchronized (runningThreads)
-@@ -2724,9 +2745,9 @@
- return true;
- }
- return false;
-- }
-+ }
- };
--
-+
- /**
- * The task that all the indexing threads have to execute
- */
-@@ -2782,7 +2803,7 @@
- endSignal.countDown();
- }
- };
--
-+
- /**
- * Default constructor
- * @param node
-@@ -2801,7 +2822,7 @@
- }
- });
- }
--
-+
- /**
- * Launches the indexing
- * @param asynchronous indicates whether or not the current thread needs to wait until the
-@@ -2853,7 +2874,7 @@
- */
- private void startThreads()
- {
-- for (int i=0; i < nThreads; i++)
-+ for (int i = 0; i < nThreads; i++)
- {
- (new Thread(indexingTask, "Indexing Thread #" + (i + 1))).start();
- }
Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/RepositoryImpl.java
===================================================================
---- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/RepositoryImpl.java (revision 5951)
+--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/RepositoryImpl.java (revision 5955)
+++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/RepositoryImpl.java (working copy)
@@ -137,6 +137,11 @@
private int state = OFFLINE;
@@ -880,61 +543,61 @@
--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/ReadOnlySupport.java (revision 0)
+++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/ReadOnlySupport.java (revision 0)
@@ -0,0 +1,52 @@
-+/*
-+ * Copyright (C) 2012 eXo Platform SAS.
-+ *
-+ * This is free software; you can redistribute it and/or modify it
-+ * under the terms of the GNU Lesser General Public License as
-+ * published by the Free Software Foundation; either version 2.1 of
-+ * the License, or (at your option) any later version.
-+ *
-+ * This software is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ * Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public
-+ * License along with this software; if not, write to the Free
-+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-+ */
-+package org.exoplatform.services.jcr.impl;
-+
-+/**
-+ * @author <a href="mailto:aplotnikov@exoplatform.com">Andrey Plotnikov</a>
-+ * @version $Id: ReadOnlySupport.java 34360 20.03.2012 andrew.plotnikov $
-+ *
-+ */
-+public interface ReadOnlySupport
-+{
-+ /**
-+ * Status of write-operations restrictions.
-+ *
-+ * Read-only status is descriptive within the container, i.e. will not prevent any write
-+ * operation.
-+ *
-+ * Used in DataManager implementations.
-+ *
-+ * @return true - if write-operations allowed, false - otherwise.
-+ */
-+ boolean isReadOnly();
-+
-+ /**
-+ * Set status of write-operations restrictions.
-+ *
-+ * Read-only status is descriptive within the container, i.e. will not prevent any write
-+ * operation.
-+ *
-+ * Used in DataManager implementations.
-+ *
-+ * @param status
-+ * , true - if write-operations allowed, false - otherwise.
-+ */
-+ void setReadOnly(boolean status);
-+}
++/*
++ * Copyright (C) 2012 eXo Platform SAS.
++ *
++ * This is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU Lesser General Public License as
++ * published by the Free Software Foundation; either version 2.1 of
++ * the License, or (at your option) any later version.
++ *
++ * This software is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * Lesser General Public License for more details.
++ *
++ * You should have received a copy of the GNU Lesser General Public
++ * License along with this software; if not, write to the Free
++ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
++ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
++ */
++package org.exoplatform.services.jcr.impl;
++
++/**
++ * @author <a href="mailto:aplotnikov@exoplatform.com">Andrey Plotnikov</a>
++ * @version $Id: ReadOnlySupport.java 34360 20.03.2012 andrew.plotnikov $
++ *
++ */
++public interface ReadOnlySupport
++{
++ /**
++ * Status of write-operations restrictions.
++ *
++ * Read-only status is descriptive within the container, i.e. will not prevent any write
++ * operation.
++ *
++ * Used in DataManager implementations.
++ *
++ * @return true - if write-operations allowed, false - otherwise.
++ */
++ boolean isReadOnly();
++
++ /**
++ * Set status of write-operations restrictions.
++ *
++ * Read-only status is descriptive within the container, i.e. will not prevent any write
++ * operation.
++ *
++ * Used in DataManager implementations.
++ *
++ * @param status
++ * , true - if write-operations allowed, false - otherwise.
++ */
++ void setReadOnly(boolean status);
++}
Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java
===================================================================
---- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java (revision 5951)
+--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java (revision 5955)
+++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java (working copy)
@@ -30,6 +30,9 @@
import org.exoplatform.services.jcr.datamodel.QPathEntry;
@@ -981,7 +644,7 @@
+ /**
+ * Allows to make all threads waiting until resume.
+ */
-+ protected AtomicReference<CountDownLatch> latcher = new AtomicReference<CountDownLatch>();
++ protected final AtomicReference<CountDownLatch> latcher = new AtomicReference<CountDownLatch>();
+
+ /**
* ItemData request, used on get operations.
@@ -1107,7 +770,7 @@
+}
Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryContainer.java
===================================================================
---- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryContainer.java (revision 5951)
+--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryContainer.java (revision 5955)
+++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryContainer.java (working copy)
@@ -29,6 +29,7 @@
import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
@@ -1149,217 +812,217 @@
--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/ResumeException.java (revision 0)
+++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/ResumeException.java (revision 0)
@@ -0,0 +1,62 @@
-+/*
-+ * Copyright (C) 2012 eXo Platform SAS.
-+ *
-+ * This is free software; you can redistribute it and/or modify it
-+ * under the terms of the GNU Lesser General Public License as
-+ * published by the Free Software Foundation; either version 2.1 of
-+ * the License, or (at your option) any later version.
-+ *
-+ * This software is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ * Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public
-+ * License along with this software; if not, write to the Free
-+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-+ */
-+package org.exoplatform.services.jcr.impl.backup;
-+
-+/**
-+ * @author <a href="mailto:aplotnikov@exoplatform.com">Andrey Plotnikov</a>
-+ * @version $Id: ResumeException.java 34360 19.03.2012 andrew.plotnikov $
-+ *
-+ */
-+public class ResumeException extends Exception
-+{
-+ /**
-+ * Constructor ResumeException.
-+ *
-+ * @param cause
-+ * the cause
-+ */
-+ public ResumeException(Throwable cause)
-+ {
-+ super(cause);
-+ }
-+
-+ /**
-+ * Constructor ResumeException.
-+ *
-+ * @param message
-+ * the message
-+ */
-+ public ResumeException(String message)
-+ {
-+ super(message);
-+ }
-+
-+ /**
-+ * Constructor ResumeException.
-+ *
-+ * @param message
-+ * the message
-+ * @param cause
-+ * the cause
-+ */
-+ public ResumeException(String message, Throwable cause)
-+ {
-+ super(message, cause);
-+ }
-+}
++/*
++ * Copyright (C) 2012 eXo Platform SAS.
++ *
++ * This is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU Lesser General Public License as
++ * published by the Free Software Foundation; either version 2.1 of
++ * the License, or (at your option) any later version.
++ *
++ * This software is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * Lesser General Public License for more details.
++ *
++ * You should have received a copy of the GNU Lesser General Public
++ * License along with this software; if not, write to the Free
++ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
++ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
++ */
++package org.exoplatform.services.jcr.impl.backup;
++
++/**
++ * @author <a href="mailto:aplotnikov@exoplatform.com">Andrey Plotnikov</a>
++ * @version $Id: ResumeException.java 34360 19.03.2012 andrew.plotnikov $
++ *
++ */
++public class ResumeException extends Exception
++{
++ /**
++ * Constructor ResumeException.
++ *
++ * @param cause
++ * the cause
++ */
++ public ResumeException(Throwable cause)
++ {
++ super(cause);
++ }
++
++ /**
++ * Constructor ResumeException.
++ *
++ * @param message
++ * the message
++ */
++ public ResumeException(String message)
++ {
++ super(message);
++ }
++
++ /**
++ * Constructor ResumeException.
++ *
++ * @param message
++ * the message
++ * @param cause
++ * the cause
++ */
++ public ResumeException(String message, Throwable cause)
++ {
++ super(message, cause);
++ }
++}
Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/SuspendException.java
===================================================================
--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/SuspendException.java (revision 0)
+++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/SuspendException.java (revision 0)
@@ -0,0 +1,62 @@
-+/*
-+ * Copyright (C) 2012 eXo Platform SAS.
-+ *
-+ * This is free software; you can redistribute it and/or modify it
-+ * under the terms of the GNU Lesser General Public License as
-+ * published by the Free Software Foundation; either version 2.1 of
-+ * the License, or (at your option) any later version.
-+ *
-+ * This software is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ * Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public
-+ * License along with this software; if not, write to the Free
-+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-+ */
-+package org.exoplatform.services.jcr.impl.backup;
-+
-+/**
-+ * @author <a href="mailto:aplotnikov@exoplatform.com">Andrey Plotnikov</a>
-+ * @version $Id: SuspendException.java 34360 19.03.2012 andrew.plotnikov $
-+ *
-+ */
-+public class SuspendException extends Exception
-+{
-+ /**
-+ * Constructor SuspendException.
-+ *
-+ * @param cause
-+ * the cause
-+ */
-+ public SuspendException(Throwable cause)
-+ {
-+ super(cause);
-+ }
-+
-+ /**
-+ * Constructor SuspendException.
-+ *
-+ * @param message
-+ * the message
-+ */
-+ public SuspendException(String message)
-+ {
-+ super(message);
-+ }
-+
-+ /**
-+ * Constructor SuspendException.
-+ *
-+ * @param message
-+ * the message
-+ * @param cause
-+ * the cause
-+ */
-+ public SuspendException(String message, Throwable cause)
-+ {
-+ super(message, cause);
-+ }
-+}
++/*
++ * Copyright (C) 2012 eXo Platform SAS.
++ *
++ * This is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU Lesser General Public License as
++ * published by the Free Software Foundation; either version 2.1 of
++ * the License, or (at your option) any later version.
++ *
++ * This software is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * Lesser General Public License for more details.
++ *
++ * You should have received a copy of the GNU Lesser General Public
++ * License along with this software; if not, write to the Free
++ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
++ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
++ */
++package org.exoplatform.services.jcr.impl.backup;
++
++/**
++ * @author <a href="mailto:aplotnikov@exoplatform.com">Andrey Plotnikov</a>
++ * @version $Id: SuspendException.java 34360 19.03.2012 andrew.plotnikov $
++ *
++ */
++public class SuspendException extends Exception
++{
++ /**
++ * Constructor SuspendException.
++ *
++ * @param cause
++ * the cause
++ */
++ public SuspendException(Throwable cause)
++ {
++ super(cause);
++ }
++
++ /**
++ * Constructor SuspendException.
++ *
++ * @param message
++ * the message
++ */
++ public SuspendException(String message)
++ {
++ super(message);
++ }
++
++ /**
++ * Constructor SuspendException.
++ *
++ * @param message
++ * the message
++ * @param cause
++ * the cause
++ */
++ public SuspendException(String message, Throwable cause)
++ {
++ super(message, cause);
++ }
++}
Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/Suspendable.java
===================================================================
--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/Suspendable.java (revision 0)
+++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/Suspendable.java (revision 0)
@@ -0,0 +1,74 @@
-+/*
-+ * Copyright (C) 2012 eXo Platform SAS.
-+ *
-+ * This is free software; you can redistribute it and/or modify it
-+ * under the terms of the GNU Lesser General Public License as
-+ * published by the Free Software Foundation; either version 2.1 of
-+ * the License, or (at your option) any later version.
-+ *
-+ * This software is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ * Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public
-+ * License along with this software; if not, write to the Free
-+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-+ */
-+package org.exoplatform.services.jcr.impl.backup;
-+
-+/**
-+ * @author <a href="mailto:aplotnikov@exoplatform.com">Andrey Plotnikov</a>
-+ * @version $Id: Suspendable.java 34360 19.03.2012 andrew.plotnikov $
-+ *
-+ */
-+public interface Suspendable
-+{
-+
-+ /**
-+ * Priority high constant.
-+ */
-+ public static final int PRIORITY_HIGH = 5;
-+
-+ /**
-+ * Priority normal constant.
-+ */
-+ public static final int PRIORITY_NORMAL = 0;
-+
-+ /**
-+ * Priority low constant.
-+ */
-+ public static final int PRIORITY_LOW = -5;
-+
-+ /**
-+ * Suspend component.
-+ *
-+ * @throws SuspendException if error occurred
-+ */
-+ void suspend() throws SuspendException;
-+
-+ /**
-+ * Resume component.
-+ *
-+ * @throws ResumeException if error occurred
-+ */
-+ void resume() throws ResumeException;
-+
-+ /**
-+ * Indicates if component is suspended or not.
-+ *
-+ * @return
-+ */
-+ boolean isSuspended();
-+
-+ /**
-+ * Priority of the component.
-+ * Uses for suspend/resume comparator order.
-+ * The higher number gives higher priority.
-+ *
-+ * @return
-+ */
-+ int getPriority();
-+
-+}
++/*
++ * Copyright (C) 2012 eXo Platform SAS.
++ *
++ * This is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU Lesser General Public License as
++ * published by the Free Software Foundation; either version 2.1 of
++ * the License, or (at your option) any later version.
++ *
++ * This software is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * Lesser General Public License for more details.
++ *
++ * You should have received a copy of the GNU Lesser General Public
++ * License along with this software; if not, write to the Free
++ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
++ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
++ */
++package org.exoplatform.services.jcr.impl.backup;
++
++/**
++ * @author <a href="mailto:aplotnikov@exoplatform.com">Andrey Plotnikov</a>
++ * @version $Id: Suspendable.java 34360 19.03.2012 andrew.plotnikov $
++ *
++ */
++public interface Suspendable
++{
++
++ /**
++ * Priority high constant.
++ */
++ public static final int PRIORITY_HIGH = 5;
++
++ /**
++ * Priority normal constant.
++ */
++ public static final int PRIORITY_NORMAL = 0;
++
++ /**
++ * Priority low constant.
++ */
++ public static final int PRIORITY_LOW = -5;
++
++ /**
++ * Suspend component.
++ *
++ * @throws SuspendException if error occurred
++ */
++ void suspend() throws SuspendException;
++
++ /**
++ * Resume component.
++ *
++ * @throws ResumeException if error occurred
++ */
++ void resume() throws ResumeException;
++
++ /**
++ * Indicates if component is suspended or not.
++ *
++ * @return
++ */
++ boolean isSuspended();
++
++ /**
++ * Priority of the component.
++ * Uses for suspend/resume comparator order.
++ * The higher number gives higher priority.
++ *
++ * @return
++ */
++ int getPriority();
++
++}
Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/ManageableRepository.java
===================================================================
---- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/ManageableRepository.java (revision 5951)
+--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/ManageableRepository.java (revision 5955)
+++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/ManageableRepository.java (working copy)
@@ -62,6 +62,16 @@
final int READONLY = 2;
@@ -1390,7 +1053,7 @@
Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/WorkspaceContainerFacade.java
===================================================================
---- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/WorkspaceContainerFacade.java (revision 5951)
+--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/WorkspaceContainerFacade.java (revision 5955)
+++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/WorkspaceContainerFacade.java (working copy)
@@ -18,8 +18,18 @@
*/
12 years, 1 month
exo-jcr SVN: r5956 - in jcr/trunk: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene and 4 other directories.
by do-not-reply@jboss.org
Author: dkuleshov
Date: 2012-03-26 03:48:10 -0400 (Mon, 26 Mar 2012)
New Revision: 5956
Added:
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/distributed-cache-configuration.xml
Modified:
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/infinispan/CacheKey.java
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/infinispan/ISPNCacheFactory.java
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/resources/conf/portal/cluster/infinispan-data.xml
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/test-infinispan-config.xml
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/DocNumberCache.java
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/master.xml
jcr/trunk/pom.xml
Log:
EXOJCR-1739: ported issues:
* EXOJCR-1715
* EXOJCR-1736
* EXOJCR-1789
* EXOJCR-1800
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/DocNumberCache.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/DocNumberCache.java 2012-03-26 07:27:46 UTC (rev 5955)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/DocNumberCache.java 2012-03-26 07:48:10 UTC (rev 5956)
@@ -150,7 +150,7 @@
{
entry = (Entry)cacheSegment.get(key);
}
- if (log.isInfoEnabled())
+ if (log.isDebugEnabled())
{
accesses++;
if (entry == null)
@@ -165,7 +165,7 @@
{
ratio -= misses * 100L / accesses;
}
- StringBuffer statistics = new StringBuffer();
+ StringBuilder statistics = new StringBuilder();
int inUse = 0;
for (int i = 0; i < docNumbers.length; i++)
{
@@ -177,7 +177,7 @@
statistics.append(", #hits=").append((accesses - misses));
statistics.append(", #misses=").append(misses);
statistics.append(", cacheRatio=").append(ratio).append("%");
- log.info(statistics.toString());
+ log.debug(statistics.toString());
accesses = 0;
misses = 0;
lastLog = System.currentTimeMillis();
Modified: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/infinispan/CacheKey.java
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/infinispan/CacheKey.java 2012-03-26 07:27:46 UTC (rev 5955)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/infinispan/CacheKey.java 2012-03-26 07:48:10 UTC (rev 5956)
@@ -45,21 +45,21 @@
* the workspace is not distributed the value of this variable will be
* null to avoid consuming more memory for nothing
*/
- protected String ownerId;
+ private String ownerId;
- protected String id;
+ private String id;
- protected int hash;
+ private int hash;
/**
* The value used in case, the grouping is enabled
*/
- protected String group;
+ private String group;
/**
* The full name of the group
*/
- protected String fullGroupName;
+ private String fullGroupName;
public CacheKey()
{
@@ -74,7 +74,11 @@
{
this.ownerId = ownerId;
this.id = id;
- this.hash = id.hashCode();
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((id == null) ? 0 : id.hashCode());
+ result = prime * result + ((ownerId == null) ? 0 : ownerId.hashCode());
+ this.hash = result;
this.group = group;
}
@@ -195,7 +199,11 @@
buf = new byte[in.readInt()];
in.readFully(buf);
id = new String(buf, Constants.DEFAULT_ENCODING);
- hash = id.hashCode();
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((id == null) ? 0 : id.hashCode());
+ result = prime * result + ((ownerId == null) ? 0 : ownerId.hashCode());
+ hash = result;
}
/**
Modified: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/infinispan/ISPNCacheFactory.java
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/infinispan/ISPNCacheFactory.java 2012-03-26 07:27:46 UTC (rev 5955)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/infinispan/ISPNCacheFactory.java 2012-03-26 07:48:10 UTC (rev 5956)
@@ -35,13 +35,10 @@
import org.infinispan.configuration.global.GlobalConfigurationBuilder;
import org.infinispan.configuration.parsing.ConfigurationBuilderHolder;
import org.infinispan.configuration.parsing.Parser;
-import org.infinispan.distribution.ch.ConsistentHash;
-import org.infinispan.distribution.ch.DefaultConsistentHash;
import org.infinispan.jmx.MBeanServerLookup;
import org.infinispan.manager.DefaultCacheManager;
import org.infinispan.manager.EmbeddedCacheManager;
import org.infinispan.transaction.lookup.TransactionManagerLookup;
-import org.infinispan.util.Util;
import java.io.IOException;
import java.io.InputStream;
@@ -71,16 +68,16 @@
public static final String INFINISPAN_CONFIG = "infinispan-configuration";
private final ConfigurationManager configurationManager;
-
+
private final TransactionManager transactionManager;
private final TemplateConfigurationHelper configurationHelper;
- private static final Log LOG = ExoLogger
- .getLogger("exo.jcr.component.core.impl.infinispan.v5.InfinispanCacheFactory");
+ private static final Log LOG = ExoLogger//NOSONAR
+ .getLogger("exo.jcr.component.core.impl.infinispan.v5.InfinispanCacheFactory");//NOSONAR
/**
- * A Map that contains all the registered CacheManager order by cluster name.
+ * A Map that contains all the registered CacheManager order by cluster name.
*/
private static Map<String, EmbeddedCacheManager> CACHE_MANAGERS = new HashMap<String, EmbeddedCacheManager>();
@@ -190,9 +187,9 @@
* has already been registered for the same current container.
* If no cache manager has been registered, we register the given cache manager otherwise we
* use the previously registered cache manager and we define a dedicated region for the related cache.
+ * @param regionId the unique id of the cache region to create
* @param holder the configuration holder of the the cache to create
* @param tm the transaction manager to put into the configuration of the cache
- * @param manager the current cache manager of the cache to create
* @return the given cache manager if it has not been registered otherwise the cache manager of the same
* type that has already been registered..
*/
@@ -237,17 +234,8 @@
return tm;
}
};
- confBuilder.transaction().transactionManagerLookup(tml);
+ confBuilder.transaction().transactionManagerLookup(tml);
}
- //TODO remove it once ISPN-1687 will be fixed
- confBuilder.storeAsBinary().enabled(false);
- //TODO remove it once ISPN-1689 will be fixed
- confBuilder
- .clustering()
- .hash()
- .consistentHash(
- Util.<ConsistentHash> getInstance(DefaultConsistentHash.class.getName(), Thread.currentThread()
- .getContextClassLoader()));
Configuration conf = holder.getDefaultConfigurationBuilder().build();
// Define the configuration of the cache
manager.defineConfiguration(regionId, conf);
Modified: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/resources/conf/portal/cluster/infinispan-data.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/resources/conf/portal/cluster/infinispan-data.xml 2012-03-26 07:27:46 UTC (rev 5955)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/resources/conf/portal/cluster/infinispan-data.xml 2012-03-26 07:48:10 UTC (rev 5956)
@@ -49,7 +49,7 @@
<locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="20000" writeSkewCheck="false" concurrencyLevel="500" useLockStriping="true"/>
<transaction transactionManagerLookupClass="org.exoplatform.services.transaction.infinispan.JBossStandaloneJTAManagerLookup" syncRollbackPhase="true" syncCommitPhase="true" transactionMode="TRANSACTIONAL"/>
<jmxStatistics enabled="true"/>
- <eviction strategy="LRU" threadPolicy="DEFAULT" maxEntries="1000000"/>
+ <eviction strategy="LIRS" threadPolicy="DEFAULT" maxEntries="1000000"/>
<expiration wakeUpInterval="5000"/>
</default>
</infinispan>
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/distributed-cache-configuration.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/distributed-cache-configuration.xml (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/distributed-cache-configuration.xml 2012-03-26 07:48:10 UTC (rev 5956)
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2010 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+
+-->
+<infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:infinispan:config:5.1 http://www.infinispan.org/schemas/infinispan-config-5.1.xsd"
+ xmlns="urn:infinispan:config:5.1">
+ <global>
+ <globalJmxStatistics jmxDomain="exo" enabled="true" allowDuplicateDomains="true"/>
+ <transport transportClass="org.infinispan.remoting.transport.jgroups.JGroupsTransport" clusterName="JCR-cluster" distributedSyncTimeout="20000">
+ <properties>
+ <property name="configurationFile" value="tcp-mux-v3.xml"/>
+ </properties>
+ </transport>
+ <shutdown hookBehavior="DEFAULT"/>
+ </global>
+ <namedCache name="JCRCache">
+ <locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="120000" writeSkewCheck="false" concurrencyLevel="500" useLockStriping="true" />
+ <transaction transactionManagerLookupClass="org.infinispan.transaction.lookup.GenericTransactionManagerLookup" syncRollbackPhase="true" syncCommitPhase="true" eagerLockSingleNode="true" transactionMode="TRANSACTIONAL"/>
+ <jmxStatistics enabled="true"/>
+ <clustering mode="distribution">
+ <l1 enabled="true" invalidationThreshold="-1"/>
+ <hash numOwners="2" rehashRpcTimeout="120000">
+ <groups enabled="true"/>
+ </hash>
+ <sync replTimeout="180000"/>
+ </clustering>
+ </namedCache>
+ <namedCache name="eXoCache">
+ <locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="120000" writeSkewCheck="false" concurrencyLevel="500" useLockStriping="true" />
+ <transaction transactionManagerLookupClass="org.infinispan.transaction.lookup.GenericTransactionManagerLookup" syncRollbackPhase="true" syncCommitPhase="true" eagerLockSingleNode="true" transactionMode="TRANSACTIONAL"/>
+ <jmxStatistics enabled="true"/>
+ <clustering mode="distribution">
+ <l1 enabled="true" invalidationThreshold="-1"/>
+ <hash numOwners="2" rehashRpcTimeout="120000"/>
+ <sync replTimeout="180000"/>
+ </clustering>
+ </namedCache>
+</infinispan>
\ No newline at end of file
Modified: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/test-infinispan-config.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/test-infinispan-config.xml 2012-03-26 07:27:46 UTC (rev 5955)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/test-infinispan-config.xml 2012-03-26 07:48:10 UTC (rev 5956)
@@ -49,7 +49,7 @@
<locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="20000" writeSkewCheck="false" concurrencyLevel="500" useLockStriping="true"/>
<transaction transactionManagerLookupClass="org.exoplatform.services.transaction.infinispan.JBossStandaloneJTAManagerLookup" syncRollbackPhase="true" syncCommitPhase="true"/>
<jmxStatistics enabled="true"/>
- <eviction strategy="LRU" threadPolicy="DEFAULT" maxEntries="1000000"/>
+ <eviction strategy="LIRS" threadPolicy="DEFAULT" maxEntries="1000000"/>
<expiration wakeUpInterval="5000"/>
</default>
</infinispan>
Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/master.xml
===================================================================
--- jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/master.xml 2012-03-26 07:27:46 UTC (rev 5955)
+++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/master.xml 2012-03-26 07:48:10 UTC (rev 5956)
@@ -41,8 +41,8 @@
<subtitle>Java Content Repository and Extension services</subtitle>
<copyright>
- <year>2009, 2010</year>
- <holder>eXoPlatform</holder>
+ <year>2012</year>
+ <holder>eXoPlatform SAS</holder>
</copyright>
</bookinfo>
Modified: jcr/trunk/pom.xml
===================================================================
--- jcr/trunk/pom.xml 2012-03-26 07:27:46 UTC (rev 5955)
+++ jcr/trunk/pom.xml 2012-03-26 07:48:10 UTC (rev 5956)
@@ -402,12 +402,12 @@
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-core</artifactId>
- <version>5.1.0.CR3</version>
+ <version>5.1.2.FINAL</version>
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-cachestore-jdbc</artifactId>
- <version>5.1.0.CR3</version>
+ <version>5.1.2.FINAL</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
12 years, 1 month
exo-jcr SVN: r5955 - in kernel/trunk: exo.kernel.component.ext.cache.impl.infinispan.v5 and 6 other directories.
by do-not-reply@jboss.org
Author: dkuleshov
Date: 2012-03-26 03:27:46 -0400 (Mon, 26 Mar 2012)
New Revision: 5955
Added:
kernel/trunk/exo.kernel.container/src/test/resources/tsm-excludes.properties
Modified:
kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/pom.xml
kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/cache/impl/infinispan/ExoCacheFactoryImpl.java
kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/ispn/DistributedCacheManager.java
kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/java/org/exoplatform/services/cache/impl/infinispan/distributed/TestDistributedExoCache.java
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/xml/Configuration.java
kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/TestPortalContainer.java
kernel/trunk/pom.xml
Log:
EXOJCR-1739: ported issues:
* EXOJCR-1715
* EXOJCR-1736
* EXOJCR-1789
* EXOJCR-1800
Modified: kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/pom.xml
===================================================================
--- kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/pom.xml 2012-03-23 16:08:49 UTC (rev 5954)
+++ kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/pom.xml 2012-03-26 07:27:46 UTC (rev 5955)
@@ -34,7 +34,7 @@
<dependency>
<groupId>org.jgroups</groupId>
<artifactId>jgroups</artifactId>
- <version>3.0.2.Final</version>
+ <version>3.0.6.Final</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
Modified: kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/cache/impl/infinispan/ExoCacheFactoryImpl.java
===================================================================
--- kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/cache/impl/infinispan/ExoCacheFactoryImpl.java 2012-03-23 16:08:49 UTC (rev 5954)
+++ kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/cache/impl/infinispan/ExoCacheFactoryImpl.java 2012-03-26 07:27:46 UTC (rev 5955)
@@ -41,12 +41,9 @@
import org.infinispan.configuration.global.GlobalConfigurationBuilder;
import org.infinispan.configuration.parsing.ConfigurationBuilderHolder;
import org.infinispan.configuration.parsing.Parser;
-import org.infinispan.distribution.ch.ConsistentHash;
-import org.infinispan.distribution.ch.DefaultConsistentHash;
import org.infinispan.eviction.EvictionStrategy;
import org.infinispan.jmx.MBeanServerLookup;
import org.infinispan.manager.DefaultCacheManager;
-import org.infinispan.util.Util;
import java.io.InputStream;
import java.io.Serializable;
@@ -55,6 +52,7 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.Map.Entry;
import java.util.Properties;
import java.util.Set;
import java.util.concurrent.Callable;
@@ -168,9 +166,6 @@
}
// Initialize the main cache manager
this.cacheManager = initCacheManager(cacheConfigTemplate);
- // Register the main cache manager
- mappingGlobalConfigCacheManager.put(cacheManager.getCacheManagerConfiguration().transport().clusterName(),
- cacheManager);
}
/**
@@ -216,10 +211,11 @@
throw new ExoCacheInitException("Cannot parse the configuration '" + cacheConfigTemplate + "'", e);
}
configureCacheManager(configBuilder);
+ DefaultCacheManager cacheManager;
try
{
// Create the CacheManager from the new configuration
- return new DefaultCacheManager(configBuilder.build(), config);
+ cacheManager = new DefaultCacheManager(configBuilder.build(), config);
}
catch (RuntimeException e) //NOSONAR
{
@@ -227,6 +223,10 @@
"Cannot initialize the CacheManager corresponding to the configuration '" + cacheConfigTemplate
+ "'", e);
}
+ // Register the main cache manager
+ mappingGlobalConfigCacheManager.put(cacheManager.getCacheManagerConfiguration().transport().clusterName(),
+ cacheManager);
+ return cacheManager;
}
});
}
@@ -344,10 +344,9 @@
currentCacheManager =
new DefaultCacheManager(configBuilder.build(), holder.getDefaultConfigurationBuilder()
.build(), false);
- for (ConfigurationBuilder b : holder.getConfigurationBuilders())
+ for (Entry<String, ConfigurationBuilder> entry : holder.getNamedConfigurationBuilders().entrySet())
{
- Configuration c = b.build();
- currentCacheManager.defineConfiguration(c.name(), c);
+ currentCacheManager.defineConfiguration(entry.getKey(), entry.getValue().build());
}
currentCacheManager.start();
// We register this new cache manager
@@ -370,15 +369,6 @@
}
}
confBuilder.read(cacheManager.getDefaultCacheConfiguration());
- //TODO remove it once ISPN-1687 will be fixed
- confBuilder.storeAsBinary().enabled(false);
- //TODO remove it once ISPN-1689 will be fixed
- confBuilder
- .clustering()
- .hash()
- .consistentHash(
- Util.<ConsistentHash> getInstance(DefaultConsistentHash.class.getName(), Thread.currentThread()
- .getContextClassLoader()));
}
else if (config.isDistributed())
{
@@ -399,15 +389,6 @@
if (LOG.isInfoEnabled())
LOG.info("The configuration template will be used for the the cache '" + region + "'.");
confBuilder.read(cacheManager.getDefaultCacheConfiguration());
- //TODO remove it once ISPN-1687 will be fixed
- confBuilder.storeAsBinary().enabled(false);
- //TODO remove it once ISPN-1689 will be fixed
- confBuilder
- .clustering()
- .hash()
- .consistentHash(
- Util.<ConsistentHash> getInstance(DefaultConsistentHash.class.getName(), Thread.currentThread()
- .getContextClassLoader()));
if (!config.isRepicated())
{
// The cache is local
Modified: kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/ispn/DistributedCacheManager.java
===================================================================
--- kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/ispn/DistributedCacheManager.java 2012-03-23 16:08:49 UTC (rev 5954)
+++ kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/ispn/DistributedCacheManager.java 2012-03-26 07:27:46 UTC (rev 5955)
@@ -29,21 +29,18 @@
import org.exoplatform.services.log.Log;
import org.exoplatform.services.transaction.TransactionService;
import org.infinispan.Cache;
-import org.infinispan.configuration.cache.Configuration;
import org.infinispan.configuration.cache.ConfigurationBuilder;
import org.infinispan.configuration.global.GlobalConfigurationBuilder;
import org.infinispan.configuration.parsing.ConfigurationBuilderHolder;
import org.infinispan.configuration.parsing.Parser;
-import org.infinispan.distribution.ch.ConsistentHash;
-import org.infinispan.distribution.ch.DefaultConsistentHash;
import org.infinispan.manager.DefaultCacheManager;
import org.infinispan.manager.EmbeddedCacheManager;
import org.infinispan.transaction.lookup.TransactionManagerLookup;
-import org.infinispan.util.Util;
import org.picocontainer.Startable;
import java.security.PrivilegedExceptionAction;
import java.util.Map;
+import java.util.Map.Entry;
import javax.transaction.TransactionManager;
@@ -143,8 +140,7 @@
LOG.debug("The configuration file of the DistributedCacheManager will be loaded from " + configurationFile);
}
final TemplateConfigurationHelper helper =
- new TemplateConfigurationHelper(new String[]{"^jgroups-configuration", "^infinispan-.*"},
- new String[]{"^infinispan-configuration"}, configManager);
+ new TemplateConfigurationHelper(new String[]{"^.*"}, new String[]{}, configManager);
if (LOG.isDebugEnabled() && parameters != null && !parameters.isEmpty())
{
LOG.debug("The parameters to use while processing the configuration file are " + parameters);
@@ -168,21 +164,15 @@
return tm;
}
};
- for (ConfigurationBuilder b : holder.getConfigurationBuilders())
+ for (Entry<String, ConfigurationBuilder> entry : holder.getNamedConfigurationBuilders().entrySet())
{
+ ConfigurationBuilder b = entry.getValue();
if (tm != null)
{
- b.transaction().transactionManagerLookup(tml);
+ b.transaction().transactionManagerLookup(tml);
}
- //TODO remove it once ISPN-1689 will be fixed
- b.clustering()
- .hash()
- .consistentHash(
- Util.<ConsistentHash> getInstance(DefaultConsistentHash.class.getName(), Thread.currentThread()
- .getContextClassLoader()));
- Configuration c = b.build();
- manager.defineConfiguration(c.name(), c);
- manager.getCache(c.name());
+ manager.defineConfiguration(entry.getKey(), b.build());
+ manager.getCache(entry.getKey());
}
return manager;
}
@@ -190,8 +180,8 @@
}
catch (Exception e)//NOSONAR
{
- throw new IllegalStateException("Could not initialize the cache manager corresponding to the configuration file "
- + configurationFile, e);
+ throw new IllegalStateException(
+ "Could not initialize the cache manager corresponding to the configuration file " + configurationFile, e);
}
}
Modified: kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/java/org/exoplatform/services/cache/impl/infinispan/distributed/TestDistributedExoCache.java
===================================================================
--- kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/java/org/exoplatform/services/cache/impl/infinispan/distributed/TestDistributedExoCache.java 2012-03-23 16:08:49 UTC (rev 5954)
+++ kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/java/org/exoplatform/services/cache/impl/infinispan/distributed/TestDistributedExoCache.java 2012-03-26 07:27:46 UTC (rev 5955)
@@ -510,7 +510,7 @@
}
}
- public static class MyKeyGenerator implements KeyGenerator<DistributedExoCache.CacheKey<MyKey>>
+ public static class MyKeyGenerator implements KeyGenerator<DistributedExoCache.CacheKey<Serializable>>
{
public static final Random rnd = new Random();
@@ -523,9 +523,9 @@
}
@Override
- public DistributedExoCache.CacheKey<MyKey> getKey()
+ public DistributedExoCache.CacheKey<Serializable> getKey()
{
- return new DistributedExoCache.CacheKey<MyKey>(fullName, new MyKey(rnd.nextLong()));
+ return new DistributedExoCache.CacheKey<Serializable>(fullName, new MyKey(rnd.nextLong()));
}
}
Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/xml/Configuration.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/xml/Configuration.java 2012-03-23 16:08:49 UTC (rev 5954)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/xml/Configuration.java 2012-03-26 07:27:46 UTC (rev 5955)
@@ -257,16 +257,8 @@
}
else if (result == null)
{
- try
- {
- // Initialize with the clone of the first non null configuration
- result = (Configuration)conf.clone();
- }
- catch (CloneNotSupportedException e)
- {
- LOG.warn("Could not clone the configuration", e);
- break;
- }
+ // Initialize with the clone of the first non null configuration
+ result = (Configuration)conf.clone();
}
else
{
@@ -276,6 +268,42 @@
}
return result;
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ protected Object clone()
+ {
+ try
+ {
+ Configuration conf = (Configuration)super.clone();
+ conf.component_ = (Map<String, Component>)((HashMap<String, Component>)component_).clone();
+ conf.componentLifecyclePlugin_ =
+ (Map<String, ComponentLifecyclePlugin>)((HashMap<String, ComponentLifecyclePlugin>)componentLifecyclePlugin_)
+ .clone();
+ conf.containerLifecyclePlugin_ =
+ (Map<String, ContainerLifecyclePlugin>)((HashMap<String, ContainerLifecyclePlugin>)containerLifecyclePlugin_)
+ .clone();
+ conf.externalComponentPlugins_ =
+ (Map<String, ExternalComponentPlugins>)((HashMap<String, ExternalComponentPlugins>)externalComponentPlugins_)
+ .clone();
+ if (imports_ != null)
+ {
+ conf.imports_ = (ArrayList<String>)imports_.clone();
+ }
+ if (removeConfiguration_ != null)
+ {
+ conf.removeConfiguration_ = (ArrayList<String>)removeConfiguration_.clone();
+ }
+ return conf;
+ }
+ catch (CloneNotSupportedException e)
+ {
+ throw new AssertionError("Could not clone the configuration");
+ }
+ }
/**
* Dumps the configuration in XML format into the given {@link Writer}
Modified: kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/TestPortalContainer.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/TestPortalContainer.java 2012-03-23 16:08:49 UTC (rev 5954)
+++ kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/TestPortalContainer.java 2012-03-26 07:27:46 UTC (rev 5955)
@@ -161,6 +161,36 @@
assertNull(PortalContainer.getCurrentSetting("boolean"));
}
+ public void testGetConfigurationXML()
+ {
+ URL rootURL = getClass().getResource("test-exo-container.xml");
+ URL portalURL = getClass().getResource("/conf/test-configuration.xml");
+ assertNotNull(rootURL);
+ assertNotNull(portalURL);
+ //
+ new ContainerBuilder().withRoot(rootURL).withPortal(portalURL).build();
+
+ String configXML = RootContainer.getInstance().getConfigurationXML();
+ assertNotNull(configXML);
+ int size = configXML.length();
+ int hash = configXML.hashCode();
+ configXML = RootContainer.getInstance().getConfigurationXML();
+ assertNotNull(configXML);
+ assertTrue(size > 0);
+ assertEquals(size, configXML.length());
+ assertEquals(hash, configXML.hashCode());
+
+ configXML = PortalContainer.getInstance().getConfigurationXML();
+ assertNotNull(configXML);
+ assertTrue(size > 0);
+ size = configXML.length();
+ hash = configXML.hashCode();
+ configXML = PortalContainer.getInstance().getConfigurationXML();
+ assertNotNull(configXML);
+ assertEquals(size, configXML.length());
+ assertEquals(hash, configXML.hashCode());
+ }
+
public static class MyComponent
{
private final InitParams params;
Added: kernel/trunk/exo.kernel.container/src/test/resources/tsm-excludes.properties
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/tsm-excludes.properties (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/resources/tsm-excludes.properties 2012-03-26 07:27:46 UTC (rev 5955)
@@ -0,0 +1 @@
+org.exoplatform.container.TestPortalContainer.testGetConfigurationXML=getConfigurationXML
\ No newline at end of file
Modified: kernel/trunk/pom.xml
===================================================================
--- kernel/trunk/pom.xml 2012-03-23 16:08:49 UTC (rev 5954)
+++ kernel/trunk/pom.xml 2012-03-26 07:27:46 UTC (rev 5955)
@@ -203,7 +203,7 @@
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-core</artifactId>
- <version>5.1.0.CR3</version>
+ <version>5.1.2.FINAL</version>
</dependency>
<dependency>
<groupId>org.jibx</groupId>
12 years, 1 month
exo-jcr SVN: r5954 - jcr/branches/1.12.x/patch/1.12.13-GA/JCR-1717.
by do-not-reply@jboss.org
Author: nzamosenchuk
Date: 2012-03-23 12:08:49 -0400 (Fri, 23 Mar 2012)
New Revision: 5954
Modified:
jcr/branches/1.12.x/patch/1.12.13-GA/JCR-1717/JCR-1717.patch
Log:
JCR-1717 : wrap CountDownLatch by AtomicReference.
Modified: jcr/branches/1.12.x/patch/1.12.13-GA/JCR-1717/JCR-1717.patch
===================================================================
--- jcr/branches/1.12.x/patch/1.12.13-GA/JCR-1717/JCR-1717.patch 2012-03-23 15:54:12 UTC (rev 5953)
+++ jcr/branches/1.12.x/patch/1.12.13-GA/JCR-1717/JCR-1717.patch 2012-03-23 16:08:49 UTC (rev 5954)
@@ -1,6 +1,6 @@
Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/PersistentDataManager.java
===================================================================
---- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/PersistentDataManager.java (revision 5948)
+--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/PersistentDataManager.java (revision 5951)
+++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/PersistentDataManager.java (working copy)
@@ -20,6 +20,7 @@
@@ -21,7 +21,7 @@
void addItemPersistenceListener(ItemsPersistenceListener listener);
Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java
===================================================================
---- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java (revision 5948)
+--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java (revision 5951)
+++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java (working copy)
@@ -39,6 +39,9 @@
import org.exoplatform.services.jcr.datamodel.QPath;
@@ -222,7 +222,7 @@
}
Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java
===================================================================
---- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java (revision 5948)
+--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java (revision 5951)
+++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java (working copy)
@@ -45,6 +45,9 @@
import org.exoplatform.services.jcr.datamodel.PropertyData;
@@ -234,16 +234,17 @@
import org.exoplatform.services.jcr.impl.core.LocationFactory;
import org.exoplatform.services.jcr.impl.core.SessionDataManager;
import org.exoplatform.services.jcr.impl.core.SessionImpl;
-@@ -78,6 +81,8 @@
+@@ -78,6 +81,9 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.atomic.AtomicBoolean;
++import java.util.concurrent.atomic.AtomicReference;
import javax.jcr.RepositoryException;
import javax.jcr.query.InvalidQueryException;
-@@ -89,7 +94,7 @@
+@@ -89,7 +95,7 @@
* Implements a {@link org.apache.jackrabbit.core.query.QueryHandler} using
* Lucene.
*/
@@ -252,13 +253,13 @@
{
private static final DefaultQueryNodeFactory DEFAULT_QUERY_NODE_FACTORY = new DefaultQueryNodeFactory();
-@@ -448,6 +453,16 @@
+@@ -448,6 +454,16 @@
private final ConfigurationManager cfm;
/**
+ * Waiting query execution until resume.
+ */
-+ protected CountDownLatch latcher = null;
++ protected AtomicReference<CountDownLatch> latcher = new AtomicReference<CountDownLatch>();
+
+ /**
+ * Indicates if component suspended or not.
@@ -269,7 +270,27 @@
* Working constructor.
*
* @throws RepositoryConfigurationException
-@@ -819,26 +834,29 @@
+@@ -708,8 +724,7 @@
+ }
+ catch (RepositoryException e)
+ {
+- log
+- .warn("Exception while creating document for node: " + state.getIdentifier() + ": " + e.toString(), e);
++ log.warn("Exception while creating document for node: " + state.getIdentifier() + ": " + e.toString(), e);
+ }
+ return doc;
+ }
+@@ -736,8 +751,7 @@
+ }
+ catch (RepositoryException e)
+ {
+- log
+- .warn("Exception while creating document for node: " + state.getIdentifier() + ": " + e.toString());
++ log.warn("Exception while creating document for node: " + state.getIdentifier() + ": " + e.toString());
+ }
+ return null;
+ }
+@@ -819,26 +833,29 @@
*/
public void close()
{
@@ -313,7 +334,7 @@
}
/**
-@@ -866,6 +884,8 @@
+@@ -866,6 +883,8 @@
public MultiColumnQueryHits executeQuery(SessionImpl session, AbstractQueryImpl queryImpl, Query query,
QPath[] orderProps, boolean[] orderSpecs, long resultFetchHint) throws IOException, RepositoryException
{
@@ -322,7 +343,7 @@
checkOpen();
Sort sort = new Sort(createSortFields(orderProps, orderSpecs));
-@@ -914,6 +934,8 @@
+@@ -914,6 +933,8 @@
public MultiColumnQueryHits executeQuery(SessionImpl session, MultiColumnQuery query, QPath[] orderProps,
boolean[] orderSpecs, long resultFetchHint) throws IOException, RepositoryException
{
@@ -331,7 +352,28 @@
checkOpen();
Sort sort = new Sort(createSortFields(orderProps, orderSpecs));
-@@ -2710,6 +2732,8 @@
+@@ -1330,8 +1351,8 @@
+ {
+ File root = new File(path, synonymProviderConfigPath.substring(0, lastSeparator));
+ fsr =
+- new BufferedInputStream(new FileInputStream(new File(root, synonymProviderConfigPath
+- .substring(lastSeparator + 1))));
++ new BufferedInputStream(new FileInputStream(new File(root,
++ synonymProviderConfigPath.substring(lastSeparator + 1))));
+ }
+ else
+ {
+@@ -1540,8 +1561,7 @@
+ catch (Exception e)
+ {
+ // do not fail if aggregate cannot be created
+- log
+- .warn("Exception while building indexing aggregate for" + " node with UUID: " + state.getIdentifier(), e);
++ log.warn("Exception while building indexing aggregate for" + " node with UUID: " + state.getIdentifier(), e);
+ }
+ }
+ }
+@@ -2710,6 +2730,8 @@
*/
public QueryHits executeQuery(Query query) throws IOException
{
@@ -340,7 +382,7 @@
checkOpen();
IndexReader reader = getIndexReader(true);
-@@ -2742,4 +2766,76 @@
+@@ -2742,4 +2764,76 @@
log.error("Can not recover error log.", e);
}
}
@@ -350,7 +392,7 @@
+ */
+ public void suspend() throws SuspendException
+ {
-+ latcher = new CountDownLatch(1);
++ latcher.set(new CountDownLatch(1));
+ close();
+
+ isSuspended.set(true);
@@ -366,7 +408,7 @@
+ closed = false;
+ doInit();
+
-+ latcher.countDown();
++ latcher.get().countDown();
+
+ isSuspended.set(false);
+ }
@@ -400,7 +442,7 @@
+ {
+ try
+ {
-+ latcher.await();
++ latcher.get().await();
+ }
+ catch (InterruptedException e)
+ {
@@ -419,7 +461,7 @@
}
Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java
===================================================================
---- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java (revision 5948)
+--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java (revision 5951)
+++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java (working copy)
@@ -177,7 +177,7 @@
/**
@@ -744,7 +786,7 @@
}
Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/RepositoryImpl.java
===================================================================
---- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/RepositoryImpl.java (revision 5948)
+--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/RepositoryImpl.java (revision 5951)
+++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/RepositoryImpl.java (working copy)
@@ -137,6 +137,11 @@
private int state = OFFLINE;
@@ -892,7 +934,7 @@
+}
Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java
===================================================================
---- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java (revision 5948)
+--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java (revision 5951)
+++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java (working copy)
@@ -30,6 +30,9 @@
import org.exoplatform.services.jcr.datamodel.QPathEntry;
@@ -904,16 +946,17 @@
import org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache;
import org.exoplatform.services.jcr.impl.storage.SystemDataContainerHolder;
import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCStorageConnection;
-@@ -41,6 +44,8 @@
+@@ -41,6 +44,9 @@
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicInteger;
++import java.util.concurrent.atomic.AtomicReference;
import javax.jcr.RepositoryException;
import javax.transaction.TransactionManager;
-@@ -54,7 +59,7 @@
+@@ -54,7 +60,7 @@
*
* @version $Id$
*/
@@ -922,7 +965,7 @@
{
/**
-@@ -70,6 +75,21 @@
+@@ -70,6 +76,21 @@
private TransactionManager transactionManager;
/**
@@ -938,13 +981,13 @@
+ /**
+ * Allows to make all threads waiting until resume.
+ */
-+ protected CountDownLatch latcher = null;
++ protected AtomicReference<CountDownLatch> latcher = new AtomicReference<CountDownLatch>();
+
+ /**
* ItemData request, used on get operations.
*
*/
-@@ -536,6 +556,39 @@
+@@ -536,6 +557,39 @@
@Override
public void save(final ItemStateChangesLog changesLog) throws RepositoryException
{
@@ -952,7 +995,7 @@
+ {
+ try
+ {
-+ latcher.await();
++ latcher.get().await();
+ }
+ catch (InterruptedException e)
+ {
@@ -984,7 +1027,7 @@
if (isTxAware())
{
// save in dedicated XA transaction
-@@ -952,4 +1005,75 @@
+@@ -952,4 +1006,75 @@
conn.close();
}
}
@@ -1019,7 +1062,7 @@
+ {
+ if (!isSuspended.get())
+ {
-+ latcher = new CountDownLatch(1);
++ latcher.set(new CountDownLatch(1));
+ isSuspended.set(true);
+
+ if (workingThreads.get() > 0)
@@ -1049,7 +1092,7 @@
+ {
+ if (isSuspended.get())
+ {
-+ latcher.countDown();
++ latcher.get().countDown();
+ isSuspended.set(false);
+ }
+ }
@@ -1064,7 +1107,7 @@
+}
Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryContainer.java
===================================================================
---- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryContainer.java (revision 5948)
+--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryContainer.java (revision 5951)
+++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryContainer.java (working copy)
@@ -29,6 +29,7 @@
import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
@@ -1316,7 +1359,7 @@
+}
Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/ManageableRepository.java
===================================================================
---- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/ManageableRepository.java (revision 5948)
+--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/ManageableRepository.java (revision 5951)
+++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/ManageableRepository.java (working copy)
@@ -62,6 +62,16 @@
final int READONLY = 2;
@@ -1347,7 +1390,7 @@
Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/WorkspaceContainerFacade.java
===================================================================
---- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/WorkspaceContainerFacade.java (revision 5948)
+--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/WorkspaceContainerFacade.java (revision 5951)
+++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/WorkspaceContainerFacade.java (working copy)
@@ -18,8 +18,18 @@
*/
12 years, 1 month
exo-jcr SVN: r5953 - jcr/trunk/exo.jcr.connectors.jca.
by do-not-reply@jboss.org
Author: tolusha
Date: 2012-03-23 11:54:12 -0400 (Fri, 23 Mar 2012)
New Revision: 5953
Modified:
jcr/trunk/exo.jcr.connectors.jca/pom.xml
Log:
EXOJCR-1785: Error on startup tomcat
Modified: jcr/trunk/exo.jcr.connectors.jca/pom.xml
===================================================================
--- jcr/trunk/exo.jcr.connectors.jca/pom.xml 2012-03-23 15:53:52 UTC (rev 5952)
+++ jcr/trunk/exo.jcr.connectors.jca/pom.xml 2012-03-23 15:54:12 UTC (rev 5953)
@@ -89,7 +89,6 @@
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
- <index>false</index>
<manifest>
<addClasspath>true</addClasspath>
</manifest>
12 years, 1 month
exo-jcr SVN: r5952 - parent/branches/1.15.x.
by do-not-reply@jboss.org
Author: tolusha
Date: 2012-03-23 11:53:52 -0400 (Fri, 23 Mar 2012)
New Revision: 5952
Modified:
parent/branches/1.15.x/pom.xml
Log:
EXOJCR-1785: Error on startup tomcat
Modified: parent/branches/1.15.x/pom.xml
===================================================================
--- parent/branches/1.15.x/pom.xml 2012-03-23 15:41:00 UTC (rev 5951)
+++ parent/branches/1.15.x/pom.xml 2012-03-23 15:53:52 UTC (rev 5952)
@@ -188,6 +188,7 @@
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
+ <index>fasle</index>
<manifestEntries combine.self="override">
<Specification-Title>${exo.product.name}</Specification-Title>
<Specification-Version>${exo.product.specification}</Specification-Version>
@@ -214,6 +215,7 @@
<artifactId>maven-war-plugin</artifactId>
<configuration>
<archive>
+ <index>fasle</index>
<manifestEntries combine.self="override">
<SCM-URL>${project.scm.connection}</SCM-URL>
<Specification-Title>${exo.product.name}</Specification-Title>
@@ -315,6 +317,7 @@
<artifactId>maven-war-plugin</artifactId>
<configuration>
<archive>
+ <index>fasle</index>
<manifestEntries combine.self="override">
<SCM-Revision>${buildNumber}</SCM-Revision>
<SCM-URL>${project.scm.connection}</SCM-URL>
@@ -335,6 +338,7 @@
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
+ <index>fasle</index>
<manifestEntries combine.self="override">
<SCM-Revision>${buildNumber}</SCM-Revision>
<SCM-URL>${project.scm.connection}</SCM-URL>
12 years, 1 month
exo-jcr SVN: r5951 - jcr/branches/1.14.x/patch/1.14.8-GA/JCR-1725.
by do-not-reply@jboss.org
Author: nzamosenchuk
Date: 2012-03-23 11:41:00 -0400 (Fri, 23 Mar 2012)
New Revision: 5951
Modified:
jcr/branches/1.14.x/patch/1.14.8-GA/JCR-1725/JCR-1725.patch
Log:
JCR-1725 : wrap CountDownLatch by AtomicReference.
Modified: jcr/branches/1.14.x/patch/1.14.8-GA/JCR-1725/JCR-1725.patch
===================================================================
--- jcr/branches/1.14.x/patch/1.14.8-GA/JCR-1725/JCR-1725.patch 2012-03-23 15:09:35 UTC (rev 5950)
+++ jcr/branches/1.14.x/patch/1.14.8-GA/JCR-1725/JCR-1725.patch 2012-03-23 15:41:00 UTC (rev 5951)
@@ -2,7 +2,7 @@
===================================================================
--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java (revision 5945)
+++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java (working copy)
-@@ -81,8 +81,19 @@
+@@ -81,8 +81,20 @@
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.security.PrivilegedAction;
@@ -20,10 +20,11 @@
+import java.util.Set;
import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.atomic.AtomicBoolean;
++import java.util.concurrent.atomic.AtomicReference;
import javax.jcr.RepositoryException;
import javax.jcr.query.InvalidQueryException;
-@@ -202,7 +213,7 @@
+@@ -202,7 +214,7 @@
* Default name of the error log file
*/
private static final String ERROR_LOG = "error.log";
@@ -32,8 +33,14 @@
/**
* The actual index
*/
-@@ -521,7 +532,7 @@
+@@ -516,12 +528,12 @@
/**
+ * Waiting query execution until resume.
+ */
+- protected CountDownLatch latcher = null;
++ protected AtomicReference<CountDownLatch> latcher = new AtomicReference<CountDownLatch>();
+
+ /**
* Indicates if component suspended or not.
*/
- protected boolean isSuspended = false;
@@ -41,7 +48,7 @@
protected final Set<String> recoveryFilterClasses;
-@@ -674,10 +685,9 @@
+@@ -674,10 +686,9 @@
}
catch (IOException e)
{
@@ -55,7 +62,7 @@
}
}
}, "Reindexing-" + context.getRepositoryName() + "-" + context.getContainer().getWorkspaceName()).start();
-@@ -1120,8 +1130,7 @@
+@@ -1120,8 +1131,7 @@
}
catch (RepositoryException e)
{
@@ -65,7 +72,7 @@
}
return doc;
}
-@@ -1148,8 +1157,7 @@
+@@ -1148,8 +1158,7 @@
}
catch (RepositoryException e)
{
@@ -75,7 +82,7 @@
}
return null;
}
-@@ -2029,8 +2037,7 @@
+@@ -2029,8 +2038,7 @@
catch (Exception e)
{
// do not fail if aggregate cannot be created
@@ -85,8 +92,12 @@
}
}
}
-@@ -3383,7 +3390,7 @@
- latcher = new CountDownLatch(1);
+@@ -3380,10 +3388,10 @@
+ */
+ public void suspend() throws SuspendException
+ {
+- latcher = new CountDownLatch(1);
++ latcher.set(new CountDownLatch(1));
close();
- isSuspended = true;
@@ -94,16 +105,19 @@
}
/**
-@@ -3398,7 +3405,7 @@
+@@ -3396,9 +3404,9 @@
+ closed = false;
+ doInit();
- latcher.countDown();
+- latcher.countDown();
++ latcher.get().countDown();
- isSuspended = false;
+ isSuspended.set(false);
}
catch (IOException e)
{
-@@ -3415,7 +3422,7 @@
+@@ -3415,7 +3423,7 @@
*/
public boolean isSuspended()
{
@@ -112,7 +126,7 @@
}
/**
-@@ -3426,7 +3433,7 @@
+@@ -3426,11 +3434,11 @@
*/
private void waitForResuming() throws IOException
{
@@ -121,6 +135,11 @@
{
try
{
+- latcher.await();
++ latcher.get().await();
+ }
+ catch (InterruptedException e)
+ {
Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java
===================================================================
--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java (revision 5945)
@@ -271,7 +290,15 @@
===================================================================
--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java (revision 5945)
+++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java (working copy)
-@@ -141,7 +141,7 @@
+@@ -74,6 +74,7 @@
+ import java.util.concurrent.CountDownLatch;
+ import java.util.concurrent.atomic.AtomicBoolean;
+ import java.util.concurrent.atomic.AtomicInteger;
++import java.util.concurrent.atomic.AtomicReference;
+
+ import javax.jcr.RepositoryException;
+ import javax.transaction.Status;
+@@ -141,12 +142,12 @@
/**
* Indicates if component suspended or not.
*/
@@ -280,8 +307,14 @@
/**
* Allows to make all threads waiting until resume.
-@@ -927,7 +927,7 @@
*/
+- protected CountDownLatch latcher = null;
++ protected AtomicReference<CountDownLatch> latcher = new AtomicReference<CountDownLatch>();
+
+ /**
+ * Indicates that node keep responsible for resuming.
+@@ -927,11 +928,11 @@
+ */
public void save(final ItemStateChangesLog changesLog) throws RepositoryException
{
- if (isSuspended)
@@ -289,7 +322,12 @@
{
try
{
-@@ -971,7 +971,7 @@
+- latcher.await();
++ latcher.get().await();
+ }
+ catch (InterruptedException e)
+ {
+@@ -971,7 +972,7 @@
{
workingThreads.decrementAndGet();
@@ -298,7 +336,7 @@
{
synchronized (workingThreads)
{
-@@ -1987,15 +1987,15 @@
+@@ -1987,15 +1988,15 @@
*/
public boolean isSuspended()
{
@@ -311,26 +349,28 @@
- if (!isSuspended)
+ if (!isSuspended.get())
{
- latcher = new CountDownLatch(1);
+- latcher = new CountDownLatch(1);
- isSuspended = true;
++ latcher.set(new CountDownLatch(1));
+ isSuspended.set(true);
if (workingThreads.get() > 0)
{
-@@ -2022,10 +2022,10 @@
+@@ -2022,10 +2023,10 @@
private void resumeLocally() throws ResumeException
{
- if (isSuspended)
+ if (isSuspended.get())
{
- latcher.countDown();
+- latcher.countDown();
- isSuspended = false;
++ latcher.get().countDown();
+ isSuspended.set(false);
}
}
-@@ -2034,7 +2034,7 @@
+@@ -2034,7 +2035,7 @@
*/
public void onChange(TopologyChangeEvent event)
{
12 years, 1 month
exo-jcr SVN: r5950 - in jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl: dataflow/persistent and 1 other directory.
by do-not-reply@jboss.org
Author: nzamosenchuk
Date: 2012-03-23 11:09:35 -0400 (Fri, 23 Mar 2012)
New Revision: 5950
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/dataflow/persistent/CacheableWorkspaceDataManager.java
Log:
EXOJCR-1825 : field latcher is AtomicReferece now.
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-03-23 13:14:54 UTC (rev 5949)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java 2012-03-23 15:09:35 UTC (rev 5950)
@@ -96,6 +96,7 @@
import java.util.Set;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicReference;
import javax.jcr.RepositoryException;
import javax.jcr.query.InvalidQueryException;
@@ -519,7 +520,7 @@
/**
* Waiting query execution until resume.
*/
- protected CountDownLatch latcher = null;
+ protected AtomicReference<CountDownLatch> latcher = new AtomicReference<CountDownLatch>();
/**
* Indicates if component suspended or not.
@@ -3358,7 +3359,7 @@
*/
public void suspend() throws SuspendException
{
- latcher = new CountDownLatch(1);
+ latcher.set(new CountDownLatch(1));
close();
isSuspended.set(true);
@@ -3374,7 +3375,7 @@
closed = false;
doInit();
- latcher.countDown();
+ latcher.get().countDown();
isSuspended.set(false);
}
@@ -3408,7 +3409,7 @@
{
try
{
- latcher.await();
+ latcher.get().await();
}
catch (InterruptedException e)
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java 2012-03-23 13:14:54 UTC (rev 5949)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java 2012-03-23 15:09:35 UTC (rev 5950)
@@ -74,6 +74,7 @@
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicReference;
import javax.jcr.RepositoryException;
import javax.transaction.Status;
@@ -146,7 +147,7 @@
/**
* Allows to make all threads waiting until resume.
*/
- protected CountDownLatch latcher = null;
+ protected AtomicReference<CountDownLatch> latcher = new AtomicReference<CountDownLatch>();
/**
* Indicates that node keep responsible for resuming.
@@ -920,7 +921,7 @@
{
try
{
- latcher.await();
+ latcher.get().await();
}
catch (InterruptedException e)
{
@@ -1982,7 +1983,7 @@
{
if (!isSuspended.get())
{
- latcher = new CountDownLatch(1);
+ latcher.set(new CountDownLatch(1));
isSuspended.set(true);
if (workingThreads.get() > 0)
@@ -2012,7 +2013,7 @@
{
if (isSuspended.get())
{
- latcher.countDown();
+ latcher.get().countDown();
isSuspended.set(false);
}
}
12 years, 1 month