@@ -185,7 +185,7 @@ def get_manager(self, db_name='', prop=''):
185
185
return dp
186
186
187
187
@Cached (expire = 60. )
188
- def get_archivers (self , from_db = True ):
188
+ def get_subscribers (self , from_db = True ):
189
189
"""
190
190
If not got from_db, the manager may limit the list available
191
191
"""
@@ -198,6 +198,10 @@ def get_archivers(self, from_db = True):
198
198
raise Exception ('%s Manager not running' % self .manager )
199
199
200
200
return [d for d in p if d .strip ()]
201
+
202
+ def get_archivers (self , * args , ** kwargs ):
203
+ """ alias to get_subscribers """
204
+ return self .get_subscribers (* args ,** kwargs )
201
205
202
206
@Cached (expire = 5. )
203
207
def get_archiver_attributes (self , archiver , from_db = False , full = False ):
@@ -257,7 +261,10 @@ def get_archiver_errors(self,archiver):
257
261
return dict ((a ,e ) for a ,e in zip (al ,er ) if e )
258
262
259
263
def get_archiver_load (self ,archiver ,use_freq = True ):
260
-
264
+ """
265
+ if use_freq=True, returns attribute record frequency
266
+ if false, returns attribute list size
267
+ """
261
268
if use_freq :
262
269
return fn .tango .read_attribute (archiver + '/attributerecordfreq' )
263
270
else :
@@ -350,24 +357,30 @@ def get_attributes_by_table(self,table='',as_id=False):
350
357
" where att_conf_data_type_id = %s" % (w ,i ))) for t ,i in types )
351
358
352
359
@Cached (depth = 10 ,expire = 60. )
353
- def get_archived_attributes (self ,search = '' ):
360
+ def get_subscribed_attributes (self ,search = '' ):
354
361
"""
355
- It gets attributes currently assigned to archiver and updates
362
+ It gets attributes currently assigned to subscribers and updates
356
363
internal attribute/archiver index.
357
364
358
365
DONT USE Manager.AttributeSearch, it is limited to 1024 attrs!
359
366
"""
360
367
#print('get_archived_attributes(%s)'%str(search))
361
368
attrs = []
362
369
[self .get_archiver_attributes (d ,from_db = True )
363
- for d in self .get_archivers ()]
370
+ for d in self .get_subscribers ()]
364
371
for d ,dattrs in self .dedicated .items ():
365
372
for a in dattrs :
366
373
self .attributes [a ].archiver = d
367
374
if not search or fn .clsearch (search ,a ):
368
375
attrs .append (a )
369
376
return attrs
370
377
378
+ def get_archived_attributes (self , * args , ** kwargs ):
379
+ """
380
+ alias to get_subscribed_attributes, to be overloaded in subclasses
381
+ """
382
+ return self .get_subscribed_attributes (* args , ** kwargs )
383
+
371
384
def get_attribute_ID (self ,attr ):
372
385
# returns only 1 ID
373
386
return self .get_attributes_IDs (attr ,as_dict = 0 )[0 ][1 ]
@@ -605,7 +618,7 @@ def add_attribute(self,attribute,archiver=None,period=0,
605
618
"""
606
619
set _event arguments to -1 to ignore them and not modify the database
607
620
608
-
621
+ code_event will be set to True if no other event is setup
609
622
"""
610
623
attribute = parse_tango_model (attribute ,fqdn = True ).fullname
611
624
archiver = archiver or self .get_next_archiver (
0 commit comments