You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-user@jakarta.apache.org by Oliver Zeigermann <ol...@zeigermann.de> on 2004/10/05 14:35:24 UTC

MacroStore

Folks!

For quite some time I have thought about something like a store that 
directly takes copy/move/delete which is currently done by the Macro 
implementation that does a single request per resource to the stores. 
However, there may be many stores which could make sense of the direct 
combined calls, for example the file store.

What would be needed for this would be a check if such a macro 
operations concernes a single store only. If yes and this particular 
store supports the MacroStore interface it should be dispatched to it. 
If not the old code should be executed.

What about binding here?
How do I find out which stores are involved? Analysing what has been 
configured in Domain.xml?

Other problems? Comments?

Oliver

---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


Re: MacroStore

Posted by Oliver Zeigermann <ol...@zeigermann.de>.
Stefan Lützkendorf schrieb:
> I think it sould work. If you create the required nodes in store s1
> (i.e. /a, /a/deeper and /a/deeper/path).
> It is simply a (lesser usefull) version of the very usefull version
> like:
> <scope match="/"      store="s1">
> <scope match="/docs"  store="s2">
> <scope match="/users" store="s3">

Such a configuration would not cause any problems with the easy 
solutionn, right?

> 
> May be the following method at the Namespace class could answer
> whether we could use the MacroStore interface:
> (I have not tried it out )
> 
> public boolean canUseMacroStore(Uri source, Uri destination) {
>     if (source.getStore() == destination.getStore()) {
>         // source and destination MAY BE in the same store
> 
>         // the potentially same store
>         Store store = source.getStore();
>         Scope sameScope = source.getScope();
> 
>         // look for a registered scope that is below the scope to that
>         // the store is mapped
>         for(Enumeration e = scopes.elements(); e.hasMoreElements();) {
>             Scope scope = (Scope)e.nextElement();
>             if (scope.toString().startsWith(sameScope.toString())) { // 
> (:-(
>                 if (scopes.get(scope) != store) {
>                     // we found an other store that is responsible to
>                     // resources below the scope
>                     return false;
>                 }
>             }
> 
> 
>         // source and destination ARE in the same store
>         return true;
>     }
>     return false;
> }

Looks like a good starting point :)

Oliver

> Oliver Zeigermann wrote:
> 
>> Right. Is this legal in the first place? Does such a configuration 
>> work? Is it sensible?
>>
>> If it is maybe it would be easiest to simply disallow the use of 
>> MacroStores in such scenarios?!
>>
>> Oliver
>>
>> Stefan Lützkendorf schrieb:
>>
>>> Did you mean something like this?
>>>
>>> <scope match="/" store="s1">
>>> <scope match="/a/deeper/path" store="s2">
>>>
>>> copy /a to /some/collection
>>>
>>> both /a and /some/collection are mapped to the same store
>>> s1 but some descendants of the source are from are in store s2.
>>>
>>> Thats strange by may happen.
>>>
>>> Stefan
>>>
>>>
>>> Oliver Zeigermann wrote:
>>>
>>>> Stefan Lützkendorf schrieb:
>>>>
>>>>>
>>>>> Oliver Zeigermann wrote:
>>>>>
>>>>>> Oliver Zeigermann schrieb:
>>>>>>
>>>>>>> Stefan Lützkendorf schrieb:
>>>>>>>
>>>>>>>> Oliver Zeigermann wrote:
>>>>>>>>
>>>>>>>>> How do I find out which stores are involved? Analysing what has 
>>>>>>>>> been configured in Domain.xml?
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> what about that?
>>>>>>>> Uri source, destination;
>>>>>>>> if (source.getStore() == destination.getStore()) {
>>>>>>>>   // source and destination are in the same store
>>>>>>>> }
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Glad I asked someone ;) My solution would have been crazy...
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> But wait: this will not work when successors of the Uris are in 
>>>>>> different stores :(
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> ??? can you give me an example?
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> No, seems this was just nonsense ...
>>>>
>>>> Oliver
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
>>>> For additional commands, e-mail: slide-user-help@jakarta.apache.org
>>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: slide-user-help@jakarta.apache.org
>>
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


Re: MacroStore

Posted by Stefan Lützkendorf <lu...@apache.org>.
I think it sould work. If you create the required nodes in store s1
(i.e. /a, /a/deeper and /a/deeper/path).
It is simply a (lesser usefull) version of the very usefull version
like:
<scope match="/"      store="s1">
<scope match="/docs"  store="s2">
<scope match="/users" store="s3">


May be the following method at the Namespace class could answer
whether we could use the MacroStore interface:
(I have not tried it out )

public boolean canUseMacroStore(Uri source, Uri destination) {
     if (source.getStore() == destination.getStore()) {
         // source and destination MAY BE in the same store

         // the potentially same store
         Store store = source.getStore();
         Scope sameScope = source.getScope();

         // look for a registered scope that is below the scope to that
         // the store is mapped
         for(Enumeration e = scopes.elements(); e.hasMoreElements();) {
             Scope scope = (Scope)e.nextElement();
             if (scope.toString().startsWith(sameScope.toString())) { // (:-(
                 if (scopes.get(scope) != store) {
                     // we found an other store that is responsible to
                     // resources below the scope
                     return false;
                 }
             }


         // source and destination ARE in the same store
         return true;
     }
     return false;
}

Oliver Zeigermann wrote:

> Right. Is this legal in the first place? Does such a configuration work? 
> Is it sensible?
> 
> If it is maybe it would be easiest to simply disallow the use of 
> MacroStores in such scenarios?!
> 
> Oliver
> 
> Stefan Lützkendorf schrieb:
> 
>> Did you mean something like this?
>>
>> <scope match="/" store="s1">
>> <scope match="/a/deeper/path" store="s2">
>>
>> copy /a to /some/collection
>>
>> both /a and /some/collection are mapped to the same store
>> s1 but some descendants of the source are from are in store s2.
>>
>> Thats strange by may happen.
>>
>> Stefan
>>
>>
>> Oliver Zeigermann wrote:
>>
>>> Stefan Lützkendorf schrieb:
>>>
>>>>
>>>> Oliver Zeigermann wrote:
>>>>
>>>>> Oliver Zeigermann schrieb:
>>>>>
>>>>>> Stefan Lützkendorf schrieb:
>>>>>>
>>>>>>> Oliver Zeigermann wrote:
>>>>>>>
>>>>>>>> How do I find out which stores are involved? Analysing what has 
>>>>>>>> been configured in Domain.xml?
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> what about that?
>>>>>>> Uri source, destination;
>>>>>>> if (source.getStore() == destination.getStore()) {
>>>>>>>   // source and destination are in the same store
>>>>>>> }
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> Glad I asked someone ;) My solution would have been crazy...
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> But wait: this will not work when successors of the Uris are in 
>>>>> different stores :(
>>>>
>>>>
>>>>
>>>>
>>>> ??? can you give me an example?
>>>
>>>
>>>
>>>
>>> No, seems this was just nonsense ...
>>>
>>> Oliver
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: slide-user-help@jakarta.apache.org
>>>
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: slide-user-help@jakarta.apache.org
> 

-- 
Stefan Lützkendorf  -- luetzkendorf@apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


Re: MacroStore

Posted by Oliver Zeigermann <ol...@zeigermann.de>.
Right. Is this legal in the first place? Does such a configuration work? 
Is it sensible?

If it is maybe it would be easiest to simply disallow the use of 
MacroStores in such scenarios?!

Oliver

Stefan Lützkendorf schrieb:

> Did you mean something like this?
> 
> <scope match="/" store="s1">
> <scope match="/a/deeper/path" store="s2">
> 
> copy /a to /some/collection
> 
> both /a and /some/collection are mapped to the same store
> s1 but some descendants of the source are from are in store s2.
> 
> Thats strange by may happen.
> 
> Stefan
> 
> 
> Oliver Zeigermann wrote:
> 
>> Stefan Lützkendorf schrieb:
>>
>>>
>>> Oliver Zeigermann wrote:
>>>
>>>> Oliver Zeigermann schrieb:
>>>>
>>>>> Stefan Lützkendorf schrieb:
>>>>>
>>>>>> Oliver Zeigermann wrote:
>>>>>>
>>>>>>> How do I find out which stores are involved? Analysing what has 
>>>>>>> been configured in Domain.xml?
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> what about that?
>>>>>> Uri source, destination;
>>>>>> if (source.getStore() == destination.getStore()) {
>>>>>>   // source and destination are in the same store
>>>>>> }
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Glad I asked someone ;) My solution would have been crazy...
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> But wait: this will not work when successors of the Uris are in 
>>>> different stores :(
>>>
>>>
>>>
>>> ??? can you give me an example?
>>
>>
>>
>> No, seems this was just nonsense ...
>>
>> Oliver
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: slide-user-help@jakarta.apache.org
>>
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


Re: MacroStore

Posted by Stefan Lützkendorf <lu...@apache.org>.
Did you mean something like this?

<scope match="/" store="s1">
<scope match="/a/deeper/path" store="s2">

copy /a to /some/collection

both /a and /some/collection are mapped to the same store
s1 but some descendants of the source are from are in store s2.

Thats strange by may happen.

Stefan


Oliver Zeigermann wrote:

> Stefan Lützkendorf schrieb:
> 
>>
>> Oliver Zeigermann wrote:
>>
>>> Oliver Zeigermann schrieb:
>>>
>>>> Stefan Lützkendorf schrieb:
>>>>
>>>>> Oliver Zeigermann wrote:
>>>>>
>>>>>> How do I find out which stores are involved? Analysing what has 
>>>>>> been configured in Domain.xml?
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> what about that?
>>>>> Uri source, destination;
>>>>> if (source.getStore() == destination.getStore()) {
>>>>>   // source and destination are in the same store
>>>>> }
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Glad I asked someone ;) My solution would have been crazy...
>>>
>>>
>>>
>>>
>>> But wait: this will not work when successors of the Uris are in 
>>> different stores :(
>>
>>
>> ??? can you give me an example?
> 
> 
> No, seems this was just nonsense ...
> 
> Oliver
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: slide-user-help@jakarta.apache.org
> 

-- 
Stefan Lützkendorf  -- luetzkendorf@apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


Re: MacroStore

Posted by Oliver Zeigermann <ol...@zeigermann.de>.
Stefan Lützkendorf schrieb:

> 
> Oliver Zeigermann wrote:
> 
>> Oliver Zeigermann schrieb:
>>
>>> Stefan Lützkendorf schrieb:
>>>
>>>> Oliver Zeigermann wrote:
>>>>
>>>>> How do I find out which stores are involved? Analysing what has 
>>>>> been configured in Domain.xml?
>>>>
>>>>
>>>>
>>>>
>>>> what about that?
>>>> Uri source, destination;
>>>> if (source.getStore() == destination.getStore()) {
>>>>   // source and destination are in the same store
>>>> }
>>>
>>>
>>>
>>>
>>> Glad I asked someone ;) My solution would have been crazy...
>>
>>
>>
>> But wait: this will not work when successors of the Uris are in 
>> different stores :(
> 
> ??? can you give me an example?

No, seems this was just nonsense ...

Oliver

---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


Re: MacroStore

Posted by Stefan Lützkendorf <lu...@apache.org>.
Oliver Zeigermann wrote:

> Oliver Zeigermann schrieb:
> 
>> Stefan Lützkendorf schrieb:
>>
>>> Oliver Zeigermann wrote:
>>>
>>>> How do I find out which stores are involved? Analysing what has been 
>>>> configured in Domain.xml?
>>>
>>>
>>>
>>> what about that?
>>> Uri source, destination;
>>> if (source.getStore() == destination.getStore()) {
>>>   // source and destination are in the same store
>>> }
>>
>>
>>
>> Glad I asked someone ;) My solution would have been crazy...
> 
> 
> But wait: this will not work when successors of the Uris are in 
> different stores :(
??? can you give me an example?
> 
> Oliver
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: slide-user-help@jakarta.apache.org
> 

-- 
Stefan Lützkendorf  -- luetzkendorf@apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


Re: MacroStore

Posted by Oliver Zeigermann <ol...@zeigermann.de>.
Oliver Zeigermann schrieb:

> Stefan Lützkendorf schrieb:
> 
>> Oliver Zeigermann wrote:
>>> How do I find out which stores are involved? Analysing what has been 
>>> configured in Domain.xml?
>>
>>
>> what about that?
>> Uri source, destination;
>> if (source.getStore() == destination.getStore()) {
>>   // source and destination are in the same store
>> }
> 
> 
> Glad I asked someone ;) My solution would have been crazy...

But wait: this will not work when successors of the Uris are in 
different stores :(

Oliver

---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


Re: MacroStore

Posted by Oliver Zeigermann <ol...@zeigermann.de>.
Stefan Lützkendorf schrieb:

> Oliver Zeigermann wrote:
> 
>> Folks!
>>
>> For quite some time I have thought about something like a store that 
>> directly takes copy/move/delete which is currently done by the Macro 
>> implementation that does a single request per resource to the stores. 
>> However, there may be many stores which could make sense of the direct 
>> combined calls, for example the file store.
>>
>> What would be needed for this would be a check if such a macro 
>> operations concernes a single store only. If yes and this particular 
>> store supports the MacroStore interface it should be dispatched to it. 
>> If not the old code should be executed.
>>
>> What about binding here?
> 
> With binding move or copy should be simple, because only the (parent)
> bindings have to be changed. The resource with its UURI should not be
> touched. (I wonder who this works currently)

I see. Does MacroImpl already take care of this?

>> How do I find out which stores are involved? Analysing what has been 
>> configured in Domain.xml?
> 
> what about that?
> Uri source, destination;
> if (source.getStore() == destination.getStore()) {
>   // source and destination are in the same store
> }

Glad I asked someone ;) My solution would have been crazy...

>>
>> Other problems? Comments?
> 
> What about transactions and file stores?
> With the simple file store I can imagine that it can direcly map
> such MacroStore methods to file system calls but with the tx file store?

Tx file store would need core additions, but they should be doable. Just 
something like the marker for deleted files there should be something 
for *folders* to be copied/moved/deleted. At commit time the operation 
is simply done on a file level with a fast relink if there was a move, etc.

Oliver

>>
>> Oliver
> 
> 
> Stefan
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


Re: MacroStore

Posted by Stefan Lützkendorf <lu...@apache.org>.
Oliver Zeigermann wrote:

> Folks!
> 
> For quite some time I have thought about something like a store that 
> directly takes copy/move/delete which is currently done by the Macro 
> implementation that does a single request per resource to the stores. 
> However, there may be many stores which could make sense of the direct 
> combined calls, for example the file store.
> 
> What would be needed for this would be a check if such a macro 
> operations concernes a single store only. If yes and this particular 
> store supports the MacroStore interface it should be dispatched to it. 
> If not the old code should be executed.
> 
> What about binding here?
With binding move or copy should be simple, because only the (parent)
bindings have to be changed. The resource with its UURI should not be
touched. (I wonder who this works currently)

> How do I find out which stores are involved? Analysing what has been 
> configured in Domain.xml?
what about that?
Uri source, destination;
if (source.getStore() == destination.getStore()) {
   // source and destination are in the same store
}
> 
> Other problems? Comments?
What about transactions and file stores?
With the simple file store I can imagine that it can direcly map
such MacroStore methods to file system calls but with the tx file store?
> 
> Oliver

Stefan

-- 
Stefan Lützkendorf  -- luetzkendorf@apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org