]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: Add get_metablob to LogEvent
authorJohn Spray <john.spray@inktank.com>
Tue, 25 Mar 2014 13:31:03 +0000 (13:31 +0000)
committerJohn Spray <john.spray@inktank.com>
Sun, 18 May 2014 10:21:29 +0000 (11:21 +0100)
Previously the only way to get at the payload
of things like EUpdate and EOpen was to replay() them
(required a full running MDS) or to use downcasting
(yuck).

Signed-off-by: John Spray <john.spray@inktank.com>
src/mds/LogEvent.h
src/mds/events/EOpen.h
src/mds/events/EUpdate.h

index 97a4233da6d24b60ba87169656de9965596b1e9e..1245d256cd19d708c94123875e679bcd27910039 100644 (file)
@@ -48,6 +48,7 @@
 
 class MDS;
 class LogSegment;
+class EMetaBlob;
 
 // generic log event
 class LogEvent {
@@ -106,7 +107,11 @@ protected:
    */
   virtual void replay(MDS *m) { assert(0); }
 
-
+  /**
+   * If the subclass embeds a MetaBlob, return it here so that
+   * tools can examine metablobs while traversing lists of LogEvent.
+   */
+  virtual EMetaBlob *get_metablob() {return NULL;}
 };
 
 inline ostream& operator<<(ostream& out, LogEvent& le) {
index 1267cf0af72f112b868b5d502ef63db6d28ecb21..baf93344a230d18e3fdd3f57a7da3c6c29ff58ea 100644 (file)
@@ -49,6 +49,7 @@ public:
 
   void update_segment();
   void replay(MDS *mds);
+  EMetaBlob *get_metablob() {return &metablob;}
 };
 
 #endif
index 645386e2511fd375ba1fa45917b6e20cad504c36..d0be0a4f28bcc195963e793c5f501329845396f2 100644 (file)
@@ -45,6 +45,7 @@ public:
 
   void update_segment();
   void replay(MDS *mds);
+  EMetaBlob *get_metablob() {return &metablob;}
 };
 
 #endif