Hi,

The addRepository operations are fast because they do not do any IO, nor does 
it try to validate if the repo is valid, etc. It just tells p2 that there may 
be something of interest at this location.
On the other hand, the loadRepository can take quite some time since it will 
contact the server to download the repository files (e.g. content.[jar|xml], 
artifact/[xml|jar], composite*...) and load that in memory. With the repos I've 
seen, most of the cost of this operation goes into downloading the file.

HTH

Pascal


From: [email protected] [mailto:[email protected]] On Behalf 
Of Dileepa Jayakody
Sent: September-11-12 1:06 AM
To: [email protected]
Subject: [p2-dev] Delay in adding a p2 Repository

Hi all,

In our platform, we use p2 as the provisioning platform. In our p2 Repository 
management code, we are adding a repository using below code segment;

IMetadataRepositoryManager metadataRepositoryManager = ServiceHolder.
getMetadataRepositoryManager();
IArtifactRepositoryManager artifactRepositoryManager = 
ServiceHolder.getArtifactRepositoryManager();

            //adding metadata and artifact repositories
            metadataRepositoryManager.addRepository(location);
            artifactRepositoryManager.addRepository(location);
            //Loading the metadata repository
            metadataRepositoryManager.loadRepository(location, new 
NullProgressMonitor());
            metadataRepositoryManager.setRepositoryProperty(location, 
IRepository.PROP_NICKNAME, nickName);

            //Loading the artifact repository
            artifactRepositoryManager.loadRepository(location, new 
NullProgressMonitor());
            artifactRepositoryManager.setRepositoryProperty(location, 
IRepository.PROP_NICKNAME, nickName);

Sometimes we can notice a considerable delay when adding a repository. When you 
say artifactRepositoryManager.loadRepository(location, new 
NullProgressMonitor()); does p2 load all the InstallableUnits in the repository 
to memory? If so, could this be due to a long list of InstallableUnits in the 
repository.

Thanks,
Dileepa
_______________________________________________
p2-dev mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/p2-dev

Reply via email to