HTCondor Project List Archives



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Condor-devel] RFC: using the daemon ad from condor_daemon_client



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;