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] [Updated] (DERBY-6242) Merge ConcurrentXactFactory into XactFactory
Date Fri, 31 May 2013 14:01:20 GMT

     [ https://issues.apache.org/jira/browse/DERBY-6242?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Knut Anders Hatlen updated DERBY-6242:
--------------------------------------

    Attachment: derby-6242-01-a.diff

The attached patch makes XactFactory use a ConcurrentHashMap instead of a Hashtable and removes
the ConcurrentXactFactory class.

The patch also removes an abstraction layer that was used to hide the differences between
Hashtable and ConcurrentHashMap. That is, it removes the classes TransactionMapFactory and
ConcurrentTransactionMapFactory, and instead creates and accesses the ConcurrentHashMap.

The TransactionTable class had a visitEntries() method that used to serve two purposes:

1) It abstracted away the differences between Hashtable and ConcurrentHashMap

2) It allowed other classes to iterate over the elements in the transaction table without
exposing the internal representation of the table

It is still useful for (2), so the method is preserved and still used some places. It is no
longer needed for (1), so the patch replaces all usages of it inside the TransactionTable
class with loops that traversed the values in the ConcurrentHashMap directly. Lots of anonymous
inner EntryVisitor classes could be removed this way, and it made it easier to read the code
that iterated over the transaction table entries, I believe.

All the regression tests ran cleanly on Java 6 and Java 8 with the patch.
                
> Merge ConcurrentXactFactory into XactFactory
> --------------------------------------------
>
>                 Key: DERBY-6242
>                 URL: https://issues.apache.org/jira/browse/DERBY-6242
>             Project: Derby
>          Issue Type: Improvement
>          Components: Services
>    Affects Versions: 10.11.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>            Priority: Minor
>         Attachments: derby-6242-01-a.diff
>
>
> ConcurrentXactFactory extends XactFactory and replaces XactFactory's Hashtable with a
ConcurrentHashMap for better scalability.
> Now that ConcurrentHashMap is available on all platforms supported on trunk, we could
make XactFactory use a ConcurrentHashMap and remove ConcurrentXactFactory.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message