Grid Filesystem
by Marko Lukša
Hey guys.
Aleš Justin and I will be using infinispan's grid file system for Capedwarf.
I have fixed a few issues in GFS. Before I issue a pull request, I need
to know if you guys prefer a single commit for all of them or separate
commits. What about jira issues - separate or one single jira issue?
Here's a list of my commits:
- Implement appending to files (up to now, the append parameter was ignored)
- Implement GridFile.getParent() and getParentFile()
- Implement GridFile.lastModified()
- Prevent writing to and reading from directories
- Fix bugs related to non-default chunk size
- Leak when overwriting existing file with shorter content length
(excess file chunks are never removed from cache)
- Leak when calling GridFile.delete() (removes only file metadata, but
not the actual file contents)
- GridFile.createNewFile() does not honor the contract of
File.createNewFile()
- GridFile.list() does not honor contract of File.list() and also has a
few bugs (it doesn't handle file separators correctly)
- GridFilesystem.getFile(File, String) creates File with illegal path
(on windows, the created file begins with "C:\...")
- mkdir() fails on "/dir", but works on "dir"
- the root dir is not handled properly
- add javadoc to GridFilesystem
There are also a few other things. Before I fix them, I would like you
to confirm my thinking is correct:
- GFS.getFile("/hello.txt") should point to the same file as
GFS.getFile("hello.txt"), but it currently does not. GFS treats these
two as two distinct files.
- GridFilesystem.remove() shouldn't be public, because the proper way to
remove files is through GridFile.delete(). By calling
GridFilesystem.remove(), only the file's contents are removed, but the
metadata is not).
- GridFile.setLength() should throw an exception instead of printing to
System.err
ML
12 years, 11 months
Making components depend on Transport using @Inject
by Manik Surtani
Guys
We need to be a little careful here - don't just have components depend on Transport unless you know for sure that the component is only used in a clustered mode. Otherwise, even in local mode, you will end up creating and starting a channel which is unnecessary. I have seen this in the CacheLoaderInterceptor, AbstractLockingInterceptor and the RemoteCommandsFactory so far. Please consider either alternate implementations of these components for clustered mode - which can in turn depend on Transport, as I have done with the CacheLoaderInterceptor - or instead depend on the RpcManager which gives you almost all of the same functionality without starting up channels unnecessarily. Or worse still, the dependency on Transport in the RemoteCommandsFactory wasn't even used!
Cheers
Manik
--
Manik Surtani
manik(a)jboss.org
twitter.com/maniksurtani
Lead, Infinispan
http://www.infinispan.org
12 years, 11 months
CacheViewsManager - Noisy trace level logging
by Manik Surtani
I have a cache configured in REPL_SYNC mode, but only one node in the cluster. I see a lot of these:
2012-01-06 15:56:17,470 TRACE [PendingCacheViewChanges] (CacheViewTrigger,Multiverse-33482) Cannot create a new view, we have no joiners or leavers
2012-01-06 15:56:18,471 TRACE [CacheViewsManagerImpl] (CacheViewTrigger,Multiverse-33482) Woke up, shouldRecoverViews=false
2012-01-06 15:56:18,471 TRACE [PendingCacheViewChanges] (CacheViewTrigger,Multiverse-33482) Cannot create a new view, we have no joiners or leavers
2012-01-06 15:56:19,472 TRACE [CacheViewsManagerImpl] (CacheViewTrigger,Multiverse-33482) Woke up, shouldRecoverViews=false
2012-01-06 15:56:19,472 TRACE [PendingCacheViewChanges] (CacheViewTrigger,Multiverse-33482) Cannot create a new view, we have no joiners or leavers
2012-01-06 15:56:20,473 TRACE [CacheViewsManagerImpl] (CacheViewTrigger,Multiverse-33482) Woke up, shouldRecoverViews=false
2012-01-06 15:56:20,473 TRACE [PendingCacheViewChanges] (CacheViewTrigger,Multiverse-33482) Cannot create a new view, we have no joiners or leavers
2012-01-06 15:56:21,474 TRACE [CacheViewsManagerImpl] (CacheViewTrigger,Multiverse-33482) Woke up, shouldRecoverViews=false
2012-01-06 15:56:21,474 TRACE [PendingCacheViewChanges] (CacheViewTrigger,Multiverse-33482) Cannot create a new view, we have no joiners or leavers
2012-01-06 15:56:22,476 TRACE [CacheViewsManagerImpl] (CacheViewTrigger,Multiverse-33482) Woke up, shouldRecoverViews=false
2012-01-06 15:56:22,476 TRACE [PendingCacheViewChanges] (CacheViewTrigger,Multiverse-33482) Cannot create a new view, we have no joiners or leavers
2012-01-06 15:56:23,477 TRACE [CacheViewsManagerImpl] (CacheViewTrigger,Multiverse-33482) Woke up, shouldRecoverViews=false
2012-01-06 15:56:23,477 TRACE [PendingCacheViewChanges] (CacheViewTrigger,Multiverse-33482) Cannot create a new view, we have no joiners or leavers
2012-01-06 15:56:24,478 TRACE [CacheViewsManagerImpl] (CacheViewTrigger,Multiverse-33482) Woke up, shouldRecoverViews=false
2012-01-06 15:56:24,478 TRACE [PendingCacheViewChanges] (CacheViewTrigger,Multiverse-33482) Cannot create a new view, we have no joiners or leavers
2012-01-06 15:56:25,479 TRACE [CacheViewsManagerImpl] (CacheViewTrigger,Multiverse-33482) Woke up, shouldRecoverViews=false
2012-01-06 15:56:25,479 TRACE [PendingCacheViewChanges] (CacheViewTrigger,Multiverse-33482) Cannot create a new view, we have no joiners or leavers
2012-01-06 15:56:26,480 TRACE [CacheViewsManagerImpl] (CacheViewTrigger,Multiverse-33482) Woke up, shouldRecoverViews=false
2012-01-06 15:56:26,480 TRACE [PendingCacheViewChanges] (CacheViewTrigger,Multiverse-33482) Cannot create a new view, we have no joiners or leavers
2012-01-06 15:56:27,482 TRACE [CacheViewsManagerImpl] (CacheViewTrigger,Multiverse-33482) Woke up, shouldRecoverViews=false
2012-01-06 15:56:27,482 TRACE [PendingCacheViewChanges] (CacheViewTrigger,Multiverse-33482) Cannot create a new view, we have no joiners or leavers
2012-01-06 15:56:28,483 TRACE [CacheViewsManagerImpl] (CacheViewTrigger,Multiverse-33482) Woke up, shouldRecoverViews=false
2012-01-06 15:56:28,483 TRACE [PendingCacheViewChanges] (CacheViewTrigger,Multiverse-33482) Cannot create a new view, we have no joiners or leavers
2012-01-06 15:56:29,484 TRACE [CacheViewsManagerImpl] (CacheViewTrigger,Multiverse-33482) Woke up, shouldRecoverViews=false
Any reason why we need this level of noise?
Cheers
Manik
--
Manik Surtani
manik(a)jboss.org
twitter.com/maniksurtani
Lead, Infinispan
http://www.infinispan.org
12 years, 11 months
Distributed Executors in write mode, need reference to Cache
by Sanne Grinovero
Highlighting this use case:
http://community.jboss.org/message/642300#642300
As I replied on the forum, I think we might need to improve the
DistributedExecutorService by providing access to some context to the
Future before it's executed remotely, as having a reference to the
Cache it's being executed on seems very useful, but it might not be
limited to the Cache only.
I guess to make good use of it, someone might need to access just
anything: CDI looks like a good fit?
12 years, 11 months
Null values (somehow) allowed?
by Galder Zamarreño
Hi all,
Related to https://issues.jboss.org/browse/ISPN-1661, the fix is clear, but how come didn't this blow before?
The following code works fine:
cache.put("hello", null);
I was always under the impression that null values (as well as null keys) were not accepted, which I think is good thing btw.
I'm pretty sure this check used to be in place before, but did we somehow lost it?
Anyway, I"m adding some tests in org.infinispan.api package.
Cheers,
--
Galder Zamarreño
Sr. Software Engineer
Infinispan, JBoss Cache
12 years, 11 months
Feature requests for new Configuration API
by Paul Ferraro
While migrating the Infinispan AS7 subsystem to use the new
configuration API, I've run into a couple of issues in the form of
feature requests for 5.1.0.CR3:
1. A method to retrieve the
org.infinispan.configuration.cache.Configuration from the cache manager
without starting it's respective cache.
e.g. getCacheConfiguration(String name)
If the named cache was not defined, it would return null.
Formerly, I used to be able to do:
defineConfiguration(name, new Configuration());
However, since the new Configuration objects are fully formed, the
returned configuration object will always be equivalent to the empty one
passed in.
https://issues.jboss.org/browse/ISPN-1666
2. A method to retrieve the
org.infinispan.configuration.global.GlobalConfiguration of a cache
manager. The existing getGlobalConfiguration() method returns the
deprecated org.infinispan.config.GlobalConfiguration object.
https://issues.jboss.org/browse/ISPN-1667
Thanks,
Paul
12 years, 11 months
Read flags from command or context?
by Galder Zamarreño
Hi,
Re: https://github.com/galderz/infinispan/commit/fa419a1b22f56faa49e66588728f... and https://issues.jboss.org/browse/ISPN-1652
Back when Infinispan started, flags travelled down via thread locals and the context. Now these flags are even part of the commands in order to travel accross different nodes.
As indicated in the JIRA and my comment, solving this problem by recreating context for each command is complex (what type of context? remote? local?… I had a rather hacky looking solution but broke tx recovery).
I do see however commands a more natural fit for flags. We use flags to invoke an operation with those flags. To me, flags should really be migrated off context into command and read them consistenly from command which btw solves this problem rather easily.
I'm aware that I might be missing some odd use case where flags need to be in context but can't think of it right now, hence this email thread, to see if someone else can spot it.
Cheers,
--
Galder Zamarreño
Sr. Software Engineer
Infinispan, JBoss Cache
12 years, 11 months