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 2006/05/16 09:11:21 UTC

svn commit: r406858 - /directory/branches/elecharny/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/ImportCommand.java

Author: elecharny
Date: Tue May 16 00:11:20 2006
New Revision: 406858

URL: http://svn.apache.org/viewcvs?rev=406858&view=rev
Log:
Fixed some bugs (byteBuffer was not fliped before being sent), and improved logs

Modified:
    directory/branches/elecharny/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/ImportCommand.java

Modified: directory/branches/elecharny/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/ImportCommand.java
URL: http://svn.apache.org/viewcvs/directory/branches/elecharny/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/ImportCommand.java?rev=406858&r1=406857&r2=406858&view=diff
==============================================================================
--- directory/branches/elecharny/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/ImportCommand.java (original)
+++ directory/branches/elecharny/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/ImportCommand.java Tue May 16 00:11:20 2006
@@ -165,7 +165,7 @@
 			        	}
 		        	}
 		        	
-		        	System.out.println( messageResp.toString() );
+		        	//System.out.println( messageResp.toString() );
 		        	
 		        	//System.out.println( ((LdapMessageContainer)ldapMessageContainer).getLdapMessage() );
 		        	((LdapMessageContainer)ldapMessageContainer).clean();
@@ -227,6 +227,7 @@
 		message.setProtocolOP(addRequest);
 		message.setMessageId(messageId);
 		ByteBuffer bb = message.encode(null);
+		bb.flip();
 
 		sendMessage(bb);
 		
@@ -374,12 +375,30 @@
 		{
 			// Parse the file and inject every entri or every modification
 			Iterator entries = ldifReader.iterator();
+			long t0 = System.currentTimeMillis();
+			int nbAdd = 0;
 
 			while ( entries.hasNext() ) {
 				Entry entry = (Entry)entries.next();
 				
 				addEntry( entry, messageId++ );
+				nbAdd++;
+				
+				if ( nbAdd % 10 == 0 )
+				{
+					System.out.print( '.' );
+				}
+				
+				if ( nbAdd % 500 == 0 )
+				{
+					System.out.println( nbAdd );
+				}
 			}
+			
+			long t1 = System.currentTimeMillis();
+
+			System.out.println( "Done!" );
+			System.out.println( nbAdd + " users added in " + ( ( t1 - t0 ) / 1000 ) + " seconds" );
 		}
 		else
 		{