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: StringImplementations§
Source§impl EmbeddedArchiveMediaDriverProcess
impl EmbeddedArchiveMediaDriverProcess
Sourcepub fn build_and_start(
aeron_dir: &str,
archive_dir: &str,
control_request_channel: &str,
control_response_channel: &str,
recording_events_channel: &str,
) -> Result<Self>
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");pub fn run_aeron_stats(&self) -> Result<Child>
Sourcepub fn archive_context(
&self,
aeron: &Aeron,
) -> Result<AeronArchiveContext, AeronCError>
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.
pub fn archive_connect(&self) -> Result<(AeronArchive, Aeron), Error>
Sourcepub fn start(
aeron_dir: &str,
archive_dir: &str,
control_request_channel: &str,
control_response_channel: &str,
recording_events_channel: &str,
) -> Result<Self>
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");Sourcepub fn kill_all_java_processes() -> Result<ExitStatus>
pub fn kill_all_java_processes() -> Result<ExitStatus>
Stops only archive Java children launched by this process, never unrelated JVMs.