db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-2911) Implement a buffer manager using java.util.concurrent classes
Date Fri, 07 Sep 2007 13:21:31 GMT

    [ https://issues.apache.org/jira/browse/DERBY-2911?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12525706

Knut Anders Hatlen commented on DERBY-2911:

The next step is to implement the replacement algorithm. As I said
earlier, I will use the clock algorithm as the old buffer manager
does, but separate the implementation of the buffer manager and the
replacement algorithm to make it easier to switch to or experiment
with other algorithms.

I was thinking that we could have an interface for the replacement
policy that would look similar to this:

interface ReplacementPolicy {
  Callback insertEntry(CacheEntry e);
  interface Callback {
    void access();
    void free();

So when ConcurrentCache needs to insert a new entry, it would call
ReplacementPolicy.insertEntry() which would find free space (or make
room) for the new entry. With the clock algorithm, this means moving
the clock handle until a not recently used entry is found, and
possibly cleaning dirty entries or increasing the size of the
clock. insertEntry() would return a callback object, which
ConcurrentCache could use to notify the replacement policy about
events. Callback.access() would be used to notify that someone
accessed the object, so that it for instance could be marked as
recently used in the clock, and Callback.free() would mark the entry
as unused/invalid and make it available for reuse.

> Implement a buffer manager using java.util.concurrent classes
> -------------------------------------------------------------
>                 Key: DERBY-2911
>                 URL: https://issues.apache.org/jira/browse/DERBY-2911
>             Project: Derby
>          Issue Type: Improvement
>          Components: Performance, Services
>    Affects Versions:
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>            Priority: Minor
>         Attachments: d2911-1.diff, d2911-1.stat, d2911-2.diff, d2911-3.diff, d2911-unused.diff,
d2911-unused.stat, d2911perf.java
> There are indications that the buffer manager is a bottleneck for some types of multi-user
load. For instance, Anders Morken wrote this in a comment on DERBY-1704: "With a separate
table and index for each thread (to remove latch contention and lock waits from the equation)
we (...) found that org.apache.derby.impl.services.cache.Clock.find()/release() caused about
5 times more contention than the synchronization in LockSet.lockObject() and LockSet.unlock().
That might be an indicator of where to apply the next push".
> It would be interesting to see the scalability and performance of a buffer manager which
exploits the concurrency utilities added in Java SE 5.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message