Attaching patch 1a, which adds the core daemon code for the istat feature. For some more discussion, see
This patch is not ready for commit, as there are some issues left to address. Note that to test this feature now, you have to apply the patch(es) for
DERBY-4938 and set derby.storage.indexStats.auto=true. This will most likely change after DERBY-4939 has been resolved, since the feature should be enabled by default
Remaining issues (copied from
DERBY-4771, I have given them names):
A Yes, but not at this level. I thought it would be nice to have a name for the
transaction to identify it in the transaction table.
I think some new methods must be added to be able to name a transaction at
this level, so I'm not sure if it is worth the trouble.
I'm keeping the TODO for now, might remove it in the next iteration.
B It isn't needed now. Since the interface is internal, and there is only one
implementation of it, I suppose the best action to take now is to remove it.
We can introduce it again later, and then probably in a shape more like you
have described. It feels a bit odd to say in the JavaDoc that scheduling
requests may be denied, and not have a way to learn if it happened or not...
C Added synchronization for runningThread in the finally-block.
The current code will let the thread die and then create a new one on the
next update request. I considered adding a sleep before letting the thread
die, in case a new request would come in quickly.
D Do you mean we should call TransactionResourceImpl#handleException explicitly
I think the comment meant to say that the daemon will be disabled elsewhere.
I'll address this issue in the next iteration.
Further review is welcome!