|
ADCT Python
Python client API implementation for publishing ADCT data
|
This plugin generates writes each message to the configured file, with \<adct-json>\</adct-json> delimiters surrounding it. More...


Public Member Functions | |
| __init__ (self) | |
| int | config (self, **kwargs) |
| int | initialize (self) |
| Set up any resources needed for reuse in publish(). | |
| int | publish (self, builder.Builder b) |
| Publish json extracted from builder. | |
| None | finalize (self) |
| Clean up any resources set up in initialize (files, pipes, etc). | |
Public Member Functions inherited from adctk.publisher.Publisher | |
| str | name (self) |
| Get the name which a factory or error message should use. | |
| str | version (self) |
| dict[str, str] | get_option_defaults (self) |
| None | pause (self) |
| Cause publish calls to be ignored until resume is called. | |
| None | resume (self) |
| Cancel an prior calls to pause. | |
| int | publish_str (self, str json_string) |
| int | publish_obj (self, obj) |
Public Attributes | |
| defaults | |
| paused | |
| plugin_prefix | |
| debug | |
| fname | |
| fdir | |
| topdir | |
| user | |
| host | |
| pid | |
| rank | |
| abspath | |
| fappend | |
| app_out | |
| mode | |
| state | |
Public Attributes inherited from adctk.publisher.Publisher | |
| defaults | |
| plugin_prefix | |
| paused | |
| state | |
| mode | |
Protected Member Functions | |
| _create_directory_like (self, newdir, dirlike) | |
| _create_directories (self) | |
| _create_stream (self, app) | |
Protected Member Functions inherited from adctk.publisher.Publisher | |
| str | _get (self, dict[str, str] opts, str field) |
| bool | _get_bool (self, dict[str, str] opts, str field) |
Static Protected Attributes | |
| str | _name = "multifile" |
| str | _version = "1.0.0" |
Static Protected Attributes inherited from adctk.publisher.Publisher | |
| str | _name = "unknown" |
| str | _version = "0.0.0" |
Additional Inherited Members | |
Static Public Member Functions inherited from adctk.publisher.Publisher | |
| tuple[float] | get_timeout_defaults () |
| Get the adc server connect and response timeouts defined in the environment ADC_SERVER_CONNECT_TIMEOUT and ADC_SERVER_POST_TIMEOUT as a tuple or default values if not defined. | |
| str | get_url_default () |
| Get the alleged adc server url base from environment ADC_SERVER_URL or the default if it is not present. | |
| str | get_port_default () |
| Get the adc server port number to use if it is properly defined in the environment ADC_SERVER_PORT or the default if it is not. | |
Static Public Attributes inherited from adctk.publisher.Publisher | |
| API_VERSION = adc_version.AdcVersion()._dict() | |
This plugin generates writes each message to the configured file, with \<adct-json>\</adct-json> delimiters surrounding it.
The output directory is "." by default, but may be overriden with a full path defined in env("ADC_MULTIFILE_PLUGIN_DIRECTORY"). The resulting mass of files can be reduced independently later by concatenating all files in the tree or more selectively with a single call to the consolidate_multifile_logs() function.
Multiple independent multifile publishers may be created; exact filenames are not user controlled, to avoid collisions. Likewise there is no append mode.
DIR/$user/[$adc_wfid.]H_$host.P$pid.T$start.p$publisherptr/$application.R$rank.XXXXXX
Files opened will remain opened until the publisher is finalized.
Debug output (to stderr) is enabled if env("ADC_MULTIFILE_PLUGIN_DEBUG") is a number other than 0.
Environment Variables
| adctk.multifile_publisher.MultiFilePublisher.__init__ | ( | self | ) |
Reimplemented from adctk.publisher.Publisher.
|
protected |
|
protected |
Create a directory and use dirlik perms. parent of newdir must exist
|
protected |
allocate file or None in app_out table. If allocated, truncated opened ug+rw
| int adctk.multifile_publisher.MultiFilePublisher.config | ( | self, | |
| ** | kwargs | ||
| ) |
The config options for the file plugin are directory=<directory>, file=<leafname>, append="true" and debug=<int>. If not specified, then the environment variables ADC_MULTIFILE_PLUGIN_* are checked, where * is DIRECTORY, FILE, and DEBUG.
Reimplemented from adctk.publisher.Publisher.
| None adctk.multifile_publisher.MultiFilePublisher.finalize | ( | self | ) |
Clean up any resources set up in initialize (files, pipes, etc).
Reimplemented from adctk.publisher.Publisher.
| int adctk.multifile_publisher.MultiFilePublisher.initialize | ( | self | ) |
Set up any resources needed for reuse in publish().
Reimplemented from adctk.publisher.Publisher.
| int adctk.multifile_publisher.MultiFilePublisher.publish | ( | self, | |
| builder.Builder | b | ||
| ) |
Publish json extracted from builder.
Reimplemented from adctk.publisher.Publisher.
|
staticprotected |
|
staticprotected |
| adctk.multifile_publisher.MultiFilePublisher.abspath |
| adctk.multifile_publisher.MultiFilePublisher.app_out |
| adctk.multifile_publisher.MultiFilePublisher.debug |
| adctk.multifile_publisher.MultiFilePublisher.defaults |
| adctk.multifile_publisher.MultiFilePublisher.fappend |
| adctk.multifile_publisher.MultiFilePublisher.fdir |
| adctk.multifile_publisher.MultiFilePublisher.fname |
| adctk.multifile_publisher.MultiFilePublisher.host |
| adctk.multifile_publisher.MultiFilePublisher.mode |
| adctk.multifile_publisher.MultiFilePublisher.paused |
| adctk.multifile_publisher.MultiFilePublisher.pid |
| adctk.multifile_publisher.MultiFilePublisher.plugin_prefix |
| adctk.multifile_publisher.MultiFilePublisher.rank |
| adctk.multifile_publisher.MultiFilePublisher.state |
| adctk.multifile_publisher.MultiFilePublisher.topdir |
| adctk.multifile_publisher.MultiFilePublisher.user |