summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-12-20 04:16:24 (EST)
committerEike Stepper2007-12-20 04:16:24 (EST)
commit003040d1415fb4c7df9be2b474cbaa36fc8316cd (patch)
tree5b9075cbe542fdf6f94ee831d28c20bebc4f106b
parentc472ee7dc8698f6a50d1523bc3e94b0244d4d8f5 (diff)
downloadcdo-003040d1415fb4c7df9be2b474cbaa36fc8316cd.zip
cdo-003040d1415fb4c7df9be2b474cbaa36fc8316cd.tar.gz
cdo-003040d1415fb4c7df9be2b474cbaa36fc8316cd.tar.bz2
[213560] Prefetching can't be disabled
https://bugs.eclipse.org/bugs/show_bug.cgi?id=213560
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadRevisionIndication.java49
1 files changed, 38 insertions, 11 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadRevisionIndication.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadRevisionIndication.java
index e16d1f6..afbe93a 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadRevisionIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadRevisionIndication.java
@@ -65,16 +65,26 @@ public class LoadRevisionIndication extends CDOReadIndication
protected void indicating(ExtendedDataInputStream in) throws IOException
{
referenceChunk = in.readInt();
- if (PROTOCOL.isEnabled()) PROTOCOL.format("Read referenceChunk: {0}", referenceChunk);
+ if (PROTOCOL.isEnabled())
+ {
+ PROTOCOL.format("Read referenceChunk: {0}", referenceChunk);
+ }
int size = in.readInt();
- if (PROTOCOL.isEnabled()) PROTOCOL.format("Reading {0} IDs", size);
+ if (PROTOCOL.isEnabled())
+ {
+ PROTOCOL.format("Reading {0} IDs", size);
+ }
ids = new CDOID[size];
for (int i = 0; i < size; i++)
{
CDOID id = CDOIDImpl.read(in);
- if (PROTOCOL.isEnabled()) PROTOCOL.format("Read ID: {0}", id);
+ if (PROTOCOL.isEnabled())
+ {
+ PROTOCOL.format("Read ID: {0}", id);
+ }
+
ids[i] = id;
}
@@ -88,7 +98,10 @@ public class LoadRevisionIndication extends CDOReadIndication
}
contextID = CDOIDImpl.read(in);
- if (PROTOCOL.isEnabled()) PROTOCOL.format("Reading fetch rules for context {0}", contextID);
+ if (PROTOCOL.isEnabled())
+ {
+ PROTOCOL.format("Reading fetch rules for context {0}", contextID);
+ }
for (int i = 0; i < fetchSize; i++)
{
@@ -104,7 +117,10 @@ public class LoadRevisionIndication extends CDOReadIndication
Session session = getSession();
List<CDORevisionImpl> additionalRevisions = new ArrayList<CDORevisionImpl>();
Set<CDOID> revisions = new HashSet<CDOID>();
- if (PROTOCOL.isEnabled()) PROTOCOL.format("Writing {0} revisions", ids.length);
+ if (PROTOCOL.isEnabled())
+ {
+ PROTOCOL.format("Writing {0} revisions", ids.length);
+ }
for (CDOID id : ids)
{
@@ -115,7 +131,11 @@ public class LoadRevisionIndication extends CDOReadIndication
Set<CDOFetchRule> visitedFetchRules = new HashSet<CDOFetchRule>();
if (!contextID.isNull() && fetchRules.size() > 0)
{
- if (PROTOCOL.isEnabled()) PROTOCOL.format("Collecting more objects based on rules");
+ if (PROTOCOL.isEnabled())
+ {
+ PROTOCOL.format("Collecting more objects based on rules");
+ }
+
CDORevisionImpl revisionContext = getRevision(contextID);
collectRevisions(revisionContext, revisions, additionalRevisions, visitedFetchRules);
}
@@ -124,12 +144,19 @@ public class LoadRevisionIndication extends CDOReadIndication
{
CDORevisionImpl revision = getRevision(id);
revision.write(out, session, referenceChunk);
- collectRevisions(revision, revisions, additionalRevisions, visitedFetchRules);
+ if (loadRevisionCollectionChunkSize > 0)
+ {
+ collectRevisions(revision, revisions, additionalRevisions, visitedFetchRules);
+ }
}
- out.writeInt(additionalRevisions.size());
- if (PROTOCOL.isEnabled()) PROTOCOL.format("Writing {0} additional revisions", additionalRevisions.size());
+ int additionalSize = additionalRevisions.size();
+ if (PROTOCOL.isEnabled())
+ {
+ PROTOCOL.format("Writing {0} additional revisions", additionalSize);
+ }
+ out.writeInt(additionalSize);
for (CDORevisionImpl revision : additionalRevisions)
{
revision.write(out, session, referenceChunk);
@@ -144,7 +171,7 @@ public class LoadRevisionIndication extends CDOReadIndication
private void collectRevisions(CDORevisionImpl revision, Set<CDOID> revisions,
List<CDORevisionImpl> additionalRevisions, Set<CDOFetchRule> visitedFetchRules)
{
- getSession().collectContainedRevisions(revision, this.referenceChunk, revisions, additionalRevisions);
+ getSession().collectContainedRevisions(revision, referenceChunk, revisions, additionalRevisions);
CDOFetchRule fetchRule = fetchRules.get(revision.getCDOClass());
if (fetchRule == null || visitedFetchRules.contains(fetchRule))
{
@@ -159,7 +186,7 @@ public class LoadRevisionIndication extends CDOReadIndication
if (feature.isMany())
{
MoveableList list = revision.getList(feature);
- int toIndex = Math.min(this.loadRevisionCollectionChunkSize, list.size()) - 1;
+ int toIndex = Math.min(loadRevisionCollectionChunkSize, list.size()) - 1;
for (int i = 0; i <= toIndex; i++)
{
Object value = list.get(i);