Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] V3 a problem and inefficient
[CDO] V3 a problem and inefficient [message #708387] Tue, 02 August 2011 18:47 Go to next message
David Wynter is currently offline David WynterFriend
Messages: 4624
Registered: July 2009
Senior Member
Hi,

I have a problem with this method in BranchRevisionCache

public EClass getObjectType(CDOID id)
{
synchronized (revisionLists)
{
for (Entry<CDOIDAndBranch, RevisionList> entry :
revisionLists.entrySet())
{
if (id.equals(entry.getKey().getID()))
{
RevisionList revisionList = entry.getValue();
EClass type = revisionList.getObjectType();
if (type != null)
{
return type;
}
}
}
}

return null;
}

Firstly it does not find my OID in there and late throws a
IllegalStateException, any ideas why this might be?

The second is that my model is about a 10th the size it will be and the
size of the RevisionLists is already 24371 in size. So you loop through
the entire set every time I save?

Thx.

David
Re: [CDO] V3 a problem and inefficient [message #708842 is a reply to message #708387] Wed, 03 August 2011 07:21 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi David,<br>
<br>
Revision caches have been majorly reworked in 4.0:<br>
<br>
<img src="http://www.eclipse.org/forums/index.php?t=getfile&amp;id=3552" alt=""><br>
<br>
There are now implementations particularly tuned for the different
repository modes (non-auditing, auditing, branching). Especially the
getObjectType() method has been optimized in all the concrete cache
types. For the branching cache it now looks like:<br>
<br>
<title></title>
<style type="text/css">
<!--code { font-family: Courier New, Courier; font-size: 10pt; margin: 0px; }-->
</style>
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<!-- ======================================================== -->
<!-- = Java Sourcecode to HTML automatically converted code = -->
<!-- = Java2Html Converter 5.0 [2006-02-26] by Markus Gebhard markus@jave.de = -->
<!-- = Further information: http://www.java2html.de = -->
<div class="java" align="left">
<table bgcolor="#ffffff" border="0" cellpadding="3"
cellspacing="0">
<tbody>
<tr>
<!-- start source code --> <td nowrap="nowrap" align="left"
valign="top"> <code>
<font color="#ffffff">&nbsp;&nbsp;</font><font color="#7f0055"><b>public&nbsp;</b></font><font
color="#000000">EClass&nbsp;getObjectType</font><font
color="#000000">(</font><font color="#000000">CDOID&nbsp;id</font><font
color="#000000">)</font><br>
<font color="#ffffff">&nbsp;&nbsp;</font><font color="#000000">{</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#7f0055"><b>synchronized&nbsp;</b></font><font
color="#000000">(</font><font color="#000000">revisionLists</font><font
color="#000000">)</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">{</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">TypeAndRefCounter&nbsp;typeCounter&nbsp;=&nbsp;typeMap.get</font><font
color="#000000">(</font><font color="#000000">id</font><font
color="#000000">)</font><font color="#000000">;</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#7f0055"><b>if&nbsp;</b></font><font
color="#000000">(</font><font color="#000000">typeCounter&nbsp;!=&nbsp;</font><font
color="#7f0055"><b>null</b></font><font
color="#000000">)</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">{</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="#7f0055"><b>return&nbsp;</b></font><font
color="#000000">typeCounter.getType</font><font
color="#000000">()</font><font color="#000000">;</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">}</font><br>
<font color="#ffffff"></font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#7f0055"><b>return&nbsp;null</b></font><font
color="#000000">;</font><br>
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">}</font><br>
<font color="#ffffff">&nbsp;&nbsp;</font><font color="#000000">}</font></code>
</td>
<!-- end source code --> </tr>
</tbody>
</table>
</div>
<!-- = END of automatically generated HTML code = -->
<!-- ======================================================== -->
<br>
Does that help?<br>
<br>
Cheers<br>
/Eike<br>
<br>
----<br>
<a class="moz-txt-link-freetext" href="http://www.esc-net.de">http://www.esc-net.de</a><br>
<a class="moz-txt-link-freetext" href="http://thegordian.blogspot.com">http://thegordian.blogspot.com</a><br>
<a class="moz-txt-link-freetext" href="http://twitter.com/eikestepper">http://twitter.com/eikestepper</a><br>
<br>
<br>
<br>
Am 02.08.2011 20:47, schrieb David Wynter:
<blockquote cite="mid:j19g4d$5df$1@news.eclipse.org" type="cite">Hi,
<br>
<br>
I have a problem with this method in BranchRevisionCache
<br>
<br>
&nbsp; public EClass getObjectType(CDOID id)
<br>
&nbsp; {
<br>
&nbsp;&nbsp;&nbsp; synchronized (revisionLists)
<br>
&nbsp;&nbsp;&nbsp; {
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (Entry&lt;CDOIDAndBranch, RevisionList&gt; entry :
revisionLists.entrySet())
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (id.equals(entry.getKey().getID()))
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RevisionList revisionList = entry.getValue();
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EClass type = revisionList.getObjectType();
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (type != null)
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return type;
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }
<br>
&nbsp;&nbsp;&nbsp; }
<br>
<br>
&nbsp;&nbsp;&nbsp; return null;
<br>
&nbsp; }
<br>
<br>
Firstly it does not find my OID in there and late throws a
IllegalStateException, any ideas why this might be?
<br>
<br>
The second is that my model is about a 10th the size it will be
and the size of the RevisionLists is already 24371 in size. So you
loop through the entire set every time I save?
<br>
<br>
Thx.
<br>
<br>
David
<br>
</blockquote>
</body>
</html>


Re: [CDO] V3 a problem and inefficient [message #709066 is a reply to message #708842] Wed, 03 August 2011 13:05 Go to previous messageGo to next message
David Wynter is currently offline David WynterFriend
Messages: 4624
Registered: July 2009
Senior Member
Hi Eike,

OK, that answers the question in terms of why I should upgrade for
performance reasons. But with deadlines to meet this is not something we
can commit to yet. Any idea how much effort there is to move to CDO 4
from CDO 3?

But it does not answer the question of why my OID are not in the
revisionLists? I'll try to reproduce the error with a smaller resource.
Is there any way to change my exported CDO resource then import it to
'fix' this problem?

Thx.

David
On 03/08/11 08:21, Eike Stepper wrote:
> Hi David,
>
> Revision caches have been majorly reworked in 4.0:
>
>
>
> There are now implementations particularly tuned for the different
> repository modes (non-auditing, auditing, branching). Especially the
> getObjectType() method has been optimized in all the concrete cache
> types. For the branching cache it now looks like:
>
> |*public *EClass getObjectType(CDOID id)
> {
> *synchronized *(revisionLists)
> {
> TypeAndRefCounter typeCounter = typeMap.get(id);
> *if *(typeCounter != *null*)
> {
> *return *typeCounter.getType();
> }
>
> *return null*;
> }
> }|
>
>
> Does that help?
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
>
> Am 02.08.2011 20:47, schrieb David Wynter:
>> Hi,
>>
>> I have a problem with this method in BranchRevisionCache
>>
>> public EClass getObjectType(CDOID id)
>> {
>> synchronized (revisionLists)
>> {
>> for (Entry<CDOIDAndBranch, RevisionList> entry :
>> revisionLists.entrySet())
>> {
>> if (id.equals(entry.getKey().getID()))
>> {
>> RevisionList revisionList = entry.getValue();
>> EClass type = revisionList.getObjectType();
>> if (type != null)
>> {
>> return type;
>> }
>> }
>> }
>> }
>>
>> return null;
>> }
>>
>> Firstly it does not find my OID in there and late throws a
>> IllegalStateException, any ideas why this might be?
>>
>> The second is that my model is about a 10th the size it will be and
>> the size of the RevisionLists is already 24371 in size. So you loop
>> through the entire set every time I save?
>>
>> Thx.
>>
>> David
Re: [CDO] V3 a problem and inefficient [message #709240 is a reply to message #709066] Wed, 03 August 2011 17:07 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 03.08.2011 15:05, schrieb David Wynter:
> Hi Eike,
>
> OK, that answers the question in terms of why I should upgrade for performance reasons. But with deadlines to meet this is not something we can commit to yet. Any idea how much effort there is to move to CDO 4 from CDO 3?
I guess not too much because most API changes are compatible for non-extenders.

>
> But it does not answer the question of why my OID are not in the revisionLists? I'll try to reproduce the error with a smaller resource.
And ideally with at least CDO 4.0 if you want to have it fixed ;-)

> Is there any way to change my exported CDO resource then import it to 'fix' this problem?
I don't think that was a problem with an export format.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


>
> Thx.
>
> David
> On 03/08/11 08:21, Eike Stepper wrote:
>> Hi David,
>>
>> Revision caches have been majorly reworked in 4.0:
>>
>>
>>
>> There are now implementations particularly tuned for the different
>> repository modes (non-auditing, auditing, branching). Especially the
>> getObjectType() method has been optimized in all the concrete cache
>> types. For the branching cache it now looks like:
>>
>> |*public *EClass getObjectType(CDOID id)
>> {
>> *synchronized *(revisionLists)
>> {
>> TypeAndRefCounter typeCounter = typeMap.get(id);
>> *if *(typeCounter != *null*)
>> {
>> *return *typeCounter.getType();
>> }
>>
>> *return null*;
>> }
>> }|
>>
>>
>> Does that help?
>>
>> Cheers
>> /Eike
>>
>> ----
>> http://www.esc-net.de
>> http://thegordian.blogspot.com
>> http://twitter.com/eikestepper
>>
>>
>>
>> Am 02.08.2011 20:47, schrieb David Wynter:
>>> Hi,
>>>
>>> I have a problem with this method in BranchRevisionCache
>>>
>>> public EClass getObjectType(CDOID id)
>>> {
>>> synchronized (revisionLists)
>>> {
>>> for (Entry<CDOIDAndBranch, RevisionList> entry :
>>> revisionLists.entrySet())
>>> {
>>> if (id.equals(entry.getKey().getID()))
>>> {
>>> RevisionList revisionList = entry.getValue();
>>> EClass type = revisionList.getObjectType();
>>> if (type != null)
>>> {
>>> return type;
>>> }
>>> }
>>> }
>>> }
>>>
>>> return null;
>>> }
>>>
>>> Firstly it does not find my OID in there and late throws a
>>> IllegalStateException, any ideas why this might be?
>>>
>>> The second is that my model is about a 10th the size it will be and
>>> the size of the RevisionLists is already 24371 in size. So you loop
>>> through the entire set every time I save?
>>>
>>> Thx.
>>>
>>> David
>


Previous Topic:Convert emf model in xml
Next Topic:org.eclipse.emf.cheatsheets with same version in helios and indigo, but with different content
Goto Forum:
  


Current Time: Fri Apr 26 07:08:00 GMT 2024

Powered by FUDForum. Page generated in 0.03280 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top