You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2019/06/25 10:35:49 UTC
[directory-server] branch master updated (7a1939c -> bd9ce26)
This is an automated email from the ASF dual-hosted git repository.
elecharny pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/directory-server.git.
from 7a1939c DIRSERVER-2066: Simplify Jenkins build
new b065bcb Speedup the test by using a global transaction
new 3c87b2b Another speedup: we have only one test, no need to use the revert feature
new 865dcb2 Used a transaction to gather multiple updates
new 192a7ca Use a transaction around the reverter to speedup tests
new bd9ce26 Merge branch 'master' of https://gitbox.apache.org/repos/asf/directory-server
The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../directory/server/core/authz/AutzIntegUtils.java | 11 +++++++++++
.../core/operations/search/SearchWithIndicesPersonIT.java | 15 ++++++++++++---
.../directory/server/core/DefaultDirectoryService.java | 15 +++++++++++++++
3 files changed, 38 insertions(+), 3 deletions(-)
[directory-server] 05/05: Merge branch 'master' of
https://gitbox.apache.org/repos/asf/directory-server
Posted by el...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
elecharny pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/directory-server.git
commit bd9ce2601e896366c8086c310ed9389aeee410da
Merge: 192a7ca 7a1939c
Author: emmanuel lecharny <el...@apache.org>
AuthorDate: Tue Jun 25 12:35:32 2019 +0200
Merge branch 'master' of https://gitbox.apache.org/repos/asf/directory-server
Jenkinsfile | 3 +--
installers-maven-plugin/pom.xml | 2 +-
.../directory/server/installers/GenerateMojo.java | 19 ----------------
.../server/installers/MojoHelperUtils.java | 26 +++++++---------------
.../server/installers/ReflectionProperties.java | 4 ++--
installers/src/test/docker/archive.test | 2 +-
installers/src/test/docker/bin-DIRSERVER-2173.test | 2 +-
installers/src/test/docker/bin.test | 2 +-
installers/src/test/docker/deb.test | 5 ++++-
installers/src/test/docker/rpm.test | 5 ++++-
pom.xml | 25 +++++----------------
11 files changed, 28 insertions(+), 67 deletions(-)
[directory-server] 01/05: Speedup the test by using a global
transaction
Posted by el...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
elecharny pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/directory-server.git
commit b065bcb97c0567a0808746f24f4397d5d03bb751
Author: emmanuel lecharny <el...@apache.org>
AuthorDate: Tue Jun 25 02:55:56 2019 +0200
Speedup the test by using a global transaction
---
.../core/operations/search/SearchWithIndicesPersonIT.java | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/core-integ/src/test/java/org/apache/directory/server/core/operations/search/SearchWithIndicesPersonIT.java b/core-integ/src/test/java/org/apache/directory/server/core/operations/search/SearchWithIndicesPersonIT.java
index 3dfb089..b299727 100644
--- a/core-integ/src/test/java/org/apache/directory/server/core/operations/search/SearchWithIndicesPersonIT.java
+++ b/core-integ/src/test/java/org/apache/directory/server/core/operations/search/SearchWithIndicesPersonIT.java
@@ -28,7 +28,9 @@ import org.apache.directory.api.ldap.model.entry.DefaultEntry;
import org.apache.directory.api.ldap.model.message.SearchScope;
import org.apache.directory.ldap.client.api.LdapConnection;
import org.apache.directory.server.core.annotations.CreateDS;
+import org.apache.directory.server.core.api.LdapCoreSessionConnection;
import org.apache.directory.server.core.api.partition.Partition;
+import org.apache.directory.server.core.api.partition.PartitionTxn;
import org.apache.directory.server.core.factory.DefaultDirectoryServiceFactory;
import org.apache.directory.server.core.factory.DirectoryServiceFactory;
import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
@@ -67,15 +69,24 @@ public class SearchWithIndicesPersonIT extends AbstractLdapTestUnit
// -------------------------------------------------------------------
// Add a bunch of persons
// -------------------------------------------------------------------
+ PartitionTxn transaction = systemPartition.beginWriteTransaction();
+
+ // Speedup the addition by using a global transaction
+ ((LdapCoreSessionConnection)connection).getSession().addTransaction( systemPartition, transaction );
+ ((LdapCoreSessionConnection)connection).getSession().beginSessionTransaction();
+
for ( int i = 0; i < 1000; i++ )
{
addPerson( "name" + i, i );
}
+
+ transaction.commit();
}
private void addPerson( String name, int id ) throws Exception
{
+
connection.add(
new DefaultEntry(
"cn=" + name + ",ou=system",
@@ -100,9 +111,7 @@ public class SearchWithIndicesPersonIT extends AbstractLdapTestUnit
{
Set<String> results = new HashSet<String>();
- long t0 = System.nanoTime();
EntryCursor cursor = connection.search( "ou=system", filter, SearchScope.SUBTREE, "1.1" );
- long t1 = System.nanoTime();
while ( cursor.next() )
{
[directory-server] 02/05: Another speedup: we have only one test,
no need to use the revert feature
Posted by el...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
elecharny pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/directory-server.git
commit 3c87b2b934dbd899d4c53e24f4c3b75151c81389
Author: emmanuel lecharny <el...@apache.org>
AuthorDate: Tue Jun 25 03:03:57 2019 +0200
Another speedup: we have only one test, no need to use the revert
feature
---
.../server/core/operations/search/SearchWithIndicesPersonIT.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/core-integ/src/test/java/org/apache/directory/server/core/operations/search/SearchWithIndicesPersonIT.java b/core-integ/src/test/java/org/apache/directory/server/core/operations/search/SearchWithIndicesPersonIT.java
index b299727..9d8d0ff 100644
--- a/core-integ/src/test/java/org/apache/directory/server/core/operations/search/SearchWithIndicesPersonIT.java
+++ b/core-integ/src/test/java/org/apache/directory/server/core/operations/search/SearchWithIndicesPersonIT.java
@@ -49,7 +49,7 @@ import static org.junit.Assert.assertTrue;
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
@RunWith(FrameworkRunner.class)
-@CreateDS( name = "SearchWithIndicesIT" )
+@CreateDS( name = "SearchWithIndicesIT", enableChangeLog = false )
public class SearchWithIndicesPersonIT extends AbstractLdapTestUnit
{
private static LdapConnection connection;
[directory-server] 03/05: Used a transaction to gather multiple
updates
Posted by el...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
elecharny pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/directory-server.git
commit 865dcb27604d831e9a42d77fcefc070541207480
Author: emmanuel lecharny <el...@apache.org>
AuthorDate: Tue Jun 25 12:31:44 2019 +0200
Used a transaction to gather multiple updates
---
.../apache/directory/server/core/authz/AutzIntegUtils.java | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/core-integ/src/test/java/org/apache/directory/server/core/authz/AutzIntegUtils.java b/core-integ/src/test/java/org/apache/directory/server/core/authz/AutzIntegUtils.java
index 99472d2..9e23856 100644
--- a/core-integ/src/test/java/org/apache/directory/server/core/authz/AutzIntegUtils.java
+++ b/core-integ/src/test/java/org/apache/directory/server/core/authz/AutzIntegUtils.java
@@ -35,6 +35,9 @@ import org.apache.directory.api.ldap.model.message.ResultCodeEnum;
import org.apache.directory.api.ldap.model.name.Dn;
import org.apache.directory.ldap.client.api.LdapConnection;
import org.apache.directory.server.core.api.DirectoryService;
+import org.apache.directory.server.core.api.LdapCoreSessionConnection;
+import org.apache.directory.server.core.api.partition.Partition;
+import org.apache.directory.server.core.api.partition.PartitionTxn;
import org.apache.directory.server.core.integ.IntegrationUtils;
@@ -244,6 +247,12 @@ public class AutzIntegUtils
{
LdapConnection connection = getAdminConnection();
+ // Speedup the addition by using a global transaction
+ Partition systemPartition = service.getSystemPartition();
+ PartitionTxn transaction = systemPartition.beginWriteTransaction();
+ ((LdapCoreSessionConnection)connection).getSession().addTransaction( systemPartition, transaction );
+ ((LdapCoreSessionConnection)connection).getSession().beginSessionTransaction();
+
Entry systemEntry = connection.lookup( "ou=system", "+", "*" );
// modify ou=system to be an AP for an A/C AA if it is not already
@@ -270,6 +279,8 @@ public class AutzIntegUtils
addRequest.setEntry( subEntry );
AddResponse addResponse = connection.add( addRequest );
+ transaction.commit();
+
return addResponse.getLdapResult().getResultCode();
}
[directory-server] 04/05: Use a transaction around the reverter to
speedup tests
Posted by el...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
elecharny pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/directory-server.git
commit 192a7caec57c64af8c633b9b7862b77e57d51daa
Author: emmanuel lecharny <el...@apache.org>
AuthorDate: Tue Jun 25 12:33:25 2019 +0200
Use a transaction around the reverter to speedup tests
---
.../directory/server/core/DefaultDirectoryService.java | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java b/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
index e22dd91..b77ec0b 100644
--- a/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
+++ b/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
@@ -1114,6 +1114,10 @@ public class DefaultDirectoryService implements DirectoryService
*
* TODO review this code.
*/
+ PartitionTxn transaction = systemPartition.beginWriteTransaction();
+ // Speedup the addition by using a global transaction
+ adminSession.addTransaction( systemPartition, transaction );
+ adminSession.beginSessionTransaction();
try
{
@@ -1160,10 +1164,21 @@ public class DefaultDirectoryService implements DirectoryService
throw new NotImplementedException( I18n.err( I18n.ERR_76, reverse.getChangeType() ) );
}
}
+
+ adminSession.endSessionTransaction( true );
}
}
catch ( Exception e )
{
+ try
+ {
+ adminSession.endSessionTransaction( false );
+ }
+ catch ( IOException ioe )
+ {
+ throw new LdapOperationException( ioe.getMessage(), ioe );
+ }
+
throw new LdapOperationException( e.getMessage(), e );
}
finally