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 212 of file esMonitoring.py.

Constructor & Destructor Documentation

def esMonitoring.JsonInput.__init__ (   self)

Definition at line 213 of file esMonitoring.py.

214  def __init__(self):
215  self.buf = []
216  self.docs = []

Member Function Documentation

def esMonitoring.JsonInput.flush (   self)

Definition at line 248 of file esMonitoring.py.

249  def flush(self):
250  pass
def esMonitoring.JsonInput.get_doc (   self)

Definition at line 229 of file esMonitoring.py.

230  def get_doc(self):
231  return self.docs.pop(0)
def esMonitoring.JsonInput.have_docs (   self)

Definition at line 232 of file esMonitoring.py.

References esMonitoring.JsonInput.docs.

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

Definition at line 217 of file esMonitoring.py.

References esMonitoring.log().

Referenced by esMonitoring.JsonInput.write().

218  def parse_line(self, line):
219  if not line.strip():
220  # this is keep alive
221  # not yet implemented
222  return
223 
224  try:
225  doc = json.loads(line)
226  self.docs.append(doc)
227  except:
228  log("cannot deserialize json: %s" % line)
def esMonitoring.JsonInput.write (   self,
  rbuf 
)

Definition at line 235 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().

236  def write(self, rbuf):
237  self.buf.append(rbuf)
238  if "\n" in rbuf:
239  # split whatever we have
240  all = "".join(self.buf)
241  spl = all.split("\n")
242 
243  while len(spl) > 1:
244  line = spl.pop(0)
245  self.parse_line(line)
246 
247  self.buf = [spl[0]]
static std::string join(char **cmd)
Definition: RemoteFile.cc:18

Member Data Documentation

esMonitoring.JsonInput.buf

Definition at line 214 of file esMonitoring.py.

Referenced by esMonitoring.JsonInput.write().

esMonitoring.JsonInput.docs

Definition at line 215 of file esMonitoring.py.

Referenced by esMonitoring.JsonInput.have_docs().