mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

boli
23.50.2007 9f63f0439a36954ce46507cbc0059135f3fff56f
refs
author boli <boli@localhost>
Friday, February 23, 2007 22:50 +0100
committer boli <boli@localhost>
Friday, February 23, 2007 22:50 +0100
commit9f63f0439a36954ce46507cbc0059135f3fff56f
tree d7c13acb10128cc5a28fc9e7fccefef0a2530738 tree | zip | gz
parent 371840ed84af2ffa57b34c22d21c3a6de337216b view | diff
Recommit for issue 740. A debug logging helper method (EntryContainer#debugAccess) did not check for null OperationStatus objects being passed in and caused an NullPointerException whenever EntryCount was called. Added a null check.

Changed ID2Entry#getRecordCount to use the Database#count method in JE 3.1.0. The JE backend no longer keeps a count of entries in entry ID 0. Modified TestVerifyJob unit test to no longer simulate a incorrect entry count.

It was a clear case that using Database#count is much faster then keeping a count at entryID 0. At the least, it can eliminate a database read and write on every entry add and delete operation. In addition, calling Database#count is faster then getting an entry out of the database as the following shows.

Time took to get entry count 100 times (w/o transactions):

Duration using Database#count: 16731000 ns
Duration using old entry counter: 22094000 ns

Duration using Database#count: 17124000 ns
Duration using old entry counter: 39434000 ns

Duration using Database#count: 15522000 ns
Duration using old entry counter: 20069000 ns

Duration using Database#count: 15873000 ns
Duration using old entry counter: 19732000 ns

Duration using Database#count: 15871000 ns
Duration using old entry counter: 20594000 ns

Duration using Database#count: 21099000 ns
Duration using old entry counter: 21877000 ns

Fix for issue 740
5 files modified
206 ■■■■ changed files
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/EntryContainer.java 40 ●●●●● diff | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/ID2Entry.java 64 ●●●●● diff | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/ImportJob.java 8 ●●●● diff | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/VerifyJob.java 58 ●●●●● diff | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/backends/jeb/TestVerifyJob.java 36 ●●●● diff | view | raw | blame | history