Author: mlandres Date: Fri Aug 3 14:59:51 2007 New Revision: 6442 URL: http://svn.opensuse.org/viewcvs/zypp?rev=6442&view=rev Log: - Speed up retrieving MediaNr attribute, as it slows down install order calculation. (#297173) Modified: trunk/libzypp/devel/devel.ma/Test.cc trunk/libzypp/zypp/cache/CacheAttributes.h trunk/libzypp/zypp/repo/cached/PackageImpl.cc trunk/libzypp/zypp/repo/cached/PackageImpl.h trunk/libzypp/zypp/repo/cached/SrcPackageImpl.cc trunk/libzypp/zypp/repo/cached/SrcPackageImpl.h Modified: trunk/libzypp/devel/devel.ma/Test.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/devel/devel.ma/Test.cc?rev=6442&r1=6441&r2=6442&view=diff ============================================================================== --- trunk/libzypp/devel/devel.ma/Test.cc (original) +++ trunk/libzypp/devel/devel.ma/Test.cc Fri Aug 3 14:59:51 2007 @@ -188,10 +188,7 @@ { INT << "===[START]==========================================" << endl; - DummyConsumer dummy; - RepoParser parser( data::RecordId(), dummy ); - parser.parse( "REPO" ); INT << "===[END]============================================" << endl << endl; return 0; Modified: trunk/libzypp/zypp/cache/CacheAttributes.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/cache/CacheAttributes.h?rev=6442&r1=6441&r2=6442&view=diff ============================================================================== --- trunk/libzypp/zypp/cache/CacheAttributes.h (original) +++ trunk/libzypp/zypp/cache/CacheAttributes.h Fri Aug 3 14:59:51 2007 @@ -75,7 +75,6 @@ inline const Attribute & attrPatternUserVisible() { static Attribute a("Pattern","userVisible"); return a; } inline const Attribute & attrPatternUiIncludes() { static Attribute a("Pattern","uiIncludes"); return a; } inline const Attribute & attrPatternUiExtends() { static Attribute a("Pattern","uiExtends"); return a; } - /////////////////////////////////////////////////////////////////// inline const Attribute & attrProductDistributionEdition() { static Attribute a("Product","distributionEdition"); return a; } inline const Attribute & attrProductDistributionName() { static Attribute a("Product","distributionName"); return a; } Modified: trunk/libzypp/zypp/repo/cached/PackageImpl.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/repo/cached/PackageImpl.cc?rev=6442&r1=6441&r2=6442&view=diff ============================================================================== --- trunk/libzypp/zypp/repo/cached/PackageImpl.cc (original) +++ trunk/libzypp/zypp/repo/cached/PackageImpl.cc Fri Aug 3 14:59:51 2007 @@ -134,6 +134,16 @@ return Changelog(); } +unsigned PackageImpl::mediaNr() const +{ + return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrPackageLocationMediaNr() ); +} + +ByteCount PackageImpl::downloadSize() const +{ + return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrPackageLocationDownloadSize() ); +} + OnMediaLocation PackageImpl::location() const { OnMediaLocation loc; Modified: trunk/libzypp/zypp/repo/cached/PackageImpl.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/repo/cached/PackageImpl.h?rev=6442&r1=6441&r2=6442&view=diff ============================================================================== --- trunk/libzypp/zypp/repo/cached/PackageImpl.h (original) +++ trunk/libzypp/zypp/repo/cached/PackageImpl.h Fri Aug 3 14:59:51 2007 @@ -31,6 +31,18 @@ PackageImpl( const data::RecordId &id, repo::cached::RepoImpl::Ptr repository_r ); + public: + /** Overloaded ResObjectImpl attribute. + * \return The \ref location media number. + */ + virtual unsigned mediaNr() const; + + /** Overloaded ResObjectImpl attribute. + * \return The \ref location downloadSize. + */ + virtual ByteCount downloadSize() const; + + public: virtual TranslatedText summary() const; virtual TranslatedText description() const; virtual TranslatedText insnotify() const; Modified: trunk/libzypp/zypp/repo/cached/SrcPackageImpl.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/repo/cached/SrcPackageImpl.cc?rev=6442&r1=6441&r2=6442&view=diff ============================================================================== --- trunk/libzypp/zypp/repo/cached/SrcPackageImpl.cc (original) +++ trunk/libzypp/zypp/repo/cached/SrcPackageImpl.cc Fri Aug 3 14:59:51 2007 @@ -97,16 +97,20 @@ // SRC PACKAGE //////////////////////////////////////////////////////// -OnMediaLocation SrcPackageImpl::location() const +unsigned SrcPackageImpl::mediaNr() const { - OnMediaLocation loc( _repository->resolvableQuery().queryStringAttribute( _id, cache::attrSrcPackageLocationFilename() ), - _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrSrcPackageLocationMediaNr() ) ); + return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrSrcPackageLocationMediaNr() ); +} - string chktype = _repository->resolvableQuery().queryStringAttribute( _id, cache::attrSrcPackageLocationChecksumType() ); - string chkvalue = _repository->resolvableQuery().queryStringAttribute( _id, cache::attrSrcPackageLocationChecksum() ); - loc.setChecksum(CheckSum(chktype, chkvalue)); - loc.setDownloadSize( _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrSrcPackageLocationDownloadSize() ) ); -#warning FIX REMAINING LOCATION ATTRS +ByteCount SrcPackageImpl::downloadSize() const +{ + return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrSrcPackageLocationDownloadSize() ); +} + +OnMediaLocation SrcPackageImpl::location() const +{ + OnMediaLocation loc; + queryOnMediaLocation( _repository->resolvableQuery(), _id, cache::attrSrcPackageLocation, loc ); return loc; } Modified: trunk/libzypp/zypp/repo/cached/SrcPackageImpl.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/repo/cached/SrcPackageImpl.h?rev=6442&r1=6441&r2=6442&view=diff ============================================================================== --- trunk/libzypp/zypp/repo/cached/SrcPackageImpl.h (original) +++ trunk/libzypp/zypp/repo/cached/SrcPackageImpl.h Fri Aug 3 14:59:51 2007 @@ -30,8 +30,20 @@ SrcPackageImpl( const data::RecordId &id, repo::cached::RepoImpl::Ptr repository_r ); + public: + /** Overloaded ResObjectImpl attribute. + * \return The \ref location media number. + */ + virtual unsigned mediaNr() const; + + /** Overloaded ResObjectImpl attribute. + * \return The \ref location downloadSize. + */ + virtual ByteCount downloadSize() const; + + public: virtual Repository repository() const; - + virtual TranslatedText summary() const; virtual TranslatedText description() const; virtual TranslatedText insnotify() const; @@ -42,7 +54,7 @@ virtual bool installOnly() const; virtual Date buildtime() const; virtual Date installtime() const; - + virtual OnMediaLocation location() const; private: repo::cached::RepoImpl::Ptr _repository; -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org