Welcome to the new Gigaspaces XAP forum. To recover your account, please follow these instructions.

Ask Your Question
0

Best practices for Customized Backup Policy

We would like to implement a customized backup policy for GigaSpaces log files, in order to automatically gzip rolled files. According to the documentation, we must implement interface com.gigaspaces.logger.BackupPolicy and provide it to GigaSpaces components when they are started.

Once we have a JAR with an implementation of the customized backup policy, what are the best practices for providing classes to GigaSpaces runtime? Should we just put the JAR into "$GS_HOME/lib/required", or are there another recommendations?

Another related question: is the callback method in the interface BackupPolicy invoked in a separate thread /pool, or is it invoked from a thread which has a lot of other tasks? Or, to put it differently: is it a good idea to run a long-running task, such as zipping a large file, directly in the callback method, or is it recommended to execute long-running tasks in a separate thread?

And one more question: is it guaranteed that the callback method in the interface BackupPolicy is always invoked from the same thread? Based on the answer, an internal synchronization may be required in the implementation of the BackupPolicy.

asked 2018-05-25 05:30:19 -0500

Alexey Serdyuk gravatar image

updated 2018-05-25 07:24:15 -0500

edit retag flag offensive close merge delete

Comments

In the meantime I could answer one of my questions myself: it looks like expected way of providing a JAR file to GigaSpaces grid during startup is to add it to the "magic" environment variable PRE_CLASSPATH or POST_CLASSPATH.

I am waiting for answers on other 2 questions above.

Alexey Serdyuk gravatar imageAlexey Serdyuk ( 2018-05-28 07:40:00 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

Hi Alexey, 1) The custom jar can be placed under "lib/platform/ext/" it is exported into the classpath. You could also place it as you mentioned in the PRE/POST classpath options. We recommend the EXT folder.

2) The callback method is invoked by the call to the java.util.logging.StreamHandler publish method which is synchronized. We do not delegate the callback to a thread prior to calling com.gigaspaces.logger.BackupPolicy track method.

answered 2018-05-29 07:11:31 -0500

edit flag offensive delete link more

Comments

Thank you. Could you please answer the last of my questions above: is it guaranteed that the callback method in the interface BackupPolicy is always invoked from the same thread? Based on the answer, an internal synchronization may be required in the implementation of the BackupPolicy.

Alexey Serdyuk gravatar imageAlexey Serdyuk ( 2018-06-06 01:09:54 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-05-25 05:30:19 -0500

Seen: 145 times

Last updated: May 29