Code Monkey home page Code Monkey logo

lease's Introduction

Lease Build status License GoDoc

A generic leasing implementation of the Amazon-KCL.lease package. ideal for manage and partition work across a fleet of workers.

Screenshot

What is a Lease ?

Lease type contains data pertianing to a lease.
Distributed systems may use leases to partition work across a fleet of workers.
Each unit of work (identified by a leaseKey) has a corresponding Lease.
Every worker will contend for all leases - only one worker will successfully take each one.
The worker should hold the lease until it is ready to stop processing the corresponding unit of work, or until it fails.
When the worker stops holding the lease, another worker will take and hold the lease.

To get started, see the examples

License

MIT

lease's People

Contributors

a8m avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

lease's Issues

Should not update uuid in old held leases

We've found issues when trying to update the lease with extra fields when it has been renewed by the renewer gorutine. Looking into it we've found that it is because the concurrencyToken is being updated (along with the whole Lease struct) every time it is renewed.
By comparing it with the base Java implementation I think the concurrencyToken should not change on Renew, only in Take.
In the commit history we've seen you already had fixed this on commit 5737f37 yet you changed your mind on commit e663b4a; I was wondering if you could elaborate on why this last commit was needed.

If you need more info or want to comment about it please don't hesitate to contact me.

Greetings

weighted lease

for example:

leaseKey leaseOwner leaseWeight leaseCounter
task 1 worker 1 1 (default) x
task 2 worker 2 3 x
task 3 worker 1 1 (default) x
task 4 worker 1 1 (default) x

comments:

  • the default weight of a lease(or task) is 1
  • we expect the leaser to partition the work according to the total weight of the tasks.

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.