You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by Jingmei Li <Ji...@bentley.com> on 2002/11/06 23:30:50 UTC

creating a structure with 10000 files is very slow

Hi, 
I'm using Slide 1.0.16 and our Slide implementation fetches files from our
own Document Management Server and displays in Webfolders or Webdrive
through Slide.
If my directory has 10000 files in it then it just seems to take Slide
forever to finish the process. See the code snippet below.
structure.create() and content.create() take most of the time. Also notice
that in content.create() we are passing null as the NodeRevisionContent
since we'll only stream the real file when user tries to open the file.

Any suggestions to speed things up significantly?

Thanks a lot in advance.

Jingmei


public static void createFile
(
String uri, 
NamespaceAccessToken token, 
int fileSize,
String updateTime,
boolean isReadonly
)
    {
    //setup the helpers
    Structure structure = token.getStructureHelper();
 	Content content = token.getContentHelper();
  
    //perform operation as root
    CredentialsToken credToken =
         new CredentialsToken(new String("root"));
    SlideToken slideToken = new SlideTokenImpl(credToken);
     
    slideToken.setForceStoreEnlistment(true);        
         
    SubjectNode collection = new SubjectNode();
    NodeRevisionDescriptor revisionDescriptor =
         new NodeRevisionDescriptor(0);
     
    NodeProperty property = null;
                     
//....(more code)
   	NodeRevisionContent revisionContent = new NodeRevisionContent();
	
	try {
        structure.create(slideToken, collection, uri);
        content.create(slideToken, uri, revisionDescriptor, null);
          }
	catch (ObjectAlreadyExistsException e) 
        {
        return;
        }  
    catch (Exception e) 
        {
        System.out.println("PWContext.createUserContext() BARFED! -" + e);
         }       
    }




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>