ObjectStore C++ API Reference

os_dbutil

The database utility API provides C++ functions corresponding to the utilities documented in ObjectStore Management. You can use them as a basis for your own database utilities and tools.

All the functions in this facility are members of the class os_dbutil. Call the following function before using any other members of os_dbutil:

      static void os_dbutil::initialize();
You only need to call this function once in each application.

os_dbutil::chgrp()

static void chgrp(
      const char *pathname, 
      const char *gname
);
Changes the primary group of the rawfs directory or database whose name is pathname. gname is the name of the new group.This function does not check for transaction consistency.

See oschgrp in ObjectStore Management.

os_dbutil::chmod()

static void chmod(
      const char *pathname, 
      const os_unsigned_int32 mode
);
Changes the protections on the rawfs database or directory whose name is pathname. mode specifies the new protections. This function does not check for transaction consistency

See oschmod in ObjectStore Management.

os_dbutil::chown()

static void chown(
      const char *pathname, 
      const char *uname
);
Changes the owner of the rawfs directory or database whose name is pathname. uname is the user name of the new owner. This function does not check for transaction consistency

See oschown in ObjectStore Management.

See Chapter 10, Database Utility API, in ObjectStore Advanced C++ API User Guide.

os_dbutil::close_all_server_connections()

static void close_all_server_connections();
Closes all connections the application has to ObjectStore Servers.

os_dbutil::close_server_connection()

static void close_server_connection(const char *hostname);
Closes the connection the application has to the ObjectStore Server running on the machine named hostname.

os_dbutil::cmgr_remove_file()

static char *cmgr_remove_file(
      const char *hostname, 
      os_int32 cm_version_number
);
Makes the Cache Manager on the machine with the specified hostname delete all the cache and commseg files that are not in use by any client. The argument cm_version_number must match the Cache Manager's version number. Returns a pointer to the result message string.

See oscmrf in ObjectStore Management.

os_dbutil::cmgr_shutdown()

static char *cmgr_shutdown(
      const char *hostname, 
      os_int32 cm_version_number
); 
Shuts down the Cache Manager running on the machine with the specified hostname. The argument cm_version_number must match the Cache Manager's version number. Returns a pointer to the result message string.

See oscmshtd in ObjectStore Management.

os_dbutil::cmgr_stat()

static void cmgr_stat(
      const char *hostname, 
      os_int32 cm_version_number,
      os_cmgr_stat *cmstat_data
); 
Gets information for the Cache Manager on the machine with the specified hostname. The argument cm_version_number must match the Cache Manager's version number.

os_cmgr_stat public data members
cmstat_data points to an instance of os_cmgr_stat allocated by the caller, using the no-argument constructor. os_cmgr_stat has the following public data members:
os_unsigned_int32struct_version;
os_unsigned_int32major_version;
os_unsigned_int32minor_version;
os_unsigned_int32pid;
char*executable_name;
char*host_name;
os_unixtime_tstart_time;
os_int32soft_limit;
os_int32hard_limit;
os_int32free_allocated;
os_int32used_allocated;
os_int32n_clients;
os_cmgr_stat_client*per_client; /* array */
os_int32n_servers;
os_cmgr_stat_svr*per_server; /* array */
os_int32n_cache_file_usage;
os_cmgr_stat_file_usage*cache_file_usage; /* array */
os_int32n_comseg_file_usage;
os_cmgr_stat_file_usage*comseg_file_usage; /* array */
char*cback_queue;
char*extra;

The constructor sets struct_version to the value of os_free_blocks_version in the dbutil.hh file included by your application. If this version is different from that used by the library, err_misc is signaled. The constructor initializes all other members to 0.

Within the results returned by os_dbutil::cmgr_stat, the information about each client is provided in an object of class os_cmgr_stat_client. A data member has been added to class os_cmgr_stat_client, named notification, whose type is os_cmgr_stat_notification*.

The value of this pointer is zero if the version of the Cache Manager does not support notifications (for example, precedes ObjectStore Release 4.0.2), or if this client is not using notifications because, for example, the client has not yet called os_notification::subscribe or os_notification::_get_fd.

Otherwise, the value is a pointer to an object of the class os_cmgr_stat_notification.

os_cmgr_stat_client public data members
os_cmgr_stat_client has the following public data members:
os_unsigned_int32struct_version;
os_unsigned_int32queue_size;
os_unsigned_int32n_queued;
os_unsigned_int32n_received;
os_unsigned_int32queue_overflows;
os_unsigned_int32thread_state;
os_int32pid;
os_unsigned_int32euid;
char*name;
os_int32major_version;
os_int32minor_version;
os_int32commseg;

os_cmgr_stat_svr public data members
os_cmgr_stat_svr has the following public data members:
os_unsigned_int32struct_version;
char*host_name;
os_int32client_pid;
char*status_str;

os_cmgr_stat_file_usage public data members
os_cmgr_stat_file_usage has the following public data members:
os_unsigned_int32struct_version;
char*file_name;
os_unsigned_int32file_length;
os_booleanis_free;

See oscmstat in ObjectStore Management for additional information.

os_dbutil::compare_schemas()

static os_boolean compare_schemas(
      const os_database* db1,
      const os_database* db2,
      os_boolean verbose = 1
);
Compares the schemas of db1 and db2. Returns nonzero if the schemas are incompatible, 0 otherwise. Each database can contain an application schema, a compilation schema, or a database schema. If the database contains a database schema, it can be local or remote.

If verbose is nonzero, the function issues a message to the default output describing any incompatibility.

See osscheq in ObjectStore Management.

os_dbutil::copy_database()

static os_boolean copy_database(
      const char *src_database_name, 
      const char *dest_database_name
);
Copies the database named src_database_name and names the copy dest_database_name. No transaction can be in progress. The source database cannot be in use. If there is already a database named dest_database_name, it is silently overwritten. Returns 0 for success, 1 if per-segment access control information has been changed during copy (which can happen when copying a rawfs database to a file database, since file databases do not have separate segment-level protections).

See oscp in ObjectStore Management.

os_dbutil::disk_free()

static void disk_free(
      const char *hostname, 
      os_free_blocks *blocks
);
Gets disk space usage in the rawfs managed by the Server on the machine named hostname. blocks points to an instance of os_free_blocks allocated by the caller, using the zero-argument constructor.

os_free_blocks public data members
The class os_free_blocks has the following public data members:
os_unsigned_int32struct_version;
os_unsigned_int32free_blocks;
os_unsigned_int32file_system_size;
os_unsigned_int32used_blocks;

disk_free() sets the values of these data members for the instance of os_free_blocks pointed to by the argument blocks.

The os_free_blocks constructor sets struct_version to the value of os_free_blocks_version in the dbutil.hh file included by your application. If this version is different from that used by the library, err_misc is signaled.

See osdf in ObjectStore Management.

os_dbutil::expand_global()

static os_char_p *expand_global(
      char const *glob_path, 
      os_unsigned_int32 &n_entries
);
Returns an array of pointers to rawfs pathnames matching glob_path by expanding glob_path's wildcards (*, ?, {}, and []). n_entries is set to refer to the number of pathnames returned. It is the caller's responsibility to delete the array and pathnames when they are no longer needed.

See osglob in ObjectStore Management.

os_dbutil::get_client_name()

static char const* get_client_name();
Returns the pointer last passed to set_client_name(). If there was no prior call to set_client_name(), 0 is returned. This function does not allocate any memory.

os_dbutil::get_sector_size()

static os_unsigned_int32 get_sector_size();
Returns 512, the size of a sector in bytes. Certain ObjectStore utilities report some of their results in numbers of sectors, and some Server parameters are specified in sectors. See ObjectStore Management.

os_dbutil::initialize()

static void initialize();
Call this before using any other members of os_dbutil.

os_dbutil::list_directory()

static os_rawfs_entry_p *list_directory(
      const char *path, 
      os_unsigned_int32 &n_entries
); 
Lists the contents of the rawfs directory named path. Returns an array of pointers to os_rawfs_entry_p objects. n_entries is set to the number of elements in the returned array. If path does not specify the location of a directory, err_not_a_directory is signaled. It is the caller's responsibility to delete the array and os_rawfs_entry_p objects when they are no longer needed.

See osls in ObjectStore Management.

os_dbutil::make_link()

static void make_link(
      const char *target_name, 
      const char *link_name
);
Makes a rawfs soft link. target_name is the path pointed to by the link. link_name is the pathname of the link. Signals err_database_exists or err_directory_exists if link_name already points to an existing database or directory.

A rawfs can have symbolic links pointing within itself or to another Server's rawfs. The Server follows symbolic links within its rawfs for all os_dbutil members that pass pathname arguments, unless specified otherwise by a function's description; only os_dbutil::stat() can override this behavior. All members passing pathname arguments also follow cross-server links on the application side, unless specified otherwise by a function's description.

A rawfs symbolic link always has the ownership and the permissions of the parent directory.

See osln, rehost_link, and rehost_all_links in ObjectStore Management.

os_dbutil::mkdir()

static void mkdir(
      const char *path,
      const os_unsigned_int32 mode,
      os_boolean create_missing_dirs = 0
);
Makes a rawfs directory whose pathname is path. The new directory's protection is specified by mode. If create_missing_dirs is nonzero, creates the missing intermediate directories. Signals err_directory_not_found if create_missing_dirs is 0 and there are missing intermediate directories. Signals err_directory_exists if there is already a directory with the specified path. Signals err_database_exists if there is already a database with the specified path.

See osmkdir in ObjectStore Management.

os_dbutil::ossize()

static os_int32 ossize(
      const char *pathname,
      const os_size_options *options
);
Prints to standard output the size of the database whose name is pathname. options points to an instance of os_size_options allocated by the caller using the zero-argument constructor.

os_size_options public data members
os_size_options has the following public data members:
os_unsigned_int32struct_version;
os_booleanflag_all; /* -a */
os_booleanflag_segments; /* -c */
os_booleanflag_total_database; /* -C */
os_booleanflag_free_block_map; /* -f */
os_unsigned_int32one_segment_number; /* -n */
os_booleanflag_every_object; /* -o */
charflag_summary_order;
/* -s `s'=space `n'=number `t'=typename */
os_booleanflag_upgrade_rw; /* -u */
os_booleanflag_internal_segments; /* -0 */
os_booleanflag_access_control; /* -A */

Each member corresponds to an option for the utility ossize. See ossize in ObjectStore Management.

The constructor sets struct_version to the value of os_size_options_version in the dbutil.hh file included by your application. If this version is different from that used by the library, err_misc is signaled. The constructor initializes all other members to 0.

Returns 0 for success, -1 for failure.

If OS_ _DBUTIL_NO_MVCC is set, this function opens the database for read only, rather than for MVCC (the default).

os_dbutil::osverifydb()

static os_unsigned_int32 osverifydb(
      const char *dbname,
      os_verifydb_options* opt= 0
);
Prints to standard output all pointers and references in the database named dbname. opt points to an instance of os_verify_db_options allocated by the caller using the zero-argument constructor. You must have called os_collection::initialize() and os_mop::initialize() prior to calling this function.

If OS_ _DBUTIL_NO_MVCC is set, this function opens the database for read only, rather than MVCC (the default).

os_verify_db_options public data members
os_verify_db_options has the following public data members:
os_boolean verify_segment_zero; /* verify the schema segment */
os_boolean verify_collections; /* check all top-level collections */
os_boolean verify_pointer_verbose;/* print pointers as they are verified */
os_boolean verify_object_verbose;/* print objects as they are verified */
os_boolean verify_references; /* check all OS references */
os_int32 segment_error_limit; /* maximum errors per segment */
os_boolean print_tag_on_errors;/* print out the tag value on error */
const void* track_object_ptr; /* Track object identified by pointer */
const char* track_object_ref_string;/* Track the object identified by the reference string. */
enum { default_action, ask_action, null_action, } illegal_pointer_action;

Returns 0 for success, 1 for failure.

Upgrading databases created on 16K page size platforms
In releases prior to ObjectStore 5.1, there is a bug in our support of heterogeneous access to databases created on machines with a 16K page size: databases created on 16K page big-endian platforms cannot be accessed from small-endian platforms. Older databases might need to be upgraded. You can use the upgrade tool by means of the os_verifydb_options argument to the API os_dbutil::osverifydb() with os_verifydb_options::info_sector_tag_verify_opt set to the desired value:

class os_verifydb_options 
{ public: 
      ... 
      enum info_sector_tag_verify_opt_enum { 
            verify_skip = 0,                  /* do not verify info sector tag */ 
            verify_report_only = 1,      /* report only */ 
            verify_upgrade = 2,            /* upgrade info sector tag */ 
            verify_skip_others = 4       /* skip other verifications */ 
      } info_sector_tag_verify_opt ; 
      ... 
} 
Valid os_verifydb_options::info_sector_tag_verify_opt values are:

      verify_skip 
      verify_report_only 
      verify_upgrade 
      verify_report_only | verify_skip_others
      verify_upgrade | verify_skip_others 
See also, osverifydb in ObjectStore Management.

os_dbutil::osverifydb_one_segment()

static os_unsigned_int32 osverifydb_one_segment(
      const char *dbname,
      os_unsigned_int32 segment_number,
      os_unsigned_int32 starting_offset = 0,
      os_unsigned_int32 ending_offset = 0,
      os_verifydb_options *opt = 0
);
Prints to standard output all pointers and references in segment segment_number in the database named dbname. The offset items specify the starting and ending offsets (in bytes) within the segment where verification is done. If starting_offset is not specified, it defaults to 0. This means verification starts at the beginning of the segment. Similarly, If ending_offset is not specified, it defaults to 0. This means verify to the end of the segment. opt points to an instance of os_verify_db_options allocated by the caller using the zero-argument constructor.

os_verify_db_options public data members
os_verify_db_options has the following public data members:
os_boolean verify_segment_zero;/* verify the schema segment */
os_boolean verify_collections; /* check all top-level collections */
os_boolean verify_pointer_verbose/* print pointers as they are verified */
os_boolean verify_object_verbose/* print objects as they are verified */
os_boolean verify_references;/* check all OS references */
os_int32 segment_error_limit/* maximum errors per segment */
os_boolean print_tag_on_errors /* print out the tag value on error */
const void* track_object_ptr/* Track object identified by pointer */
const char* track_object_ref_string/* Track the object identified by the
reference string. */
enum { default_action, ask_action, null_action,}illegal_pointer_action;

Returns 0 for success, 1 for failure. You must have called os_collection::initialize() and os_mop::initialize() prior to calling this function. If OS__DBUTIL_NO_MVCC is set, this function opens the database for read only, rather than MVCC (the default).

See osverifydb in ObjectStore Management.

os_dbutil::osprmgc()

struct os_prmgc_options {
      os_boolean flag_quiet; // -q, default is false
      os_boolean flag_read_only; // -r, default is false
      os_boolean flag_one_segment; // -n, default is false
      os_unsigned_int32 one_segment_number; // the N in -n N
      os_prmgc_type prmgc_type; //-t default is remove_whole_ranges
};
This is particularly useful for databases with discriminant unions.

Discriminant union considerations
If you have a database with discriminant unions, you must perform PRM garbage collection using os_dbutil::osprmgc, and link in the necessary discriminant functions.

Both the command-line and embedded versions of the utility use
a streaming fetch policy. The embedded version ensures that the
policy is restored to its original state (if different) to minimize impact on the application. See
osprmgc: Trimming Persistent Relocation Maps in ObjectStore Management for further detail.

os_dbutil::rehost_all_links()

static void rehost_all_links(
      const char *server_host, 
      const char *old_host,
      const char *new_host
);
Changes the hosts of specified rawfs links. server_host specifies the host containing the links to be changed. All links pointing to old_host are changed to point to new_host. On some operating systems, you must have special privileges to use this function.

See oschhost in ObjectStore Management.

os_dbutil::rehost_link()

static void rehost_link(
      const char *pathname, 
      const char *new_host
);
Changes the host to which a rawfs link points. pathname must specify a symbolic link, otherwise err_not_a_link is signaled. new_host specifies the new Server host.

See oschhost in ObjectStore Management.

os_dbutil::remove()

static void remove(char const *path);
Removes the database or rawfs link with the specified name. If path names a link, the link is removed but the target of the link is not. If path names a directory, it is not removed. Signals err_not_a_database if path exists in a rawfs but is not a database. Signals err_file_error when a problem is reported by the Server host's file system. Signals err_file_not_local if the file is not local to this Server.

See osrm in ObjectStore Management.

os_dbutil::rename()

static void rename(
      const char *source, 
      const char *target
);
Renames the rawfs database or directory. source is the old name and target is the new name. Signals err_cross_server_rename if source and target are on different Servers. Signals err_invalid_rename if the operation makes a directory its own descendent. Signals err_database_exists if a database named target already exists. Signals err_directory_exists if a directory named target already exists.

See osmv in ObjectStore Management.

os_dbutil::rmdir()

static void rmdir(const char *path);
Removes the rawfs directory with the specified pathname. Signals err_directory_not_empty if the directory still contains databases. Signals err_not_a_directory if the argument does not specify a directory path.

See osrmdir in ObjectStore Management.

os_dbutil::set_application_schema_path()

static char *set_application_schema_path(
      const char *executable_pathname,
      const char *database_pathname
);
Finds or sets an executable's application schema database. executable_pathname specifies the executable. database_pathname is either the new schema's pathname or 0. If database_pathname is 0, the function returns new storage containing the current pathname. If database_pathname is nonzero, the function returns 0.

See ossetasp in ObjectStore Management.

os_dbutil::set_client_name()

static void set_client_name(const char *name);
Sets the client name string for message printing.

os_dbutil::stat()

static os_rawfs_entry *stat(
      const char *path,
      const os_boolean b_chase_links = 1
);
Gets information about a rawfs pathname. If b_chase_links is false and the path is a link, the Server does not follow it. The Server still follows intrarawfs links for the intermediate parts of the path.

Returns a pointer to an os_rawfs_entry to be destroyed by the caller, or 0 on error.

See ostest and osls in ObjectStore Management.

os_dbutil::svr_checkpoint()

static os_boolean svr_checkpoint(
      const char *hostname
); 
Makes the specified Server take a checkpoint asynchronously. Returns nonzero when successful, 0 or an exception on failure.

See ossvrchkpt in ObjectStore Management.

os_dbutil::svr_client_kill()

static os_boolean svr_client_kill(
      const char *server_host,
      os_int32 client_pid, 
      const char *client_name, 
      const char *client_hostname,
      os_boolean all, 
      os_int32 &status
);
Kills one or all clients of the specified Server. hostname is the name of the machine running the Server.

client_pid is the process ID of the client to kill. client_name is the name of the client to kill. client_hostname is the name of the machine running the client to kill.

If all is 1, the other arguments except server_host are ignored, and all clients on the specified Server are killed.

status is set to -2 if a client was killed, 0 if no clients matched the specifications, 2 if multiple clients matched the specification. Any other value means that access was denied.

Returns 0 for failure and nonzero for success.

See ossvrclntkill in ObjectStore Management.

os_dbutil::svr_ping()

static char *svr_ping(
      const char *server_host,
      os_svr_ping_state &state
); 
Determines whether an ObjectStore Server is running on the machine named server_host. The referent of state is set to one of the following global enumerators:

Returns a pointer to the status message string.

Failover servers
os_dbutil::svr_ping() returns the enumerator os_svr_ping_is_alive_as_failover_backup if it is possible that the Server is running in backup failover mode. The heuristic for determining if it possibly is running in backup mode is if the exception err_broken_connection is raised while pinging a Server and the current locator file indicates that the Server is a member of a failover pair.

See ossvrping in ObjectStore Management.

os_dbutil::svr_shutdown()

static os_boolean svr_shutdown(
      const char *server_host
); 
Shuts down the Server on the machine named server_host. Returns nonzero for success, 0 otherwise. On some operating systems, you must have special privileges to use this function.

See ossvrshtd in ObjectStore Management.

os_dbutil::svr_stat()

static void svr_stat(
      const char *server_host, 
      os_unsigned_int32 request_bits, 
      os_svr_stat *svrstat_data
);
Gets statistics for a Server's clients on server_host.

request_bits specifies what information is desired. Supply this argument by forming the bit-wise disjunction of zero or more of the following enumerators:

For each enumerator that is specified, the corresponding information is retrieved.

For each of the classes described below, the constructor sets struct_version to the value of os_free_blocks_version in the dbutil.hh file included by your application. If this version is different from that used by the library, err_misc is signaled. The constructor initializes all other members to 0.

      os_dbutil::svr_stat(db->get_host_name(),
          os_svr_stat::get_svr_meter_samples,                        &svrstat) 
         n_sent = svrstat.svr_meter_samples->n_notifies_sent;
     n_received = svrstat.svr_meter_samples->n_notifies_ received;
svrstat_data public data members
svrstat_data points to an instance of os_svr_stat allocated by the caller, using the zero-argument constructor. This structure has the following public data members:
os_unsigned_int32struct_version;
os_svr_stat_svr_headerheader;
os_svr_stat_svr_parameters*svr_parameters;
os_svr_stat_svr_rusage*svr_rusage;
os_svr_stat_svr_meters*svr_meter_samples;
os_unsigned_int32n_meter_samples;
os_svr_stat_client_info*client_info_self;
os_svr_stat_client_info*client_info_others;
os_unsigned_int32n_clients;

Set the pointer-valued members to point to classes you allocate using zero-argument constructors.

os_svr_stat_svr_header public data members
os_svr_stat_svr_header has the following public data members:
os_unsigned_int32struct_version;
char*os_release_name;
os_unsigned_int32server_major_version;
os_unsigned_int32server_minor_version;
char*compilation;

os_svr_stat_svr_parameters public data members
os_svr_stat_svr_parameters has the following public data members:
os_unsigned_int32struct_version;
char*parameter_file;
os_booleanallow_shared_mem_usage;
os_int32*authentication_list;
os_unsigned_int32n_authentications;
os_int32RAWFS_db_expiration_time;
os_int32deadlock_strategy;
os_unsigned_int32direct_to_segment_threshold;
char*log_path;
os_unsigned_int32current_log_size_sectors;
os_unsigned_int32initial_log_data_sectors;
os_unsigned_int32growth_log_data_sectors;
os_unsigned_int32log_buffer_sectors;
os_unsigned_int32initial_log_record_sectors;
os_unsigned_int32growth_log_record_sectors;
os_unsigned_int32max_data_propagation_threshold;
os_unsigned_int32max_propagation_sectors;
os_unsigned_int32max_msg_buffer_sectors;
os_unsigned_int32max_msg_buffers;
os_unsigned_int32sleep_time_between_2p_outcomes;
os_unsigned_int32sleep_time_between_propagates;
os_unsigned_int32write_buffer_sectors;
os_unsigned_int32tcp_recv_buffer_size;
os_unsigned_int32tcp_send_buffer_size;
os_booleanallow_nfs_locks;
os_booleanallow_remote_database_access;
os_unsigned_int32max_two_phase_delay;
os_unsigned_int32max_aio_threads;
os_unsigned_int32cache_mgr_ping_time;
os_unsigned_int32max_memory_usage;
os_unsigned_int32max_connect_memory_usage;
os_unsigned_int32remote_db_grow_reserve
os_booleanallow_estale_to corrupt-DBs
os_int32restricted_file_db_access_only
os_unsigned_int32failover_heartbeat_time

os_svr_stat_svr_rusage public data members
os_svr_stat_svr_rusage has the following public data members:
os_unsigned_int32os_timesecs ru_utime;os_timesecs ru_stime;struct_version;
/* user time used */
/* system time used */
os_int32ru_maxrss;/* maximum resident set size */
os_int32ru_ixrss;/* integral shared memory size */
os_int32ru_idrss;/* integral unshared data size */
os_int32ru_isrss;/* integral unshared stack size */
os_int32ru_minflt;/* page reclaims */
os_int32ru_majflt;/* page faults */
os_int32ru_nswap;/* swaps */
os_int32ru_inblock;/* block input operations */
os_int32ru_oublock;/* block output operations */
os_int32ru_msgsnd;/* messages sent */
os_int32ru_msgrcv;/* messages received */
os_int32ru_nsignals;/* signals received */
os_int32ru_nvcsw;/* voluntary context switches */
os_int32ru_nivcsw;/* involuntary context switches */

The classes os_svr_stat_svr_meters and os_svr_stat_client_meters each have data members named n_notifies_sent and n_notifies_received. All four are of type os_unsigned_int32. They give the total number of notifications that have been received by the Server, and the number that have been sent by the Server, giving the total for the Server as a whole, and the total for each client.

os_svr_stat_svr_meters public data members
os_svr_stat_svr_meters has the following public data members:
os_unsigned_int32struct_version;
os_booleanvalid;
os_unsigned_int32n_minutes;
os_unsigned_int32n_receive_msgs;
os_unsigned_int32n_callback_msgs;
os_unsigned_int32n_callback_sectors_requested;
os_unsigned_int32n_callback_sectors_succeeded;
os_unsigned_int32n_sectors_read;
os_unsigned_int32n_sectors_written;
os_unsigned_int32n_commit;
os_unsigned_int32n_phase_2_commit;
os_unsigned_int32n_readonly_commit;
os_unsigned_int32n_abort;
os_unsigned_int32n_phase_2_abort;
os_unsigned_int32n_deadlocks;
os_unsigned_int32n_msg_buffer_waits;
os_unsigned_int32n_log_records;
os_unsigned_int32n_log_seg_switches;
os_unsigned_int32n_flush_log_data_writes;
os_unsigned_int32n_flush_log_record_writes;
os_unsigned_int32n_log_data_writes;
os_unsigned_int32n_log_record_writes;
os_unsigned_int32n_sectors_propagated;
os_unsigned_int32n_sectors_direct;
os_unsigned_int32n_do_some_propagation;
os_unsigned_int32n_notifies_sent
os_unsigned_int32n_notifies_received
os_unsigned_int32n_lock_waits
os_unsigned_int32total_lock_wait_times

os_svr_stat_client_info public data members
os_svr_stat_client_info has the following public data members:
os_unsigned_int32struct_version;
os_svr_stat_client_process*process;
os_svr_stat_client_state*state;
os_svr_stat_client_meters*meters;

Set the pointer-valued members to point to classes you allocate using zero-argument constructors.

os_svr_stat_client_process public data members
os_svr_stat_client_process has the following public data members:
os_unsigned_int32struct_version;
char*host_name;
os_unsigned_int32process_id;
char*client_name;
os_unsigned_int32client_id;

os_svr_stat_client_state public data members
os_svr_stat_client_state has the following public data members:
os_unsigned_int32struct_version;
os_client_state_typeclient_state;
char*message_name;
os_booleantxn_in_progress;
os_unsigned_int32txn_priority;
os_unsigned_int32txn_duration;
os_unsigned_int32txn_work;
os_client_lock_typelock_state;
os_unsigned_int32db_id;
char*db_pathname;
os_unsigned_int32locked_seg_id;
os_unsigned_int32locking_start_sector;
os_unsigned_int32locking_for_n_sectors;
os_unsigned_int32n_conflicts;
os_svr_stat_client_process*lock_conflicts;
enum os_client_lock_type { OSSVRSTAT_CLIENT_LOCK_TO_MAX_BLOCKS, OSSVRSTAT_CLIENT_LOCK_TO_NBLOCKS,};
enum os_client_state_type { OSSVRSTAT_CLIENT_WAITING_MESSAGE, OSSVRSTAT_CLIENT_EXECUTING_MESSAGE, OSSVRSTAT_CLIENT_WAITING_RANGE_READ_LOCK, OSSVRSTAT_CLIENT_WAITING_RANGE_WRITE_LOCK, OSSVRSTAT_CLIENT_WAITING_SEGMENT_WRITE_LOCK, OSSVRSTAT_CLIENT_DEAD, OSSVRSTAT_CLIENT_WAITING_SEGMENT_READ_LOCK, OSSVRSTAT_CLIENT_WAITING_DB_READ_LOCK, OSSVRSTAT_CLIENT_WAITING_DB_WRITE_LOCK,};

Data in locking_start_sector and locking_for_n_sectors is valid only when lock_state is OSSVRSTAT_CLIENT_STATE_WAITING_RANGE_READ_LOCK or OSSVRSTAT_CLIENT_STATE_WAITING_RANGE_WRITE_LOCK.

os_svr_stat_client_meters public data members
os_svr_stat_client_meters has the following public data members:
os_unsigned_int32struct_version;
os_unsigned_int32n_receive_msgs;
os_unsigned_int32n_callback_msgs;
os_unsigned_int32n_callback_sectors_requested;
os_unsigned_int32n_callback_sectors_succeeded;
os_unsigned_int32n_sectors_read;
os_unsigned_int32n_sectors_written;
os_unsigned_int32n_deadlocks;
os_unsigned_int32n_lock_timeouts;
os_unsigned_int32n_commit;
os_unsigned_int32n_phase_2_commit;
os_unsigned_int32n_readonly_commit;
os_unsigned_int32n_abort;
os_unsigned_int32n_phase_2_abort;
os_unsigned_int32n_notifies_sent
os_unsigned_int32n_notifies_received

See ossvrstat and ossvrmtr in ObjectStore Management.



[previous] [next]

Copyright © 1997 Object Design, Inc. All rights reserved.

Updated: 03/31/98 17:25:09