Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2013-05-30 13:32:43 -0400
committerEike Stepper2013-05-30 13:32:59 -0400
commit4ad63b9bde0951b6fa5fb527e372bfc06c0da57c (patch)
tree66b27fbc41e6165464c120e4202c5f6a1e31d20e
parentbcb61de39d9119822d68b1fc70ae494f21dc6497 (diff)
downloadcdo-4ad63b9bde0951b6fa5fb527e372bfc06c0da57c.tar.gz
cdo-4ad63b9bde0951b6fa5fb527e372bfc06c0da57c.tar.xz
cdo-4ad63b9bde0951b6fa5fb527e372bfc06c0da57c.zip
Enhance thread names
-rw-r--r--plugins/org.eclipse.emf.cdo.common.db/.settings/.api_filters6
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/AbstractCDORevisionCache.java50
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/CDORevisionManagerImpl.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/InternalCDORevisionCache.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreAccessor.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractListTableMapping.java2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java6
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/SignalProtocol.java6
9 files changed, 76 insertions, 8 deletions
diff --git a/plugins/org.eclipse.emf.cdo.common.db/.settings/.api_filters b/plugins/org.eclipse.emf.cdo.common.db/.settings/.api_filters
index 751c8a17f5..e46b9e3036 100644
--- a/plugins/org.eclipse.emf.cdo.common.db/.settings/.api_filters
+++ b/plugins/org.eclipse.emf.cdo.common.db/.settings/.api_filters
@@ -33,6 +33,12 @@
</filter>
</resource>
<resource path="src/org/eclipse/emf/cdo/common/internal/db/cache/DBRevisionCache.java" type="org.eclipse.emf.cdo.common.internal.db.cache.DBRevisionCache">
+ <filter id="574619656">
+ <message_arguments>
+ <message_argument value="InternalCDORevisionCache"/>
+ <message_argument value="DBRevisionCache"/>
+ </message_arguments>
+ </filter>
<filter id="574660632">
<message_arguments>
<message_argument value="InternalCDORevisionCache"/>
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/AbstractCDORevisionCache.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/AbstractCDORevisionCache.java
index 91ef96c422..316af6f722 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/AbstractCDORevisionCache.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/AbstractCDORevisionCache.java
@@ -16,10 +16,12 @@ import org.eclipse.emf.cdo.common.branch.CDOBranch;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.revision.CDORevision;
import org.eclipse.emf.cdo.common.revision.CDORevisionKey;
+import org.eclipse.emf.cdo.internal.common.bundle.OM;
import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevision;
import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevisionCache;
import org.eclipse.net4j.util.event.IListener;
+import org.eclipse.net4j.util.om.trace.ContextTracer;
import org.eclipse.net4j.util.ref.ReferenceQueueWorker;
import java.lang.ref.Reference;
@@ -33,13 +35,39 @@ import java.text.MessageFormat;
public abstract class AbstractCDORevisionCache extends ReferenceQueueWorker<InternalCDORevision> implements
InternalCDORevisionCache
{
+ private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG_REVISION, AbstractCDORevisionCache.class);
+
private static boolean disableGC;
+ private String name;
+
public AbstractCDORevisionCache()
{
setDaemon(true);
}
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ @Override
+ public String toString()
+ {
+ return formatName("CDORevisionCache");
+ }
+
+ @Override
+ protected String getThreadName()
+ {
+ return formatName("CDORevisionCacheCleaner");
+ }
+
+ private String formatName(String prefix)
+ {
+ return prefix + (name == null ? "" : "-" + name);
+ }
+
@Override
protected void work(Reference<? extends InternalCDORevision> reference)
{
@@ -61,22 +89,36 @@ public abstract class AbstractCDORevisionCache extends ReferenceQueueWorker<Inte
{
fireEvent(new EvictionEventImpl(this, key), listeners);
}
+
+ if (TRACER.isEnabled())
+ {
+ TRACER.format("Evicted {0} from {1}", key, this); //$NON-NLS-1$
+ }
}
protected Reference<InternalCDORevision> createReference(CDORevision revision)
{
if (disableGC)
{
- return new CacheStrongReference((InternalCDORevision)revision);
+ return createStrongReference(revision);
+ }
+
+ if (TRACER.isEnabled())
+ {
+ TRACER.format("Adding revision {0} to {1}", revision, this); //$NON-NLS-1$
}
return new CacheSoftReference((InternalCDORevision)revision, getQueue());
}
- @Override
- protected String getThreadName()
+ private Reference<InternalCDORevision> createStrongReference(CDORevision revision)
{
- return "CDORevisionCacheCleaner";
+ if (TRACER.isEnabled())
+ {
+ TRACER.format("Adding revision {0} to {1} (STRONGLY REFERENCED)", revision, this); //$NON-NLS-1$
+ }
+
+ return new CacheStrongReference((InternalCDORevision)revision);
}
/**
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/CDORevisionManagerImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/CDORevisionManagerImpl.java
index 38e480e140..2c7fc8a4d3 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/CDORevisionManagerImpl.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/CDORevisionManagerImpl.java
@@ -480,6 +480,12 @@ public class CDORevisionManagerImpl extends Lifecycle implements InternalCDORevi
{
cache = (InternalCDORevisionCache)CDORevisionUtil.createRevisionCache(supportingAudits, supportingBranches);
}
+
+ if (cache instanceof AbstractCDORevisionCache)
+ {
+ String name = revisionLoader.toString();
+ ((AbstractCDORevisionCache)cache).setName(name);
+ }
}
@Override
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/InternalCDORevisionCache.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/InternalCDORevisionCache.java
index a2dcaaddf7..a6d8991603 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/InternalCDORevisionCache.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/InternalCDORevisionCache.java
@@ -26,6 +26,8 @@ import java.util.List;
*
* @author Eike Stepper
* @since 3.0
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
*/
public interface InternalCDORevisionCache extends CDORevisionCache, CDOAllRevisionsProvider, ILifecycle
{
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreAccessor.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreAccessor.java
index 9dc67a301a..a1c87a559f 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreAccessor.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreAccessor.java
@@ -243,13 +243,13 @@ public class DBStoreAccessor extends StoreAccessor implements IDBStoreAccessor,
if (eClass != null)
{
InternalCDORevision revision = getStore().createRevision(eClass, id);
- revision.setBranchPoint(branchPoint);
+ revision.setBranchPoint(branchPoint); // This is part of the search criterion, being replaced later
IClassMapping mapping = mappingStrategy.getClassMapping(eClass);
if (mapping.readRevision(this, revision, listChunk))
{
int version = revision.getVersion();
- if (version < CDOBranchVersion.FIRST_VERSION - 1)
+ if (version < CDOBranchVersion.UNSPECIFIED_VERSION)
{
return new DetachedCDORevision(eClass, id, revision.getBranch(), -version, revision.getTimeStamp(),
revision.getRevised());
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractListTableMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractListTableMapping.java
index dcd8821967..f289912414 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractListTableMapping.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractListTableMapping.java
@@ -219,7 +219,7 @@ public abstract class AbstractListTableMapping extends AbstractBasicListTableMap
if (listChunk == 0 || list.size() == 0)
{
- // nothing to read take shortcut
+ // Nothing to read. Take shortcut.
return;
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java
index 9e62b06751..b783e08b74 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java
@@ -1126,6 +1126,12 @@ public abstract class CDOSessionImpl extends CDOTransactionContainerImpl impleme
context.terminate();
}
}
+
+ @Override
+ protected String getThreadName()
+ {
+ return "CDOSessionInvalidationRunner-" + CDOSessionImpl.this;
+ }
};
invalidationRunner.activate();
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java
index 87be6c076f..0c47637346 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java
@@ -927,7 +927,7 @@ public class CDOViewImpl extends AbstractCDOView
@Override
protected String getThreadName()
{
- return "CDOInvalidationRunner-" + CDOViewImpl.this; //$NON-NLS-1$
+ return "CDOViewInvalidationRunner-" + CDOViewImpl.this; //$NON-NLS-1$
}
@Override
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/SignalProtocol.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/SignalProtocol.java
index 285018e34b..967b7e54f4 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/SignalProtocol.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/SignalProtocol.java
@@ -252,6 +252,12 @@ public class SignalProtocol<INFRA_STRUCTURE> extends Protocol<INFRA_STRUCTURE> i
@Override
public String toString()
{
+ IChannel channel = getChannel();
+ if (channel != null)
+ {
+ return MessageFormat.format("SignalProtocol[{0}, {1}, {2}]", channel.getID(), channel.getLocation(), getType()); //$NON-NLS-1$
+ }
+
return MessageFormat.format("SignalProtocol[{0}]", getType()); //$NON-NLS-1$
}

Back to the top