esppy.connectors.SocketSubscriber

class esppy.connectors.SocketSubscriber(host=None, port=None, fstype=None, name=None, is_active=None, snapshot=None, collapse=None, configfilesection=None, dateformat=None, hdatcashostport=None, hdatcaspassword=None, hdatcasusername=None, hdatfilename=None, hdatlasrhostport=None, hdatlasrkey=None, hdatmaxdatanodes=None, hdatmaxstringlength=None, hdatnumthreads=None, hdfsblocksize=None, hdfsnumreplicas=None, header=None, maxfilesize=None, periodicity=None, rate=None, rmretdel=None, unbufferedoutputstreams=None)

Bases: esppy.connectors.fs.FileSubscriber

Subscribe to events from a socket

Parameters
hoststring

The host name where the socket exists

portint

The port number on the server

fstypestring, optional

The data file type. Valid values: ‘binary’, ‘csv’, ‘xml’, ‘json’, ‘syslog’, ‘hdat’, ‘cef’

namestring, optional

Name of the connector object

snapshotboolean, optional

Specifies whether to send snapshot data

collapseboolean, optional

Converts UPDATE_BLOCK events to UPDATE events in order to make subscriber output publishable.

configfilesectionstring, optional

Specifies the name of the section in the ESP connector config file for parameters.

dateformatstring, optional

Specifies the format of datetime and timestamp fields

hdatcashostportstring, optional

Specifies the CAS server host and port

hdatcaspasswordstring, optional

Specifies the CAS server password

hdatcasusernamestring, optional

Specifies the CAS server user name

hdatfilenamestring, optional

Specifies the name of the Objective Analysis Package Data (HDAT) file to be written to the Hadoop Distributed File System (HDFS).

hdatlasrhostportstring, optional

Specifies the SAS LASR Analytic Server host and port

hdatlasrkeystring, optional

Specifies the path to tklasrkey.sh

hdatmaxdatanodesint, optional

Specifies the maximum number of data node connections

hdatmaxstringlengthint, optional

Specifies in bytes the fixed size of string fields in Objective Analysis Package Data (HDAT) files

hdatnumthreadsint, optional

Specifies the size of the thread pool used for multi-threaded writes to data node socket connections.

hdfsblocksizeint, optional

Specifies in Mbytes the block size used to write an Objective Analysis Package Data (HDAT) file.

hdfsnumreplicasint, optional

Specifies the number of Hadoop Distributed File System (HDFS) replicas created with writing an Objective Analysis Package Data (HDAT) file.

headerboolean or string, optional

For a CSV subscriber, specifies to write a header row that shows comma-separated fields. Valid values: True, False, or ‘full’ (include opcode flags in header)

maxfilesizeint, optional

Specifies the maximum size in bytes of the subscriber output file

periodicityint, optional

Specifies the interval in seconds at which the subscriber output file is closed and a new output file opened.

rateboolean, optional

When latency mode is enabled, shows this specified rate in generated output files.

rmretdelboolean, optional

Specifies to remove all delete events from event blocks received by a subscriber that were introduced by a window retention policy.

unbufferedoutputstreamsboolean, optional

Specifies to create an unbuffered stream when writing to a file or socket.

Returns
SocketSubscriber
__init__(self, host=None, port=None, fstype=None, name=None, is_active=None, snapshot=None, collapse=None, configfilesection=None, dateformat=None, hdatcashostport=None, hdatcaspassword=None, hdatcasusername=None, hdatfilename=None, hdatlasrhostport=None, hdatlasrkey=None, hdatmaxdatanodes=None, hdatmaxstringlength=None, hdatnumthreads=None, hdfsblocksize=None, hdfsnumreplicas=None, header=None, maxfilesize=None, periodicity=None, rate=None, rmretdel=None, unbufferedoutputstreams=None)

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(self[, host, port, fstype, name, …])

Initialize self.

clear(self)

copy(self[, deep])

Return a copy of the object

from_element(data[, session])

Construct connector from XML definition

from_parameters(conncls[, type, name, …])

from_xml(data[, session])

Construct connector from XML definition

get(self, key[, default])

items(self)

keys(self)

pop(self, key[, default])

If key is not found, d is returned if given, otherwise KeyError is raised.

popitem(self)

as a 2-tuple; but raise KeyError if D is empty.

set_properties(self, \*\*kwargs)

Set connector properties

setdefault(self, key[, default])

to_element(self)

Export connector definition to ElementTree.Element

to_xml(self[, pretty])

Export connector definition to XML

update(\*args, \*\*kwds)

If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v

values(self)

Attributes

connector_key

property_defs