test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes
esMonitoring.JsonInput Class Reference
Inheritance diagram for esMonitoring.JsonInput:

Public Member Functions

def __init__
 
def flush
 
def get_doc
 
def have_docs
 
def parse_line
 
def write
 

Public Attributes

 buf
 
 docs
 

Detailed Description

Definition at line 182 of file esMonitoring.py.

Constructor & Destructor Documentation

def esMonitoring.JsonInput.__init__ (   self)

Definition at line 183 of file esMonitoring.py.

184  def __init__(self):
185  self.buf = []
186  self.docs = []

Member Function Documentation

def esMonitoring.JsonInput.flush (   self)

Definition at line 218 of file esMonitoring.py.

219  def flush(self):
220  pass
def esMonitoring.JsonInput.get_doc (   self)

Definition at line 199 of file esMonitoring.py.

200  def get_doc(self):
201  return self.docs.pop(0)
def esMonitoring.JsonInput.have_docs (   self)

Definition at line 202 of file esMonitoring.py.

References esMonitoring.JsonInput.docs.

203  def have_docs(self):
204  return len(self.docs) > 0
def esMonitoring.JsonInput.parse_line (   self,
  line 
)

Definition at line 187 of file esMonitoring.py.

References esMonitoring.log().

Referenced by esMonitoring.JsonInput.write().

188  def parse_line(self, line):
189  if not line.strip():
190  # this is keep alive
191  # not yet implemented
192  return
193 
194  try:
195  doc = json.loads(line)
196  self.docs.append(doc)
197  except:
198  log("cannot deserialize json: %s" % line)
def esMonitoring.JsonInput.write (   self,
  rbuf 
)

Definition at line 205 of file esMonitoring.py.

References base64_decode_context.buf, esMonitoring.History.buf, esMonitoring.JsonInput.buf, join(), and esMonitoring.JsonInput.parse_line().

Referenced by pkg.AbstractPkg.generate().

206  def write(self, rbuf):
207  self.buf.append(rbuf)
208  if "\n" in rbuf:
209  # split whatever we have
210  all = "".join(self.buf)
211  spl = all.split("\n")
212 
213  while len(spl) > 1:
214  line = spl.pop(0)
215  self.parse_line(line)
216 
217  self.buf = [spl[0]]
static std::string join(char **cmd)
Definition: RemoteFile.cc:18

Member Data Documentation

esMonitoring.JsonInput.buf

Definition at line 184 of file esMonitoring.py.

Referenced by esMonitoring.JsonInput.write().

esMonitoring.JsonInput.docs

Definition at line 185 of file esMonitoring.py.

Referenced by esMonitoring.JsonInput.have_docs().