reahl.ptongue.gemstonecontrol module
GemStone server process control
This module provides classes for managing GemStone/S 64 Bit database server processes and installations. It includes functionality to start and stop the Stone repository monitor and NetLDI network service, as well as to configure the environment for GemStone operations.
The programmatic control offered here is useful for automated testing, application deployment, and system administration tasks.
- class reahl.ptongue.gemstonecontrol.GemstoneInstallation(install_directory, version)[source]
Bases:
object
Represents a GemStone installation on the filesystem.
This class provides utilities for working with a specific GemStone installation, including environment setup and version information.
- Parameters:
install_directory – Path to the GemStone installation directory
version – Version of the GemStone installation
- classmethod from_install_directory(gemstone)[source]
Create a GemstoneInstallation instance from an installation directory path.
Parses the version from the directory name and creates a new installation instance with the appropriate parameters.
- Parameters:
gemstone – Path to the GemStone installation directory
- Returns:
A new GemstoneInstallation instance
- Raises:
AssertionError – If the version cannot be parsed from the directory path
- property environ
Get environment variables needed for the GemStone installation.
- Returns:
Dictionary of environment variables with PATH and GEMSTONE set
- environment_setup()[source]
Context manager for temporarily setting GemStone environment variables.
Sets up the environment with the correct PATH and GEMSTONE variables for running GemStone commands, then restores the original environment when done.
- Usage:
- with gemstone_installation.environment_setup():
# Run GemStone commands here
- class reahl.ptongue.gemstonecontrol.GemstoneService(service_name, start_command, stop_command, start_args=[], stop_args=[], start_output_check='', stop_output_check='', gemstone_installation=None)[source]
Bases:
object
Manages a GemStone service process.
Provides functionality to start, stop, and monitor GemStone services such as Stone, NetLDI, and other server processes.
- Parameters:
service_name – Name of the service (e.g., ‘stone’, ‘netldi’)
start_command – Command to start the service
stop_command – Command to stop the service
start_args – Arguments for the start command
stop_args – Arguments for the stop command
start_output_check – String to verify in output when starting
stop_output_check – String to verify in output when stopping
gemstone_installation – GemstoneInstallation instance or None to use default
- start()[source]
Start the GemStone service.
Sets up the GemStone environment, executes the start command with appropriate arguments, and verifies the output contains expected messages.
- Raises:
AssertionError – If service is already running or start fails
- stop()[source]
Stop the GemStone service.
Sets up the GemStone environment, executes the stop command with appropriate arguments, and verifies the output contains expected messages.
- Raises:
AssertionError – If stop fails or expected output is not found
- class reahl.ptongue.gemstonecontrol.NetLDI(guest_mode=True, gemstone_installation=None)[source]
Bases:
GemstoneService
Manages a GemStone NetLDI (Network Long Distance Information) service.
The NetLDI service is responsible for starting GemStone Gem processes on behalf of client applications.
- Parameters:
guest_mode – If True, start NetLDI with guest mode enabled (-g flag)
gemstone_installation – GemstoneInstallation instance or None to use default
- class reahl.ptongue.gemstonecontrol.Stone(gemstone_installation=None)[source]
Bases:
GemstoneService
Manages a GemStone Stone (repository monitor) service.
The Stone process is the main database server that manages the repository and coordinates access to the database.
Creates a Stone service for the default stone ‘gs64stone’ using standard DataCurator credentials.
- Parameters:
gemstone_installation – GemstoneInstallation instance or None to use default