#![allow(warnings)]
use clock::OsClock;
use core::fmt::{Display, Formatter};
use dcs::coordination::Stopwatch;
use dcs::heapless::LinearMap;
use dcs::membership::metadata::{BasicMetadata, SerializableMetadata};
use dcs::nodes::{CoordinationSDK, SystemNodeId};
use dcs::properties::CLUSTER_NODE_COUNT;
use dcs::rules::measurements::Measurement;
use serde::*;
use crate::messages::{RaftMessage, RaftPackageBuilder};
use crate::metadata::{RaftMetadata, RaftMetadataBuilder};
use crate::server::RaftService;
use crate::state::RaftState;
pub mod messages;
pub mod metadata;
pub mod server;
pub mod state;
pub static ELECTION_TIMEOUT: u64 = 15000;
pub static CANDIATE_ELECTION_TIMEOUT: u64 = 10000;
pub struct RaftSDK;
impl CoordinationSDK for RaftSDK {
type Clock = OsClock;
type Members = LinearMap<SystemNodeId, RaftMetadata, CLUSTER_NODE_COUNT>;
type Message = RaftMessage<RaftState>;
type Metadata = RaftMetadata;
type Service = RaftService<Self::Clock, RaftState>;
type PackageBuilder = RaftPackageBuilder<RaftState>;
type MetadataBuilder = RaftMetadataBuilder;
}