Guide for Persistence

Store Repository Profiling (SRP)

To aid the users in operating and maintaining their Persistent Store deployment, Informatica provides an API that will read Store cache and state files and return useful information about them, including message content. This is the Store Repository Profiling (SRP) API. (The API is not in the normal "lbm" library; see Using the SRP API.)

Also supplied is the "umesnaprepo" example program, which uses the SRP API to read the information and print to standard out. It can be used as-is (see umesnaprepo Man Page), or its source code (Example umesnaprepo.c) can be used as a guide for users to develop their own management tools.

This API and example program are supported on the same platforms that support the Persistent Store: 64-bit Linux and 64-bit Windows. The API is C-only (no Java or .NET). Also be aware that the API is read-only. The API does not provide a way to modify the cache or state files.

IMPORTANT: due to differences in certain Windows and Linux data sizes, a given set of state and cache files needs to be read on the same platform where it was generated. For example it is NOT valid to copy a Linux Store's files to a Windows machine and use the windows-based SRP API or command-line tool to read them.

Note
  The Store instance should NOT be running while the API or example program is used to read the Store files. There currently is no tool that performs the same function on an actively running Store.

# Using the SRP API <-

Use the Example umesnaprepo.c source code as your guide.

The umeprofile.h header file contains the needed definitions.

The API code is not contained within the normal "lbm" library. On Linux, it is in "libumestorelib.a", a static library. On Windows, it is in "umestore.dll", a dynamic library.

The main API functions are:

- lbm_srp_create()
- lbm_srp_delete()
- lbm_srp_get_repo_state()
- lbm_srp_free_repo_state()
- lbm_srp_get_repo_message()

# umesnaprepo Man Page <-

The "umesnaprepo" command is an example program that uses the Store Repository Profiling (SRP) API to read Store state and cache files and print useful information, including message content. It can be used as-is, or its source code (Example umesnaprepo.c) can be used as a guide for users to develop their own management tools.

Note
  The Store instance should NOT be running while the API or example program is used to read the Store files. There currently is no tool that performs the same function on an actively running Store.

    Usage: umesnaprepo -s state_dir [options]
    Available options:
      -c, --cache-dir=PATH     cache file search PATH
      -h, --help               display this help and exit
      -n, --no-checksum        disable cache checksum checking
      -p, --parse              enable LBM header parsing
      -s, --state-dir=PATH     state file search PATH [required]
      -t, --truncate=NUM       limit cache message displays to NUM bytes
      -T, --terse              summarize cache and skip cache message displays

For example:

    umesnaprepo -s /UM/store5/state -c /UM/store5/cache

This examines the state and cache files and prints information for every Store instance represented there. Here's some example output:

    Examining repository at index: 0
    state_filename: /UM/store5/state/2545027182-state
    cache_filename: /UM/store5/cache/2545027182-cache
    ...
    Repository cache:
        number of messages: 26
    ...
    Receiver 0
        regid: 2545027183
        sqn: 25
    ...
    Message sqn [0]:
       tsp: 1584022054.898262
       disk_len: 37
       disk_offset: 0
       flags: 0x01
    Message body:
    00 00 00 25 a4 ab 82 e6 00 00 00 00 6d 65 73 73         ...%........mess
    61 67 65 20 30 00 00 00 00 00 00 00 00 00 00 00         age 0...........
    00 00 00 00 00                                          .....
    ...

In this example output, notice that the actual beginning of the message (the first byte is the "m" of "message 0") is at offset 12 from the beginning of the buffer. The 12 bytes in front of the message is the "LBMC" header. The example application lets you supply the "-T" option, which parses the LBMC header and starts printing the message at the actual start of data.