Git Product home page Git Product logo

balance-logic's Introduction

A library implementing balance logic for distributed storages.

Distributed storage should consist of units, which are base balance entity.
Balancing is parameterized with balance directives of the following form:
{
	"UnitDataType": "type42",
	"MinimumFreeSpaceInKbToParticipate": 65535,
	"MinimumFreeSpaceRelativeToParticipate": 0.15,
	"MinimumUnitsWithPositiveWeight": 10,
	"AdditionalUnitsNumber": 3,
	"AdditionalUnitsPercentage": 0.15,
	"AdditionalMessagePerSecondNumber": 20,
	"AdditionalMessagePerSecondPercentage": 0.15,
	"TailHeightPercentage": 0.95,
	"TailHeightSpaceInKb": 500000,
	"WeightMultiplierHead": 1000000,
	"WeightMultiplierTail": 600000,
	"MinimumWeight": 10000
}

Also balancing is provided with list of unit objects. Unit objects must provide the following methods:
	* unitId(self) - unit ID, unique for each unit, must be usable for dict key.
	* dataType(self) - data type of the unit. Only units with dataType equal to balance directive
	"UnitDataType" are returned after balancing. If custom filter rule is provided, there's no need
	in this method.
	* realPutPerPeriod(self) - current rate for put.
	* maxPutPerPeriod(self) - estimated maximal rate for put.
	* realGetPerPeriod(self) - current rate for get.
	* maxGetPerPeriod(self) - estimated maximal rate for get.
	* freeSpaceInKb(self) - total free space in unit in kB.
	* freeSpaceRelative(self) - relative free space in unit.
	* inService(self) - whether unit is in service and its usage should be low.
	* writeEnable(self) - whether unit is writable.
	* isBad(self) - whether unit is unusable.

The returned value is tuple of dictionary with unit weights and cluster statistics.

balance-logic's People

Contributors

nobodyisme avatar toshic avatar vkap avatar

Watchers

 avatar  avatar

Forkers

nobodyisme

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.