Ce contenu n'est pas disponible dans la langue sélectionnée.
Chapter 3. Performing Batch Operations
Process operations in groups, either interactively or using batch files.
Prerequisites
- A running Data Grid cluster.
3.1. Performing Batch Operations with Files Copier lienLien copié sur presse-papiers!
Create files that contain a set of operations and then pass them to the Data Grid CLI.
Procedure
Create a file that contains a set of operations.
For example, create a file named
batchthat creates a cache namedmybatch, adds two entries to the cache, and disconnects from the CLI.Copy to Clipboard Copied! Toggle word wrap Toggle overflow TipConfigure the CLI with the
autoconnect-urlproperty instead of using theconnectcommand directly in your batch files.Run the CLI and specify the file as input.
bin/cli.sh -f batch
bin/cli.sh -f batchCopy to Clipboard Copied! Toggle word wrap Toggle overflow
CLI batch files support system property expansion. Strings that use the ${property} format are replaced with the value of the property system property.
3.2. Performing Batch Operations Interactively Copier lienLien copié sur presse-papiers!
Use the standard input stream, stdin, to perform batch operations interactively.
Procedure
Start the Data Grid CLI in interactive mode.
bin/cli.sh -c localhost:11222 -f -
bin/cli.sh -c localhost:11222 -f -Copy to Clipboard Copied! Toggle word wrap Toggle overflow TipYou can configure the CLI connection with the
autoconnect-urlproperty instead of using the-cargument.Run batch operations, for example:
create cache --template=org.infinispan.DIST_SYNC mybatch put --cache=mybatch hello world put --cache=mybatch hola mundo disconnect quit
create cache --template=org.infinispan.DIST_SYNC mybatch put --cache=mybatch hello world put --cache=mybatch hola mundo disconnect quitCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Use echo to add commands in interactive mode.
The following example shows how to use echo describe to get cluster information: