View on GitHub Viant Engineering

CacheStore Groovy Shell

An Interactive Groovy Shell For Instantaneously Accessing CacheStore


Downloads

Changelog

Groovy
Shell

Object
Query

Usage
Guide

Home

The CacheStore Shell is an interactive shell using Groovy. This shell lets users easily and instantly access and manage clusters and stores within CacheStore without having to set up separate programs.

CacheStore Shell Setup and Usage

The shell can be easily started with the script, CachestoreShell.sh from either the CacheStore Remote or CacheStore Cluster Deployments (found on the Downloads page) Start the shell with the command sh bin/CachestoreShell.sh. The CacheStore Shell is capable of all CacheStore Java commands as well as shell-specific shorthand commands.

If you would like to utilize the CacheStore Shell without downloading a full Deployment, please download CachestoreShell.sh, Utils.groovy, startup.groovy, and the following dependencies:

<dependency>
    <groupId>org.codehaus.groovy</groupId>
    <artifactId>groovy-all</artifactId>
    <version>2.4.4</version>
</dependency>
<dependency>
    <groupId>jline</groupId>
    <artifactId>jline</artifactId>
    <version>2.12</version>
</dependency>
<dependency>
    <groupId>commons-cli</groupId>
    <artifactId>commons-cli</artifactId>
    <version>1.2</version>
<dependency>

Note that CachestoreShell.sh may have to be edited if you are not following the CacheStore Remote and Cluster Deployment file structures.

Once the shell is up and running, you can now connect to existing CacheStore servers that are running. Depending on what type of server you are connecting to and what type of client you want to create, you will need to use one of the following commands:

- open(url, store)

ex: c = open("localhost:4200", "test")

- openScan(url, store)

ex: c = openScan("localhost:4200", "test")

- openCluster(url, store)

ex: c = openCluster("localhost:4200", "test")

Once a connection has been established, you can now use the CacheStore Shell API. Here are some examples of API usage.

- getv(c, 1)

- listKey(c)

- put(c, "key", "object")

- remove(c, 1)

- remove(c, "key")

CacheStore Shell Commands

- open(url, store)

- openScan(url, store)

- openCluster(url, store)

- scan(client, from, to)

- scanCursor(client, from, to)

- nextCursor(client, nextCursor)

- listKey(client)

- get(client, k)

- getv(client, k)

- put(client, k, object)

- mget(client, keyList)

- mgetv(client, keyList)

- remove(client, k)

- query(client, query)

- query4List(client, query)

- query4v(client, query)