Giter VIP home page Giter VIP logo

chunkedset's Introduction

Chunkedset

The ChunkedSet stores its elements in Chunks of size k. It behaves as a set and contains only unique values in all chunks combined.

Table of contents

Description

The implementation works efficiently for any number of chunks.

ChunkedSet is implemented with 3 hash_tables. Each of which helps make it behave as a set of sets.

  Data_table -
      hash_table1 : key   :  datapoint
                    value :  (chunk, slots)
  Slot_table -
      hash_table2 : key   :  slots
                    value :  [list of chunks]
  Node_table -
      hash_table3 : key   :  chunks
                    value :  datapoints in tuple

Features

  • Join : When a new chunk joins the ChunkedSet, all the duplicate values are deleted
  • Leave : When a chunk leaves the ChunkedSet, all the values are migrated to the available slots in the rest of the chunks

Requirements

  • flask

Usage

  • Clone the repo
  git clone https://github.com/anaswaratrajan/Chunkedset.git
  • Enter directory chunkedset
  cd chunked set
  • Install requirements
  pip install -r requirements.txt
  • Run the app
  flask run
  • Set data to chunk - POST
curl --header "Content-Type: application/json" \
  --request POST \
  --data '{"chunk":1,"data":[1,2,3,4,5]}' \
  http://127.0.0.1:5000/chunk1/setdata
  • Send join request to server - GET
  http://127.0.0.1:5000/chunk1/join
  • Send leave request to server - GET
  http://127.0.0.1:5000/chunk1/leave
  • Check server for updates
  http://127.0.0.1:5000/server

Similar for other chunks ( chunk2, chunk3)

chunkedset's People

Contributors

anastr0 avatar

Watchers

James Cloos avatar  avatar

chunkedset's Issues

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.