Configuration visitor - Re: [JBoss JIRA] Commented: (ISPN-145) No transport and singleton store enabled should not be allowed
by Vladimir Blagojevic
Hi,
Galder and I talked about this offline. Time to involve you guys!
I just completed visitor pattern for our configuration objects. Visitor
is passed from root of configuration - InfinispanConfiguration object.
InfinispanConfiguration class has a new method:
public void accept(ConfigurationBeanVisitor v)
How do we want to integrate this visitor into existing structure?
1) We add a new factory method to InfinispanConfiguration with
additional ConfigurationBeanVisitor parameter
2) We leave everything as is and if there is a need to pass some visitor
we pass it to InfinispanConfiguration instance directly (from
DefaultCacheManager)
DefaultCacheManager will pass ValidationVisitor to
InfinispanConfiguration that will verify configuration semantically.
Regards,
Vladimir
On 09-09-09 10:19 AM, Galder Zamarreno wrote:
> Good idea :)
>
> On 09/09/2009 04:13 PM, Vladimir Blagojevic wrote:
>> Yeah,
>>
>> I was thinking that we can make a visitor for configuration tree and
>> then you can do verification of any node and other things as well. Use
>> cases will come up in the future for sure.
>>
>> Cheers
>>
>>
>>
>> On 09-09-09 3:29 AM, Galder Zamarreno (JIRA) wrote:
>>> [
>>> https://jira.jboss.org/jira/browse/ISPN-145?page=com.atlassian.jira.plugi...
>>>
>>> ]
>>>
>>> Galder Zamarreno commented on ISPN-145:
>>> ---------------------------------------
>>>
>>> Not sure I understand what you mean by generic though. You mean any
>>> component to have a validation step of some sort?
>>>
>>> Thanks for taking this on :)
>>>
>>>> No transport and singleton store enabled should not be allowed
>>>> --------------------------------------------------------------
>>>>
>>>> Key: ISPN-145
>>>> URL: https://jira.jboss.org/jira/browse/ISPN-145
>>>> Project: Infinispan
>>>> Issue Type: Bug
>>>> Components: Loaders and Stores
>>>> Affects Versions: 4.0.0.ALPHA6
>>>> Reporter: Galder Zamarreno
>>>> Assignee: Vladimir Blagojevic
>>>> Priority: Minor
>>>> Fix For: 4.0.0.CR1
>>>>
>>>>
>>>> Throw configuration exception if singleton store configured without
>>>> transport having been configured.
>>>> It makes no sense to have singleton store enabled when there's no
>>>> transport.
>>
>
13 years, 3 months
Defining new commands in modules
by Manik Surtani
So this is an extension to the discussion around a GenericCommand that has been going around. IMO a GenericCommand is a big -1 from me for various reasons - the whole purpose of the command pattern is so we have strongly typed and unit testable commands. This will help the ongoing work by Mircea, Sanne and Israel on various modules that need to define custom commands.
I proposed the following solution to Mircea earlier today, I'll repeat here for you guys to discuss. Note that this is a *half baked* solution and needs more thought! :-)
* If a module needs to define custom commands, it should define its own ReplicableCommand implementations in its' own module.
* It should define a sub-interface to Visitor (MyModuleVisitor) with additional methods to handle the new commands
* Interceptors defined in this module should extend CommandInterceptor AND implement MyModuleVisitor
* These new commands can be created directly, or via a new CommandFactory specially for these commands.
Now for the un-finished bits. :)
* How does RemoteCommandFactory instantiate these new commands? The module should have a way of registering additional command IDs with RemoteCommandFactory.fromStream(). See
http://fisheye.jboss.org/browse/Infinispan/branches/4.2.x/core/src/main/j...
Perhaps RemoteCommandFactory.fromStream() should look up the ID in a map of command creator instances, and each module can register more of these with the RemoteCommandFactory?
* How do interceptors defined in the core module handle commands it isn't aware of? handleDefault()? Or should we define a new handleUnknown() method in Visitor for this case, which would default to a no-op in AbstractVisitor? E.g., in a module-specific command such as MyModuleCommand, I would implement:
class MyModuleCommand implements ReplicableCommand {
public Object acceptVisitor(InvocationContext ctx, Visitor visitor) throws Throwable {
if (Visitor instanceof MyModuleVisitor) {
return ((MyModuleVisitor) visitor).visitMyModuleCommand(ctx, this);
} else {
return visitor.handleUnknown(ctx, this);
}
}
}
Cheers
Manik
PS: There is no JIRA for this. If we like this approach and it works, I suggest we create a JIRA and implement it for 4.2. The impl should be simple once we resolve the outstanding bits.
--
Manik Surtani
manik(a)jboss.org
Lead, Infinispan
Lead, JBoss Cache
http://www.infinispan.org
http://www.jbosscache.org
13 years, 7 months
ISPN 200
by Israel Lacerra
Manik,
What you mean by:
" * The calling node returns a CacheQuery impl that lazily fetches
and collates results from the cluster." (JIRA)
Is enough if each node returns a list of keys and then, we lazily get the
values using the keys? Or the process has to be more lazy yet?
thanks!
Israel Lacerra
13 years, 11 months
Using Coverity scan?
by Sanne Grinovero
Hello,
Did you consider enabling Infinispan to be monitored by coverity's
code analysis services? They are free for OSS projects, I saw a demo
recently and was quite amazed. It's similar to FindBugs, but not only
about static code checks. They checkout your code from trunk and then
run several analysis on it periodically, one of them is about dynamic
thread behavior to predict deadlocks or missing fences instrumenting
the code, and produce nice public reports; AFAIK you don't need to
setup anything yourself, besides getting in touch to ask for it.
It's only available for C and Java code, and they have an impressive
list of OSS projects in the C world (linux kernel, httpd server,
samba, gnome, GCC, PostgreSQL, ...) but not much on Java.
http://scan.coverity.com/
No, I'm not affiliated :-) Just thinking that it might be useful to
have if it's not too hard to setup.
Cheers,
Sanne
14 years
SingleJoinTest#testTransactional failure
by Vladimir Blagojevic
Hi,
SingleJoinTest transactional variant currently fails. But it is destined
to fail as is! Let me explain. We have four nodes {A,B,C,D} and another
node E joins. Just before E joins a tx T is started on one of the
existing nodes with a write to key K. There is essentially a latch in
the prepare of T that is opened only after E succefully joins upon join
rehash. As part of join rehash E needs to invalidate invalid L1 keys and
during that process it tries to lock ..you guessed it key K. Since T
holds a lock on K already eventually E join rehash task times out and as
a result we get a failed test.
I did not write this test and I would not like to change the original
writer's test case intent. What are our options?
Cheers,
Vladimir
14 years
JAXB/XML part for ISPN-244
by Galder Zamarreño
Hi Vladimir,
I'm working on https://jira.jboss.org/browse/ISPN-244 and I'm trying to figure out how to modify GlobalConfiguration class in order to enable XML configuration for this to be something along these lines:
<serialization marshallerClass="org.infinispan.marshall.VersionAwareMarshaller" version="1.0">
<marshallables>
<marshallable id="9" typeClass="acme.SomePojo" externalizerClass="acme.SomePojoExternalizer" />
<marshallable id="10" typeClass="acme.OtherPojo" externalizerClass="acme.OtherPojoExternalizer" />
</marshallables>
</serialization>
I have an initial implementation of the JIRA in https://github.com/galderz/infinispan/tree/ispn244 and in there you can see what i've done so far, but basically, I've simply added some API to GC get the core of the JIRA working. Now I need to figure out how to transform it to allow XML like shown above, or any other alternative that you might be able to think. Looking around, I hadn't found an example of such XML configuration and how it'd map to our code, but looking again, I think what you did for loaders/loader in Cache configuration might be similar? WDYT?
Cheers,
--
Galder Zamarreño
Sr. Software Engineer
Infinispan, JBoss Cache
14 years, 1 month
Tree API module wiki
by Galder Zamarreño
I've just finished writing http://community.jboss.org/docs/DOC-16081
Anything that should change? Anything extra that should be included?
Scott, I believe you've played quite a bit with the tree module, so it'd be great to hear your feedback as a user :). Maybe we should add a section to explain when it makes sense to use the tree module API, i.e. to build a JNDI repo?
Cheers,
--
Galder Zamarreño
Sr. Software Engineer
Infinispan, JBoss Cache
14 years, 1 month
New draft for distributed execution framework
by Trustin Lee
Hi folks,
I posted the new draft for the distributed execution framework. It's
written based on the discussion between Vladimir and me. I initially
thought about publishing the API as a git branch, but I guess it's a
good idea to have a couple rounds before doing that. I tried to be as
specific as possible, but please feel free to let me know what could be
improved, what is missing, and so on.
Cheers,
Trustin
14 years, 1 month
CacheContainer.getCache
by Mircea Markus
Hi,
if there is no such cache defined in the configuration with name "undefinedCacheName" and CacheContainer.getCache("undefinedCacheName") is called then an cache with default configuration and that name is first defined and then instantiated and returned.
Anyone remembers what the requirement were for this is?
IMO an exception should be thrown and user should be notified that the cache is not defined. This way we can fail fast e.g. If the user forgets to define a cache or misspells its name.
If this behaviour is needed, an approach would be to create an specialised method to handle this: getAndDefineCache...
There is code that already relies on the fact that the cache is already defined: see InboundInvocationHandler.handle.
Cheers,
Mircea
14 years, 1 month
Generating Javadoc from Scala sources
by Filip Rogaczewski
Hi all,
Let me introduce myself. My name is Filip Rogaczewski, I am majoring
from Computer Science in Gdansk University of Technology. Aim of my
master thesis is to provide tool which generates Javadoc from Scala
sources. As the idea of master thesis comes from Manik, I would like to
test my application against Infinispan sources.
First version, that generates documentation without covering problematic
cases is scheduled for the end of December. For next version, I am
collecting information about problems with invoking Scala classes from
Java. I would appreciate any infromation or suggestions you provide me.
Best,
Filip
https://jira.jboss.org/browse/ISPN-755
14 years, 1 month