toshic / balance-logic Goto Github PK
View Code? Open in Web Editor NEWThis project forked from vkap/balance-logic
Balance logic for unit-based distributed storages
License: GNU Lesser General Public License v3.0
This project forked from vkap/balance-logic
Balance logic for unit-based distributed storages
License: GNU Lesser General Public License v3.0
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.