Coder Social home page Coder Social logo

rediblaster's Introduction

Rediblaster

Rediblaster is a small tool built for publishing mock data into a local Redis instance for other services, tests, and experimentation. It utilizes Jedis as the java Redis client.

The POJO being inserted is an Employee object.

public class Employee {

    private final int id;
    private final String firstName;
    private final String lastName;
    private final String email;
    private final String occupation;
    private final int salary;

    ...
}

Rediblaster will create ids from 0 to n, where n is the number of employees to be generated (this is defined as a static var in Main.java). For each id, an employee object with random values for each field will be created, converted to a json string via a Jackson ObjectMapper, and pushed to Redis. the key/value will be id:Employee.

The fields are generated as such:

  • firstName: 5 character string of random letters (lowercase)
  • lastName: 8 character string of random letters (lowercase)
  • email: {firstName}.{lastName}@email.com
  • occupation: one of 4 strings: Full Stack Developer, Frontend Developer, Backend Developer, Manager
  • salary: random integer between 50,000 and 250,000
Key: "124"
Value: "{\"id\":124,\"firstName\":\"oyhwj\",\"lastName\":\"eimuzbzw\",\"email\":\"[email protected]\",\"occupation\":\"Backend Developer\",\"salary\":213004}"

In order to use Rediblaster, you must first have Redis setup locally. Download the official released package here, or clone the source code from github and run MAKE. Definitely recommend the latter option as Redis is extremely well written IMO. Doesn't hurt to review some C.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.