Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2016-02-16 12:30:23 +0000
committerEike Stepper2016-02-16 12:30:23 +0000
commit575951a1cad4dbddf610c8290b6bf7f7831c4061 (patch)
tree5352422391cc12975380cb9078419b15c3422a06 /plugins
parent1f70c6f6785d44bf46eb1b08be13980027eeaa2e (diff)
downloadcdo-575951a1cad4dbddf610c8290b6bf7f7831c4061.tar.gz
cdo-575951a1cad4dbddf610c8290b6bf7f7831c4061.tar.xz
cdo-575951a1cad4dbddf610c8290b6bf7f7831c4061.zip
[486458] Provide support for optimized loading and notifying of object units
https://bugs.eclipse.org/bugs/show_bug.cgi?id=486458
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/checkouts/CDOModelEditorOpener.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/bundle/OM.java3
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/.options2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/bundle/OM.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalAuditClassMapping.java15
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_486458_Test.java5
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/bundle/AbstractBundle.java16
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/bundle/AbstractPlatform.java12
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/LegacyBundle.java10
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/LegacyPlatform.java12
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/ExtendedIOUtil.java2
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/om/monitor/ProbingSubMonitor.java7
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/om/monitor/SubMonitor.java5
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/om/trace/ContextTracer.java6
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/om/trace/Tracer.java11
15 files changed, 91 insertions, 21 deletions
diff --git a/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/checkouts/CDOModelEditorOpener.java b/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/checkouts/CDOModelEditorOpener.java
index 7d9078720d..505b2bdc82 100644
--- a/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/checkouts/CDOModelEditorOpener.java
+++ b/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/checkouts/CDOModelEditorOpener.java
@@ -22,6 +22,8 @@ import org.eclipse.emf.cdo.view.CDOView;
import org.eclipse.emf.internal.cdo.transaction.CDOHandlingConflictResolver;
+import org.eclipse.net4j.util.om.OMPlatform;
+
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.spi.cdo.CDOMergingConflictResolver;
@@ -39,7 +41,7 @@ import org.eclipse.ui.IWorkbenchPart;
public class CDOModelEditorOpener extends CDOEditorOpener.Default
{
private static final boolean INTERACTIVE_CONFLICT_RESOLUTION = !"false"
- .equalsIgnoreCase(System.getProperty("cdo.interactive.conflict.resolution"));
+ .equalsIgnoreCase(OMPlatform.INSTANCE.getProperty("cdo.interactive.conflict.resolution"));
public CDOModelEditorOpener()
{
diff --git a/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/bundle/OM.java b/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/bundle/OM.java
index 237662e6c4..01fb2827a9 100644
--- a/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/bundle/OM.java
+++ b/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/bundle/OM.java
@@ -38,7 +38,8 @@ public abstract class OM
public static final OMLogger LOG = BUNDLE.logger();
- private static final String STATE_LOCATION = System.getProperty("org.eclipse.emf.cdo.explorer.stateLocation");
+ private static final String STATE_LOCATION = OMPlatform.INSTANCE
+ .getProperty("org.eclipse.emf.cdo.explorer.stateLocation");
private static String stateLocation;
diff --git a/plugins/org.eclipse.emf.cdo.server.db/.options b/plugins/org.eclipse.emf.cdo.server.db/.options
index f4f74f846d..2654631df9 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/.options
+++ b/plugins/org.eclipse.emf.cdo.server.db/.options
@@ -1,3 +1,5 @@
# Debugging and tracing options
org.eclipse.emf.cdo.server.db/debug = true
+org.eclipse.emf.cdo.server.db/debug.units = true
+org.eclipse.emf.cdo.server.db/debug.units.perf = false
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/bundle/OM.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/bundle/OM.java
index 6b4d7e198c..1dd85c4305 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/bundle/OM.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/bundle/OM.java
@@ -30,6 +30,8 @@ public abstract class OM
public static final OMTracer DEBUG = BUNDLE.tracer("debug"); //$NON-NLS-1$
+ public static final OMTracer DEBUG_UNITS = DEBUG.tracer("units"); //$NON-NLS-1$
+
public static final OMLogger LOG = BUNDLE.logger();
/**
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalAuditClassMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalAuditClassMapping.java
index 16c55da194..507550c681 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalAuditClassMapping.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalAuditClassMapping.java
@@ -86,6 +86,9 @@ public class HorizontalAuditClassMapping extends AbstractHorizontalClassMapping
{
private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG, HorizontalAuditClassMapping.class);
+ private static final ContextTracer TRACER_UNITS = new ContextTracer(OM.DEBUG_UNITS,
+ HorizontalAuditClassMapping.class);
+
private String sqlInsertAttributes;
private String sqlSelectAttributesCurrent;
@@ -431,7 +434,7 @@ public class HorizontalAuditClassMapping extends AbstractHorizontalClassMapping
if (TRACER.isEnabled())
{
- TRACER.format("Created Resource Query: {0}", stmt.toString()); //$NON-NLS-1$
+ TRACER.format("Created Resource Query: {0}", stmt); //$NON-NLS-1$
}
return stmt;
@@ -691,6 +694,8 @@ public class HorizontalAuditClassMapping extends AbstractHorizontalClassMapping
IDBPreparedStatement stmt = null;
int oldFetchSize = -1;
+ final long start1 = TRACER_UNITS.isEnabled() ? System.currentTimeMillis() : CDOBranchPoint.UNSPECIFIED_DATE;
+
try
{
stmt = accessor.getDBConnection().prepareStatement(sqlSelectUnitByTime, ReuseProbability.MEDIUM);
@@ -718,7 +723,15 @@ public class HorizontalAuditClassMapping extends AbstractHorizontalClassMapping
listFiller.schedule(revision);
}
+ final long start2 = start1 != CDOBranchPoint.UNSPECIFIED_DATE ? System.currentTimeMillis() : start1;
+
listFiller.await();
+
+ if (start1 != CDOBranchPoint.UNSPECIFIED_DATE)
+ {
+ TRACER_UNITS.format("Read {0} revisions of unit {1}: {2} millis + {3} millis", eClass.getName(), rootID,
+ start2 - start1, System.currentTimeMillis() - start2);
+ }
}
finally
{
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_486458_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_486458_Test.java
index d61dfc2bce..3889b4c2a1 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_486458_Test.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_486458_Test.java
@@ -166,6 +166,11 @@ public class Bugzilla_486458_Test extends AbstractCDOTest
public void testOpenUnit() throws Exception
{
+ // OMPlatform.INSTANCE.setDebugging(true);
+ // OMBundle bundle = OMPlatform.INSTANCE.bundle("org.eclipse.emf.cdo.server.db", null);
+ // bundle.getDebugSupport().setDebugging(true);
+ // bundle.tracer("debug").tracer("units").setEnabled(true);
+
fillRepository();
{
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/bundle/AbstractBundle.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/bundle/AbstractBundle.java
index f3f68b718d..40d6122b0c 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/bundle/AbstractBundle.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/bundle/AbstractBundle.java
@@ -57,8 +57,6 @@ public abstract class AbstractBundle implements OMBundle, OMBundle.DebugSupport,
private boolean debugging;
- private boolean debuggingInitialized;
-
private Map<String, Tracer> tracers = new ConcurrentHashMap<String, Tracer>(0);
private OMLogger logger;
@@ -80,6 +78,9 @@ public abstract class AbstractBundle implements OMBundle, OMBundle.DebugSupport,
this.platform = platform;
this.bundleID = bundleID;
this.accessor = accessor;
+
+ boolean debug = getDebugOption("debug", false); //$NON-NLS-1$
+ setDebugging(debug);
}
public OMPlatform getPlatform()
@@ -97,6 +98,11 @@ public abstract class AbstractBundle implements OMBundle, OMBundle.DebugSupport,
return accessor;
}
+ public void setAccessor(Class<?> accessor)
+ {
+ this.accessor = accessor;
+ }
+
public Object getBundleContext()
{
return bundleContext;
@@ -125,12 +131,6 @@ public abstract class AbstractBundle implements OMBundle, OMBundle.DebugSupport,
return false;
}
- if (!debuggingInitialized)
- {
- debugging = getDebugOption("debug", false); //$NON-NLS-1$
- debuggingInitialized = true;
- }
-
return debugging;
}
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/bundle/AbstractPlatform.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/bundle/AbstractPlatform.java
index 2e29b0c31a..5c54abe11c 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/bundle/AbstractPlatform.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/bundle/AbstractPlatform.java
@@ -86,10 +86,18 @@ public abstract class AbstractPlatform implements OMPlatform
public synchronized OMBundle bundle(String bundleID, Class<?> accessor)
{
- OMBundle bundle = bundles.get(bundleID);
+ AbstractBundle bundle = bundles.get(bundleID);
if (bundle == null)
{
- bundle = createBundle(bundleID, accessor);
+ bundle = (AbstractBundle)createBundle(bundleID, accessor);
+ bundles.put(bundleID, bundle);
+ }
+ else if (accessor != null)
+ {
+ if (bundle.getAccessor() == null)
+ {
+ bundle.setAccessor(accessor);
+ }
}
return bundle;
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/LegacyBundle.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/LegacyBundle.java
index ebf04da546..b344c0aa0a 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/LegacyBundle.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/LegacyBundle.java
@@ -16,6 +16,8 @@ import org.eclipse.net4j.util.ReflectUtil;
import org.eclipse.net4j.util.StringUtil;
import org.eclipse.net4j.util.WrappedException;
import org.eclipse.net4j.util.io.IOUtil;
+import org.eclipse.net4j.util.om.OMPlatform;
+import org.eclipse.net4j.util.om.trace.Tracer;
import java.io.File;
import java.io.IOException;
@@ -37,6 +39,9 @@ import java.util.jar.JarFile;
*/
public class LegacyBundle extends AbstractBundle
{
+ private static final boolean isOptionsDisabled = Boolean
+ .valueOf(OMPlatform.INSTANCE.getProperty(Tracer.PROP_DISABLE_TRACING_OPTIONS, Boolean.FALSE.toString()));
+
private URL baseURL;
public LegacyBundle(AbstractPlatform platform, String bundleID, Class<?> accessor)
@@ -51,7 +56,10 @@ public class LegacyBundle extends AbstractBundle
throw new IllegalStateException("No base URL");
}
- loadOptions();
+ if (!isOptionsDisabled)
+ {
+ loadOptions();
+ }
}
catch (Exception ex)
{
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/LegacyPlatform.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/LegacyPlatform.java
index 976a49afc2..d5ff6ad2b0 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/LegacyPlatform.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/LegacyPlatform.java
@@ -55,4 +55,16 @@ public class LegacyPlatform extends AbstractPlatform
{
return LegacyUtil.getCommandLineArgs();
}
+
+ public static boolean clearDebugOptions()
+ {
+ if (INSTANCE instanceof LegacyPlatform)
+ {
+ LegacyPlatform platform = (LegacyPlatform)INSTANCE;
+ platform.debugOptions.clear();
+ return true;
+ }
+
+ return false;
+ }
}
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/ExtendedIOUtil.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/ExtendedIOUtil.java
index 1fd21b0f92..a99c34abf2 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/ExtendedIOUtil.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/ExtendedIOUtil.java
@@ -103,7 +103,6 @@ public final class ExtendedIOUtil
}
else
{
- @SuppressWarnings("resource")
ObjectOutputStream wrapper = new ObjectOutputStream(new OutputStream()
{
@Override
@@ -138,7 +137,6 @@ public final class ExtendedIOUtil
}
else
{
- @SuppressWarnings("resource")
ObjectInputStream wrapper = new ObjectInputStream(new InputStream()
{
@Override
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/om/monitor/ProbingSubMonitor.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/om/monitor/ProbingSubMonitor.java
index 6d32da2996..6478327b18 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/om/monitor/ProbingSubMonitor.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/om/monitor/ProbingSubMonitor.java
@@ -17,6 +17,7 @@ import org.eclipse.net4j.internal.util.table.Formula;
import org.eclipse.net4j.internal.util.table.Range;
import org.eclipse.net4j.internal.util.table.Range.Alignment;
import org.eclipse.net4j.internal.util.table.Table;
+import org.eclipse.net4j.util.om.OMPlatform;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -134,7 +135,7 @@ public final class ProbingSubMonitor extends org.eclipse.net4j.util.om.monitor.S
ProbingSubMonitor(ProbingSubMonitor parent, RootInfo rootInfo, int totalWork, int availableToChildren, int flags,
boolean full)
- {
+ {
super(rootInfo, totalWork, availableToChildren, flags | (full ? FULL_MODE : 0));
this.parent = parent;
totalTicks = totalWork;
@@ -146,7 +147,7 @@ public final class ProbingSubMonitor extends org.eclipse.net4j.util.om.monitor.S
key = COUNTER.incrementAndGet();
MAP.put(key, new KeyedWeakReference(key, this));
- }
+ }
@Override
SubMonitor createSubMonitor(RootInfo rootInfo, int totalWork, int availableToChildren, int flags)
@@ -501,7 +502,7 @@ public final class ProbingSubMonitor extends org.eclipse.net4j.util.om.monitor.S
private static final int DEFAULT_COLUMNS = 3;
private static final boolean SMOOTH_BORDERS = "smooth"
- .equalsIgnoreCase(System.getProperty("submonitor.probing.borders"));
+ .equalsIgnoreCase(OMPlatform.INSTANCE.getProperty("submonitor.probing.borders"));
private static final Dumper DUMPER = SMOOTH_BORDERS ? Dumper.UTF8 : Dumper.ASCII;
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/om/monitor/SubMonitor.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/om/monitor/SubMonitor.java
index 657d1d1e0c..0bc5e1105f 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/om/monitor/SubMonitor.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/om/monitor/SubMonitor.java
@@ -16,12 +16,13 @@
*/
package org.eclipse.net4j.util.om.monitor;
+import org.eclipse.net4j.util.om.OMPlatform;
+
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IProgressMonitorWithBlocking;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.net4j.util.om.monitor.SubProgressMonitor;
/**
* A {@link IProgressMonitorWithBlocking progress monitor} that uses a given amount of work ticks from a parent monitor.
@@ -920,7 +921,7 @@ public class SubMonitor implements IProgressMonitorWithBlocking
private static ProbingMode getDefault()
{
- String mode = System.getProperty("submonitor.probing");
+ String mode = OMPlatform.INSTANCE.getProperty("submonitor.probing");
if (FULL.toString().equalsIgnoreCase(mode))
{
return FULL;
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/om/trace/ContextTracer.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/om/trace/ContextTracer.java
index 70a34286e4..86344e9aee 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/om/trace/ContextTracer.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/om/trace/ContextTracer.java
@@ -97,4 +97,10 @@ public class ContextTracer
{
delegate.trace(context, t);
}
+
+ @Override
+ public String toString()
+ {
+ return "ContextTracer[" + getBundle() + "/" + getFullName() + " --> " + context.getName() + "]";
+ }
}
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/om/trace/Tracer.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/om/trace/Tracer.java
index 0f9e05790c..e289d75d4a 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/om/trace/Tracer.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/om/trace/Tracer.java
@@ -29,6 +29,11 @@ public class Tracer implements OMTracer
*/
public static final String PROP_DISABLE_TRACING = "org.eclipse.net4j.util.om.trace.disable";
+ /**
+ * @since 3.6
+ */
+ public static final String PROP_DISABLE_TRACING_OPTIONS = "org.eclipse.net4j.util.om.trace.disable.options";
+
private static final boolean isGloballyDisabled = Boolean
.valueOf(OMPlatform.INSTANCE.getProperty(PROP_DISABLE_TRACING, Boolean.FALSE.toString()));
@@ -129,4 +134,10 @@ public class Tracer implements OMTracer
{
return new Tracer(this, name);
}
+
+ @Override
+ public String toString()
+ {
+ return "Tracer[" + bundle + "/" + fullName + "]";
+ }
}

Back to the top