Skip to content

Commit

Permalink
feat(eventing): add io-engine events
Browse files Browse the repository at this point in the history
Signed-off-by: Vandana Varakantham <[email protected]>
  • Loading branch information
datacore-vvarakantham committed Jan 9, 2024
1 parent 7b8da24 commit 8af7a10
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
16 changes: 16 additions & 0 deletions apis/events/protobuf/v1/event.proto
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ enum EventCategory {
HighAvailability = 6;
NvmePath = 7;
HostInitiator = 8;
IoEngineCategory = 9;
}

// Event Action
Expand All @@ -49,6 +50,11 @@ enum EventAction {
NvmeConnect = 13;
NvmeDisconnect = 14;
NvmeKeepAliveTimeout = 15;
ReactorFreeze = 16;
ReactorUnfreeze = 17;
Shutdown = 18;
Start = 19;
Stop = 20;
}

// Event meta data
Expand Down Expand Up @@ -101,6 +107,8 @@ message EventDetails {
optional NvmePathEventDetails nvme_path_details = 5;
// Host initiator event details
optional HostInitiatorEventDetails host_initiator_details = 6;
// Reactor event details
optional ReactorEventDetails reactor_details = 7;
}

// Rebuild event details
Expand Down Expand Up @@ -186,3 +194,11 @@ message HostInitiatorEventDetails {
// Target uuid
string uuid = 4;
}

// Reactor event details
message ReactorEventDetails {
// The logical core this reactor is created on
uint64 lcore = 1;
// Reactor state
string state = 2;
}
18 changes: 16 additions & 2 deletions apis/events/src/event_traits.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::event::{
Component, EventDetails, EventMessage, EventMeta, EventSource, HostInitiatorEventDetails,
NexusChildEventDetails, NvmePathEventDetails, RebuildEventDetails, RebuildStatus,
ReplicaEventDetails, SwitchOverEventDetails, SwitchOverStatus, Version,
NexusChildEventDetails, NvmePathEventDetails, ReactorEventDetails, RebuildEventDetails,
RebuildStatus, ReplicaEventDetails, SwitchOverEventDetails, SwitchOverStatus, Version,
};
use chrono::{DateTime, Utc};
use once_cell::sync::OnceCell;
Expand Down Expand Up @@ -177,6 +177,20 @@ impl EventSource {
}
self
}

/// Add reactor event specific data to io-engine event source.
pub fn with_reactor_details(self, lcore: u64, state: &str) -> Self {
EventSource {
event_details: Some(EventDetails {
reactor_details: Some(ReactorEventDetails {
lcore,
state: state.to_string(),
}),
..Default::default()
}),
..self
}
}
}

impl EventMessage {
Expand Down

0 comments on commit 8af7a10

Please sign in to comment.