Interface to ASP Checkpointing Service functionality User would create a Table object on which he can do read and write.
More...
Interface to ASP Checkpointing Service functionality User would create a Table object on which he can do read and write.
Constructor function for the Table class.
It creats a new checkpoint with the given parameters.
- Parameters
-
name | Name of the table/checkpoint to be created |
flagsp | This parameter indicates the type of checkpoint to be created. The supported values are: SA_CKPT_WR_ALL_REPLICAS, SA_CKPT_WR_ACTIVE_REPLICA, SA_CKPT_WR_ACTIVE_REPLICA_WEAK, SA_CKPT_CHECKPOINT_COLLOCATED. The meaning of these flags are as below: |
SA_CKPT_WR_ALL_REPLICAS - Creates a checkpoint with synchronous update option SA_CKPT_WR_ACTIVE_REPLICA - Creates a checkpoint with the asynchronous update option and providing atomicity when updating the replicas SA_CKPT_WR_ACTIVE_REPLICA_WEAK - Creates a checkpoint with the asynchronous update option but there is no guarantee of atomicity with updating the replicas. SA_CKPT_CHECKPOINT_COLLOCATED - If this flag is specified at the creation time, there is no active replica created until user explicitly sets an Active replica for the checkpoint.
For more details about these flags and their usage, refer to SAF Checkpoint Service specification.
- Parameters
-
retentionMs | Retention time indicates that any checkpoint that is inactive for this duration will automatically deleted by the checkpoint service |
maxSections | Maximum number of checkpoints for this checkpoint |
maxSectionSizeBytes | Maximum size of each section |
maxSectionIdSizeBytes | Maximum length of the section identifier. |
def aspCheckpoint.Table.Activate |
( |
|
self | ) |
|
Set the active replica for the asynchronous checkpoints.
def aspCheckpoint.Table.Delete |
( |
|
self, |
|
|
|
key |
|
) |
| |
Delete the section of the checkpointed denoted by given key.
- Parameters
-
key | String identifier for the checkpoint section |
def aspCheckpoint.Table.ErrorHandler |
( |
|
self, |
|
|
|
s, |
|
|
|
e |
|
) |
| |
Function to handle the common error codes returned by ASP functions.
- Parameters
-
s | String description for the exception |
e | Exception caught from invoking the ASP APIs |
def aspCheckpoint.Table.GetActiveStatus |
( |
|
self | ) |
|
Get the active status of the checkpoint.
- Returns
- Returns the boolean value indicating the status of the checkpoint
def aspCheckpoint.Table.Read |
( |
|
self, |
|
|
|
keys |
|
) |
| |
Read the checkpoint for the given section ids.
- Parameters
-
keys | A list of section ids or keys |
- Returns
- data Returns the data stored in the given sections
def aspCheckpoint.Table.SetAutoActivate |
( |
|
self, |
|
|
|
val = True |
|
) |
| |
Set the global value of autoActivate to given value.
Default being True When autoActivate is set to True, the library will take care of setting the Active repliaca for the asynchronous checkpoints. Otherwise, user will have to explicitly activate the replica using Activate() function.
- Parameters
-
val | Boolean value indicate whether to enable auto activate or not |
Synchronize checkpoint replicas.
- Parameters
-
timeout | Timeout to wait for the completion of the update from the checkpoint service |
def aspCheckpoint.Table.Write |
( |
|
self, |
|
|
|
keyOrContainer, |
|
|
|
data = None |
|
) |
| |
Write data into the table.
There are several ways to call this functions: Write("rowname","data"): Writes the value "data" into the row named "rowname" (will TRUNCATE the existing record if new record is shorter) Write([("rowname","data"),("rowname2","data2")]): List of tuples format (will NOT truncate the existing record) Write({"rowname":"data","rowname2":"data2"}): Dictionary format (will NOT truncate)
- Parameters
-
keyOrContainer | Either a string, in which case this is interpreted as the row (section) identifier, and "data" will be the data to write OR a container of key/data pairs (see the function discription for formats) |
data | This is the data to write into the row if key is a string, otherwise this is NOT USED. |
aspCheckpoint.Table.autoActivate |
aspCheckpoint.Table.ckptHdl |
aspCheckpoint.Table.ckptName |
aspCheckpoint.Table.flags |
aspCheckpoint.Table.maxSectionIdSizeBytes |
aspCheckpoint.Table.maxSections |
aspCheckpoint.Table.maxSectionSizeBytes |
aspCheckpoint.Table.retentionMs |
aspCheckpoint.Table.sectionExpiration |
aspCheckpoint.Table.svcHdl |
aspCheckpoint.Table.tryAgainDelayMs |