Book Image

Learning Redis

By : Vinoo Das
Book Image

Learning Redis

By: Vinoo Das

Overview of this book

Table of Contents (16 chapters)
Learning Redis
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Master node commands


The following is a list of commands that can be fired from the master nodes:

  • The start command

  • The status command

  • The get command

  • The msg command

  • The kill command

  • The clone command

  • The stop command

Let's take a look at each command from a design and implementation perspective.

The start command

The start command will start the master node in the gossip server ecosystem. The precondition for executing this command is that the node name should be unique.

Sequence of flow of data in Start command

The syntax for this command is: start. The following screenshot shows the response in the shell console:

Implementation of StartMasterCommand

The start command is implemented as shown here:

package org.redisch7.gossipserver.commands;
/* OMITTING THE IMPORT STATEMENTS TO SAVE SPACE */
public class StartMasterCommand extends AbstractCommand {
  private Validator validator = new Validator();
  public StartMasterCommand() {
    validator.configureTemplate().add((new StringToken("start")));
  }
 ...