Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Winkler2011-12-21 17:20:07 -0500
committerStefan Winkler2011-12-21 17:20:07 -0500
commit3d15b5ccd1c4a1562f48382755e7fcf9aa8b7e08 (patch)
treece5293347e8bfd61bdf480d4a1e6c0f5010c2652
parent35b183b6c3fdbd9a353173f6295fe5961775c56d (diff)
downloadcdo-3d15b5ccd1c4a1562f48382755e7fcf9aa8b7e08.tar.gz
cdo-3d15b5ccd1c4a1562f48382755e7fcf9aa8b7e08.tar.xz
cdo-3d15b5ccd1c4a1562f48382755e7fcf9aa8b7e08.zip
[367356] [DB] Reduce amount of update statements for non-audit mode bugs/367356
https://bugs.eclipse.org/bugs/show_bug.cgi?id=367356 Adjustments to make the cherry-picked commits conforming to on 4.0
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/CDODBUtil.java5
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/mapping/IListMapping2.java28
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreChunkReader.java15
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/BasicAbstractListTableMapping.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalNonAuditMappingStrategy.java7
5 files changed, 15 insertions, 44 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/CDODBUtil.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/CDODBUtil.java
index 1c6c92cef8..c134daad6d 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/CDODBUtil.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/CDODBUtil.java
@@ -47,11 +47,6 @@ public final class CDODBUtil
*/
public static final String EXT_POINT_MAPPING_STRATEGIES = "mappingStrategies"; //$NON-NLS-1$
- /**
- * @since 4.1
- */
- public static final String PROP_ZEROBASED_INDEX = "forceZeroBasedIndex";
-
private CDODBUtil()
{
}
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/mapping/IListMapping2.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/mapping/IListMapping2.java
deleted file mode 100644
index 9dcfd6cbc9..0000000000
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/mapping/IListMapping2.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.server.db.mapping;
-
-import org.eclipse.emf.cdo.common.id.CDOID;
-import org.eclipse.emf.cdo.server.db.IDBStoreAccessor;
-
-/**
- * Extension interface to {@link IListMapping}.
- *
- * @author Eike Stepper
- * @since 4.1
- */
-public interface IListMapping2 extends IListMapping
-{
- public void addSimpleChunkWhere(IDBStoreAccessor accessor, CDOID cdoid, StringBuilder builder, int index);
-
- public void addRangedChunkWhere(IDBStoreAccessor accessor, CDOID cdoid, StringBuilder builder, int fromIndex,
- int toIndex);
-}
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreChunkReader.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreChunkReader.java
index 135c6352dc..eddfb72bcf 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreChunkReader.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreChunkReader.java
@@ -16,8 +16,8 @@ import org.eclipse.emf.cdo.common.revision.CDORevision;
import org.eclipse.emf.cdo.server.db.IDBStoreChunkReader;
import org.eclipse.emf.cdo.server.db.mapping.IClassMapping;
import org.eclipse.emf.cdo.server.db.mapping.IListMapping;
-import org.eclipse.emf.cdo.server.db.mapping.IListMapping2;
import org.eclipse.emf.cdo.server.db.mapping.IMappingStrategy;
+import org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.BasicAbstractListTableMapping;
import org.eclipse.emf.cdo.spi.server.StoreChunkReader;
import org.eclipse.emf.ecore.EStructuralFeature;
@@ -53,9 +53,11 @@ public class DBStoreChunkReader extends StoreChunkReader implements IDBStoreChun
super.addSimpleChunk(index);
prepareAddition();
- if (referenceMapping instanceof IListMapping2)
+ if (referenceMapping instanceof BasicAbstractListTableMapping) // backport of Bug 366686; in 4.1 the new
+ // IListMapping2 interface is used
{
- ((IListMapping2)referenceMapping).addSimpleChunkWhere(getAccessor(), getRevision().getID(), builder, index);
+ ((BasicAbstractListTableMapping)referenceMapping).addSimpleChunkWhere(getAccessor(), getRevision().getID(),
+ builder, index);
}
else
{
@@ -71,10 +73,11 @@ public class DBStoreChunkReader extends StoreChunkReader implements IDBStoreChun
super.addRangedChunk(fromIndex, toIndex);
prepareAddition();
- if (referenceMapping instanceof IListMapping2)
+ if (referenceMapping instanceof BasicAbstractListTableMapping)// backport of Bug 366686; in 4.1 the new
+ // IListMapping2 interface is used
{
- ((IListMapping2)referenceMapping).addRangedChunkWhere(getAccessor(), getRevision().getID(), builder, fromIndex,
- toIndex);
+ ((BasicAbstractListTableMapping)referenceMapping).addRangedChunkWhere(getAccessor(), getRevision().getID(),
+ builder, fromIndex, toIndex);
}
else
{
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/BasicAbstractListTableMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/BasicAbstractListTableMapping.java
index 7617063568..4d0a8c2558 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/BasicAbstractListTableMapping.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/BasicAbstractListTableMapping.java
@@ -12,7 +12,7 @@ package org.eclipse.emf.cdo.server.internal.db.mapping.horizontal;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.server.db.IDBStoreAccessor;
-import org.eclipse.emf.cdo.server.db.mapping.IListMapping2;
+import org.eclipse.emf.cdo.server.db.mapping.IListMapping;
import org.eclipse.emf.cdo.server.db.mapping.IMappingStrategy;
import org.eclipse.emf.cdo.server.internal.db.CDODBSchema;
@@ -22,7 +22,7 @@ import org.eclipse.emf.ecore.EStructuralFeature;
/**
* @author Stefan Winkler
*/
-public abstract class BasicAbstractListTableMapping implements IListMapping2
+public abstract class BasicAbstractListTableMapping implements IListMapping
{
private IMappingStrategy mappingStrategy;
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalNonAuditMappingStrategy.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalNonAuditMappingStrategy.java
index ef0d435ee8..10cf7a4ab3 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalNonAuditMappingStrategy.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalNonAuditMappingStrategy.java
@@ -11,7 +11,6 @@
*/
package org.eclipse.emf.cdo.server.internal.db.mapping.horizontal;
-import org.eclipse.emf.cdo.server.db.CDODBUtil;
import org.eclipse.emf.cdo.server.db.mapping.IClassMapping;
import org.eclipse.emf.cdo.server.db.mapping.IListMapping;
@@ -24,6 +23,8 @@ import org.eclipse.emf.ecore.EStructuralFeature;
*/
public class HorizontalNonAuditMappingStrategy extends AbstractHorizontalMappingStrategy
{
+ public static final String PROP_OPTIMIZED_INDEX_MGT = "optimizeIndexManagement";
+
private boolean forceZeroBasedIndex;
public HorizontalNonAuditMappingStrategy()
@@ -73,7 +74,7 @@ public class HorizontalNonAuditMappingStrategy extends AbstractHorizontalMapping
{
super.doAfterActivate();
- String value = getProperties().get(CDODBUtil.PROP_ZEROBASED_INDEX);
- forceZeroBasedIndex = value == null ? false : Boolean.valueOf(value);
+ String value = getProperties().get(PROP_OPTIMIZED_INDEX_MGT);
+ forceZeroBasedIndex = value == null ? true : !Boolean.valueOf(value);
}
}

Back to the top