Feedback on Infinispan patch
by Emmanuel Bernard
Hey Lukasz,
Your patch looks quite good and pass tests on my side.
I encourage others to check out the patch before we apply it (ideally
another person form HSearch and one person from infinispan.
Lukasz, I have a few questions/remarks though before applying it. Can
you answer / adjust the patch?
IndexWriterSetting
Why move to return Object in parsing from the initial int?
Move DPHelper#createInfinispanCacheManager to IDP
this is not something that can be shared as it creates a hard
dependency on infinispan otherwise.
in createInfinispanCacheManager
Don't log in error the fact that xml is not used if a default config
is used. Just log in trace at best.
Rename InfinispanCacheManagerConfigurationImpl to
DefaultInfinispanCacheManagerConfiguration or even better with a name
describing nicely the behavior of the infinispan config.
in InfinispanIndexOutput, is it possible to get writeBytes bigger than
buffer size? If yes, does newCheck creates the appropriate numbers of
chunks?
InfinispanDirectoryProvider
put the configuration proeprties available in the
InfinispanDirectoryProvider javadoc.
I think the default cache name should be "Hibernate Search" instead of
"HSInfinispanCache". We know it's in infinispan :)
what's the try catch opening and closing an IW about? It looks weird.
in stop()
you don't close the CacheManager? How is that?
InfinispanCacheManagerConfigurationImpl
What does "Infinispan-Cluster" correspond to? Why this name? Shouldn't
it be "Hibernate Search cluster"?
Is it safe to override the GlobalConfiguration? What if JBoss AS use
infinispan to run?
Why the use of DummyTransactionManagerLookup. Doesn't Infinispan guess
the right TM depending on the environment? e in JBoss As use the JBoss
one etc? I think GenericTransactionManagerLookup does that.
InfinispanCacheManagerConfiguration
some javadoc on the methods would be useful. I don't know what do
implement here.
Is there a better name for Metadata? Like FileMetadata maybe?
Where is ispn-cache-default-conf.xml used? For tests only? If not: is
it possible to use a programmatic version instead and what is "It's a
movie cache"?
Emmanuel
Begin forwarded message:
> From: Łukasz Moreń <lukasz.moren(a)gmail.com>
> Date: 21 août 2009 02:11:03 HAEC
> To: Emmanuel Bernard <emmanuel(a)hibernate.org>
> Subject: GSoC patch with Infinispan Directory Provider
>
> I'm sending patch and piece of documentation - not much but
> necessary information are included.
> There are some todos but I didn't manage to finish it yet.
> I changed maven jgroups dependency to 2.8.beta2, before version was
> clashed with used by infinispan.
> In pom file there was dependency on hibernate common annotations
> 3.2.shapshot. It should't be 3.5?
>
> Cheers,
> Lukasz
15 years, 3 months
A better fix for Immutables
by Krzysztof Sobolewski
I noticed that there was a problem with generics in Immutables class. May I
suggest a better approach? (patch attached) :)
[AFAICS the same thing is needed for analogous code in JBoss Cache, BTW]
-KS
15 years, 3 months
Query module new API and configurations
by Navin Surtani
Hey guys,
Was speaking with Manik the other day and we were just talking about
how we could work in some of the new API into the query module.
What I was thinking to do was something like this: -
CacheQuery cq = new QueryFactory(cache).getQuery("fieldName",
"stuffToSearchFor");
This way, internally we can do all the dirty work of creating lucene
queries, using a query parser etc etc. Which is a major clean-up from
the old JBCS API where you'd need to create it yourself.
The other issue we discussed was setting up searchable configurations.
Vladimir, I believe you're the guy who can help us a bit on this?
Essentially, what Manik suggested was to put in a configuration option
(eg: - 'searchable = true') and then from there internal cache code
should know how to deal with adding in the SearchableInterceptor.
Maybe an XML parser does this? Feel free to throw something at me if
I'm wrong here.
The slightly complex part here is that the Searchable Interceptor sits
in the query module. So if you're only using the core module it also
needs to be able to ignore the query configuration if it doesn't have
the dependency or if the user doesn't want to use the module etc etc.
WDYT?
Navin Surtani
Intern Infinispan
Intern JBoss Cache Searchable
15 years, 3 months
XNIO 2.0.0.CR2 released
by David M. Lloyd
I've released XNIO 2.0.0.CR2. If you're still planning on using XNIO for a
backend, I'd recommend you start there. There's several important API
improvements that I think you may appreciate. I have not yet been able to
upload the Javadocs to docs.jboss.org but I'll do that as soon as I can.
- DML
15 years, 3 months
BdbjeCacheStore and JdbmCacheStore getExpiryTime todos
by Galder Zamarreno
Hi,
I'm looking at the TODOs in the Infinispan code base and I've seen
BdbjeCacheStore and JdbmCacheStore doing the following:
long expiry = entry.getExpiryTime();
if (entry.getMaxIdle() > 0) {
// TODO do we need both?
expiry = entry.getMaxIdle() + System.currentTimeMillis();
}
Long at = new Long(expiry);
Object key = entry.getKey();
expiryMap.put(at, key);
They use this expiry time as key in a expiryMap that they purge when
they need to expire entries from the cache store:
protected void purgeInternal() throws CacheLoaderException {
try {
Map<Long, Object> expired =
expiryMap.tailMap(System.currentTimeMillis(), true);
for (Map.Entry<Long, Object> entry : expired.entrySet()) {
expiryMap.remove(entry.getKey());
cacheMap.remove(entry.getValue());
}
} catch (RuntimeException caught) {
throw convertToCacheLoaderException("error purging expired
entries", caught);
}
}
InternalCacheEntry.getExpiryTime() says it has no meaning for entries
with max idle but without lifespan. Couldn't this be extended to support
max idle too?
For example: TransientCacheEntry.getExpiryTime() could return
cachevalue.lastUsed + cachevalue.maxIdle. Obviously, this is not fixed
and it's really a moving target based on when it's used, but wouldn't it
avoid code like the one above?)
In the case where both max idle and lifespan are used, i.e.
TransientMortalCacheEntry, getExpiryTime() would return whichever time
is closer to expiration. So, if lifespan says it should expiry in Xms +
1000ms but lastUsed + maxIdle says it should expiry in Xms + 2000ms,
lifespan calculation would return, and viceversa.
Thoughts?
--
Galder Zamarreño
Sr. Software Engineer
Infinispan, JBoss Cache
15 years, 3 months
Distributed queries
by Michael Neale
regarding indexing and queries - is the current aim to not require
that the index for the entire data grid exist on a single node?
(asking as a potential user who is wrestling with lucene indexes at
the moment is curious).
--
Michael D Neale
home: www.michaelneale.net
blog: michaelneale.blogspot.com
15 years, 3 months
Concurrent hashmaps parameters
by Bela Ban
FYI,
This might be important for you guys as well (if you haven't done so):
I'll add code to configure ConcurrentHashMaps based on system
properties, e.g. capacity, load factory etc.
This will be important for large clusters. E.g. when we have 1000 nodes
in the cluster, most hashmaps in JGroups will contain 1000 entries, and
if we only have 16 buckets (the default IIRC), there would be a lot of
contention.
https://jira.jboss.org/jira/browse/JGRP-1049
ConcurrentHashMap
-----------------
CCHMs have a default initial capacity (16), load factor (0.75) and
concurrency level (16). These are OK for most
scenarios, but we have to investigate whether these values are
sufficient for 1000 node clusters.
When for example 1000 threads from different senders access the same
CCHM, we need to make sure we don't have high
contention, ie. by spreading a 1000 senders over 16 buckets.
Investigate whether we should add CCHM initial sizes, load factors and
concurrency levels as properties.
With ergonomics [1], we could for example set bucket sizes for CCHMs
dynamically, e.g. based on cluster size.
[1] https://jira.jboss.org/jira/browse/JGRP-1037
--
Bela Ban
Lead JGroups / Clustering Team
JBoss
15 years, 3 months
Benchmarking 2nd level cache providers?
by Galder Zamarreno
While talking to Manik online, the topic of 2nd level cache benchmarking
came up and was wondering if there's a way to benchmark different 2nd
level cache providers in Hibernate?
Cheers,
--
Galder Zamarreño
Sr. Software Engineer
Infinispan, JBoss Cache
15 years, 3 months