One of the default RADOS classes in Ceph from the Kraken release onward is one that can run Lua scripts. The Lua script is dynamically passed to the Lua RADOS object class, which then executes the contents of the script. The scripts are typically passed in a JSON-formatted string to the object class. Although this brings advantages over the traditional RADOS object classes, which need to be compiled before they can be used, it also limits the complexity of what the Lua scripts can accomplish. As such, thought should be given as to what method is appropriate for the task you wish to accomplish.
The following Python code example demonstrates how to create and pass a Lua script to be executed on an OSD. The Lua script reads the contents of the specified object and returns the string of text back in uppercase—all processing is done on the...