]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: Add LogEvent::get_type_str()
authorJohn Spray <john.spray@inktank.com>
Tue, 25 Mar 2014 13:29:11 +0000 (13:29 +0000)
committerJohn Spray <john.spray@inktank.com>
Sun, 18 May 2014 10:21:28 +0000 (11:21 +0100)
Signed-off-by: John Spray <john.spray@inktank.com>
src/mds/LogEvent.cc
src/mds/LogEvent.h

index 16e7f80319609c1df6a68b4628761fb0b9f6ab43..93e290a2220dec61ff67bde524588e1a97f16188 100644 (file)
@@ -62,6 +62,34 @@ LogEvent *LogEvent::decode(bufferlist& bl)
   return event;
 }
 
+
+std::string LogEvent::get_type_str() const
+{
+  switch(_type) {
+  case EVENT_SUBTREEMAP: return "SUBTREEMAP";
+  case EVENT_SUBTREEMAP_TEST: return "SUBTREEMAP_TEST";
+  case EVENT_EXPORT: return "EXPORT";
+  case EVENT_IMPORTSTART: return "IMPORTSTART";
+  case EVENT_IMPORTFINISH: return "IMPORTFINISH";
+  case EVENT_FRAGMENT: return "FRAGMENT";
+  case EVENT_RESETJOURNAL: return "RESETJOURNAL";
+  case EVENT_SESSION: return "SESSION";
+  case EVENT_SESSIONS_OLD: return "SESSIONS_OLD";
+  case EVENT_SESSIONS: return "SESSIONS";
+  case EVENT_UPDATE: return "UPDATE";
+  case EVENT_SLAVEUPDATE: return "SLAVEUPDATE";
+  case EVENT_OPEN: return "OPEN";
+  case EVENT_COMMITTED: return "COMMITTED";
+  case EVENT_TABLECLIENT: return "TABLECLIENT";
+  case EVENT_TABLESERVER: return "TABLESERVER";
+
+  default:
+    generic_dout(0) << "get_type_str: unknown type " << _type << dendl;
+    return "UNKNOWN";
+  }
+}
+
+
 LogEvent *LogEvent::decode_event(bufferlist& bl, bufferlist::iterator& p, __u32 type)
 {
   int length = bl.length() - p.get_off();
index 542e75e84867fd0fe628bf4bb5edf8a29bc74f8b..0c390efd18be6c6339c219a7e2b24e959f3307d5 100644 (file)
@@ -67,6 +67,7 @@ protected:
     : _type(t), _start_off(0), _segment(0) { }
   virtual ~LogEvent() { }
 
+  string get_type_str() const;
   int get_type() const { return _type; }
   void set_type(int t) { _type = t; }