Comments (18)
[deleted comment]
from jdbm2.
[deleted comment]
from jdbm2.
[deleted comment]
from jdbm2.
[deleted comment]
from jdbm2.
[deleted comment]
from jdbm2.
[deleted comment]
from jdbm2.
[deleted comment]
from jdbm2.
[deleted comment]
from jdbm2.
[deleted comment]
from jdbm2.
[deleted comment]
from jdbm2.
[deleted comment]
from jdbm2.
Ok. Ignore my other comments. :)
The attached patch is an implementation of a caching record manager. It
features fine-grained synchronisation: reads, writes, and deletes on individual
records do not block. Global operations (defrag, commit, rollback) block and
take priority.
Caching is done via the soft reference/weak hash map method. An MRU queue can
be used if the JVM is unnecessarily clearing SoftReferences.
Included is a JUnit stress test, which sparks up 200 threads for 20 seconds and
hammers an instance of the cache. Included also is a GUI with a main() method
allowing you to experiment with the locks.
The code is threadsafe and does not use the double-locking pattern, which is
known to be faulty owing to bugs in the JVM specification. (yes, really).
The patch creates a new class - CacheRecoprdManager3 - which is not integrated
into the RecordManagerFactory as yet, and does not replace the existing
CacheRecordManager.
Original comment by [email protected]
on 14 Mar 2011 at 5:43
Attachments:
from jdbm2.
Hi,
sorry for very long delay (very busy in real life).
I had quick look at patch, it looks ok.
I granted you write access to SVN repository. Feel free to integrate this patch
as optional Cache. There should be an parameter to switch this on.
I will try to find time as soon as possible.
Jan
Original comment by [email protected]
on 17 Mar 2011 at 10:35
from jdbm2.
No worries. May be able to get it done over the weekend.
Original comment by [email protected]
on 17 Mar 2011 at 12:21
from jdbm2.
Why not use LRU concurrent map available here -
http://code.google.com/p/concurrentlinkedhashmap/#Features?
Or use what the "Master"/Doug Lea wrote -
http://gee.cs.oswego.edu/dl/jsr166/dist/extra166ydocs/extra166y/ConcurrentRefere
nceHashMap.html
Original comment by [email protected]
on 18 Mar 2011 at 1:55
from jdbm2.
Ok, I have checked in the code as revision 67.
The ConcurrentReferenceHashMap and the other objects mentioned look good. But,
I have already finished and it passes the tests, so there you go.
I have made a few more changes, in particular - the exclusive/nonexclusive
locker is broken out into a separate class. Perhaps it should be moved into a
nice little googlecode project of its own.
Changes (as per the svn update comment) are:
*Added CacheRecordManager3 and its helper classes
*Added Tests
*Plugged CacheRecordManager3 into Provider as the default soft cache
*Added some javadoc to RecordManagerOptions
*Corrected method name in TestIssues
*Altered ant build to point javadoc at the current SE6 location
I have altered the build file so that the generated javadoc will correctly link
to the SE6 javadocs at oracle. However, I have not regenerated and checked in
the javadoc in the project itself.
Original comment by [email protected]
on 18 Mar 2011 at 4:57
from jdbm2.
Hi,
this cache was not really faster than old one, so I reverted it back as default
option. It is still in JDBM and can be use with 'soft3' parameter.
I guess basic problem with performance is overhead. For each entry inserted two
new references has to be created. And new Long object instance has to be
created with each lookup.
Original comment by [email protected]
on 14 Apr 2011 at 6:51
from jdbm2.
Original comment by [email protected]
on 14 Apr 2011 at 6:52
- Changed state: Fixed
from jdbm2.
Related Issues (18)
- Performance and threading patch HOT 9
- HTreeMap.clear() fails on maps with ConcurrentModificationException HOT 1
- NPE in BTree.getRoot() HOT 2
- java.lang.InternalError when retrieveing from a large map HOT 6
- Retrieval of objects from PrimaryStoreMap failing HOT 4
- HashBucket.writeExternal is destructive when HTree has a custom key serializer HOT 3
- [Enhancement] RecordFile.read() implementation doesn't make sense HOT 1
- [Enhancement] RecordHeader.setAvailableSize() speed improvement HOT 5
- [Bug fix] Disk memory leak in BTree.java HOT 1
- .t file not deleted. HOT 3
- Bug in getFirstLargerThan in FreePhysicalRowIdPage.java HOT 1
- jdbm.helper.Serialization.writeLongArray(DataOutputStream, long[]) is broken HOT 2
- Access JDBM database concurrently HOT 1
- java.lang.Error: Bad magic on log file, what does it mean? HOT 1
- Bpage Header Exception after kill and resume HOT 3
- Need forceClose
- File left locked after exception during init HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jdbm2.