Comments (1)
updateSortedHashes() uses append() so c.sortedHashes will grow over time as members are added and removed. When the slice is using too much memory this code creates a new slice and the memory for the old slice is freed.
I didn't write it so if I understand correctly too-much is defined as when the allocated memory is 4 times the amount being used. But it is also adjusted based on the expected number of members (c.NumberOfReplicas). The adjustment would prevent extra reallocations if say most replicas went offline for a breif period of time and then came back again.
from consistent.
Related Issues (20)
- Distribution is not uniform HOT 12
- Excellent, but i have a confuse with the code HOT 1
- crc32 hash value conflict in add function
- failed go get HOT 2
- Cert expired, cannot go `get this` package HOT 1
- https certificate has expired or is not yet valid HOT 1
- Cerificate expired. HOT 2
- Why copy string to [64]byte slice instead of converting it ? HOT 1
- go get faild HOT 7
- Dependency sucks HOT 3
- Provide a idempotent Add|Remove method?
- https certificate has expired today, HOT 3
- Https Certificate expired again HOT 1
- go.mod and release tag should present
- I have a confuse with the code, why 1/4th ?
- Found slice index can't be greater than the slice's length
- Bug: hash collision leads to inconsistent sharding HOT 8
- Consistent.hashKey: Why do we need the if statement? HOT 1
- fail HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from consistent.