You can enable write-behind support with the ObjectGrid descriptor XML file or programmatically with the BackingMap interface.
Use either the ObjectGrid descriptor XML file to enable write-behind support, or programmatically by using the BackingMap interface.
<objectGrid name="library" >
<backingMap name="book" writeBehind="T300;C900" pluginCollectionRef="bookPlugins"/>
In the previous example, write-behind support of the book backing map is enabled with parameter T300;C900. The write-behind attribute specifies the maximum update time, maximum key update count, or both. The format of the write-behind parameter is:
write-behind attribute ::=<defaults> | <update time> | <update key count> | <update time> ";" <update key count>
update time ::= "T" <positive integer>
update key count ::= "C" <positive integer>
defaults ::= "" {table}
These parameters are only hints. The real update count and update time will be within close range of the parameters. However, we do not guarantee that the actual update count or update time are the same as defined in the parameters. Also, to prevent all partitions from accessing the database simultaneously, the ObjectGrid randomizes the update starting time. For example, the first update can occur after up to twice as long as the real update time.
In the previous example T300;C900, the loader writes the data to the back-end when 300 seconds have passed since the last update or when 900 keys are pending to be updated. The default update time is 300 seconds and the default update key count is 1000.
Attribute value | Time |
T100 | The update time is 100 seconds, and the update key count is 1000 (the default value) |
C2000 | The update time is 300 seconds (the default value), and the update key count is 2000. |
T300;C900 | The update time is 300 seconds and the update key count is 900. The loader receives upsert LogElement operations instead of insert and update operations. |
"" | The update time is 300 second (the
default value), and the update key count is 1000 (the default value). Note: If you configure the write-behind loader as an empty string: writeBehind="", the write-behind loader is enabled with
the default values. Therefore, do not specify the writeBehind attribute
if you do not want write-behind support enabled.
|
When you are creating a backing map programmatically for a local, in-memory eXtreme Scale, you can use the following method on the BackingMap interface to enable and disable write-behind support.
public void setWriteBehind(String writeBehindParam);
For more details about how to use the setWriteBehind method, see BackingMap interface.