Skip to main content

EmbeddedArchiveMediaDriverProcess

Struct EmbeddedArchiveMediaDriverProcess 

Source
pub struct EmbeddedArchiveMediaDriverProcess {
    pub aeron_dir: CString,
    pub archive_dir: CString,
    pub control_request_channel: String,
    pub control_response_channel: String,
    pub recording_events_channel: String,
    /* private fields */
}

Fields§

§aeron_dir: CString§archive_dir: CString§control_request_channel: String§control_response_channel: String§recording_events_channel: String

Implementations§

Source§

impl EmbeddedArchiveMediaDriverProcess

Source

pub fn build_and_start( aeron_dir: &str, archive_dir: &str, control_request_channel: &str, control_response_channel: &str, recording_events_channel: &str, ) -> Result<Self>

Builds missing Aeron jars with Gradle and starts an Archive Media Driver.

Uses the Gradle wrapper in aeron under CARGO_MANIFEST_DIR. The build writes jars to aeron/aeron-all/build/libs. Java must be on PATH. The returned guard stops the process and removes its directories on drop.

§Parameters
  • aeron_dir: Media Driver directory for IPC and client communication.
  • archive_dir: Directory for recordings and archive metadata.
  • control_request_channel: URI for archive control requests.
  • control_response_channel: URI for archive control responses.
  • recording_events_channel: URI for recording event notifications.
§Errors

Returns an error if the Gradle build or process startup fails.

§Example
use rusteron_archive::testing::EmbeddedArchiveMediaDriverProcess;
let driver = EmbeddedArchiveMediaDriverProcess::build_and_start(
    "/tmp/aeron-dir",
    "/tmp/archive-dir",
    "aeron:udp?endpoint=localhost:8010",
    "aeron:udp?endpoint=localhost:8011",
    "aeron:udp?endpoint=localhost:8012",
).expect("Failed to build and start Aeron Archive Media Driver");
Source

pub fn run_aeron_stats(&self) -> Result<Child>

Source

pub fn archive_context( &self, aeron: &Aeron, ) -> Result<AeronArchiveContext, AeronCError>

An archive context on aeron with this archive’s control request, control response and recording events channels.

§Errors

Returns the Aeron error if the context cannot be created or rejects a setting.

Source

pub fn archive_connect(&self) -> Result<(AeronArchive, Aeron), Error>

Source

pub fn start( aeron_dir: &str, archive_dir: &str, control_request_channel: &str, control_response_channel: &str, recording_events_channel: &str, ) -> Result<Self>

Starts an Archive Media Driver using the existing Aeron jars.

Removes and recreates aeron_dir and archive_dir before launching Java. Requires jars under aeron/aeron-all/build/libs in CARGO_MANIFEST_DIR. The returned guard stops the process and removes its directories on drop. See Self::build_and_start for the channel parameters.

§Errors

Returns an error if directory setup, jar discovery or Java startup fails.

§Example
use rusteron_archive::testing::EmbeddedArchiveMediaDriverProcess;
let driver = EmbeddedArchiveMediaDriverProcess::start(
    "/tmp/aeron-dir",
    "/tmp/archive-dir",
    "aeron:udp?endpoint=localhost:8010",
    "aeron:udp?endpoint=localhost:8011",
    "aeron:udp?endpoint=localhost:8012",
).expect("Failed to start Aeron Archive Media Driver");
Source

pub fn kill_all_java_processes() -> Result<ExitStatus>

Stops only archive Java children launched by this process, never unrelated JVMs.

Trait Implementations§

Source§

impl Drop for EmbeddedArchiveMediaDriverProcess

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.