[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Condor-devel] RFC: using the daemon ad from condor_daemon_client
- Date: Thu, 1 Feb 2007 15:32:10 -0600
- From: Erik Paulson <epaulson@xxxxxxxxxxx>
- Subject: Re: [Condor-devel] RFC: using the daemon ad from condor_daemon_client
One more thing - I thought about returning a counted_ptr to the
ad instead of a pointer to the ad, but I wasn't sure what implications
that would have on the rest of the code.
Very few things are going to ask for the daemon ad (in fact, at first
it will be just one tool) but I wasn't sure if having a method that returned
counted_ptr<ClassAd *> in an object meant that suddently everything that
used the daemon object would be bloated, even if it never called the
daemonAd method.
-Erik
On Thu, Feb 01, 2007 at 03:24:56PM -0600, Erik Paulson wrote:
> Hi -
>
> Sometimes a tool will want to know information from a daemon's classad
> after it has located it. Currently, the Daemon object has a number of
> methods for finding out the most common sorts of things, but adding a new
> method for anything you might want to find out about a daemon seems like
> overkill.
>
> For the times when you really just want to know "what's the value of foo
> from the machine ad", it'd be nice to get access to the ad, especially
> since the Daemon object might have gone to the trouble of going to the
> collector to get it for you anyway.
>
> Any objections if we just stash a copy of the ad in the daemon object, so
> if a client wants to look in the ad it can?
>
> -Erik
>
> Index: daemon.C
> ===================================================================
> RCS file: /p/condor/repository/CONDOR_SRC/src/condor_daemon_client/daemon.C,v
> retrieving revision 1.10
> diff -r1.10 daemon.C
> 71a72
> > m_daemon_ad_ptr = NULL;
> 187a189,192
> >
> > // let's have our own copy of the daemon's ad in this case.
> > m_daemon_ad_ptr = new ClassAd(*ad);
> >
> 257c262,264
> <
> ---
> > if(copy.m_daemon_ad_ptr) {
> > m_daemon_ad_ptr = new ClassAd(*copy.m_daemon_ad_ptr);
> > }
> 286a294
> > if( m_daemon_ad_ptr) { delete m_daemon_ad_ptr; }
> 407d414
> <
> 1366a1374,1380
> > if( !m_daemon_ad_ptr) {
> > // I don't think we can ever get into a case where we already
> > // have located the daemon and have a copy of its ad, but just
> > // in case, don't stash another copy of it if we can't find it.
> > // I hope this is a deep copy wiht no chaining bullshit
> > m_daemon_ad_ptr = new ClassAd(*scan);
> > }
> Index: daemon.h
> ===================================================================
> RCS file: /p/condor/repository/CONDOR_SRC/src/condor_daemon_client/daemon.h,v
> retrieving revision 1.8
> diff -r1.8 daemon.h
> 232a233,239
> > /** Return the classad for this daemon. We may not have the
> > ad, if we found the daemon from the config file or the
> > address file, or it doesn't have a classad.
> > The caller must copy the classad it gets back!
> > */
> > ClassAd *daemonAd() { return m_daemon_ad_ptr; }
> >
> 453a461
> > ClassAd *m_daemon_ad_ptr;
> _______________________________________________
> Condor-devel mailing list
> Condor-devel@xxxxxxxxxxx
> https://lists.cs.wisc.edu/mailman/listinfo/condor-devel