IP Library › Granted Patent US 10,540,207
Granted Patent B1
US 10,540,207 · App. 16/038,201 · Granted Jan 21, 2020

Fast, low memory, consistent hash using an initial distribution

Inventors: Dean Har'el Lorenz (Haifa, IL); Gal Mendelson (Adi, IL); Valleriya Perelman (Nesher, IL)
Assignee: International Business Machines Corporation
G06F9/5027G06F2209/5014
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 10,540,207
App. No.
16/038,201
Granted
Jan 21, 2020
Kind
B1
Abstract

Embodiments of the present systems and methods may provide a consistent hash function that provides reduced memory use and complexity, reduced computational complexity, and relatively low numbers of keys that must be reshuffled compared to current techniques. For example, in an embodiment, a computer-implemented method for controlling computing resources may comprise storing a set of labels of potential resources comprising a plurality of labels of working resources allocated to actual resources and a plurality of labels of reserved resources available to be allocated, generating an initial assignment to one of the set of labels of potential resources, when the assignment to one of a set of labels of potential resources is to one of the labels of reserved resources, reassigning the request to another label of a resource selected from a subset of the labels of potential resources, and repeating the reassigning until the request is assigned to a label of a working resource.

Claims (48)

1. A computer-implemented method for controlling computing resources comprising:

storing a set of labels of potential resources comprising a plurality of labels of working resources allocated to actual resources and a plurality of labels of reserved resources available to be allocated;

generating an initial assignment to one of the set of labels of potential resources;

when the assignment to one of a set of labels of potential resources is to one of the labels of reserved resources, reassigning a request to another label of a resource selected from a subset of the labels of potential resources;

repeating the reassigning until the request is assigned to a label of a working resource;

removing an actual resource by removing a label allocated to the actual resource from the labels of working resources by:

moving a label of a last working resource before the removal to take the place of the label allocated to the removed resource and storing only the label of the resource that took the place of the label allocated to the removed resource; and

decrementing a range value indicating the label of the last working resource in the stored set of labels of potential resources; and

adding another actual resource by undoing a removal of the label of the last removed resource and allocating the undone label to the added actual resource.

2. The method of claim 1 , wherein the subset comprises the plurality of labels of working resources and a portion of the labels of reserved resources bounded by the currently assigned label of a resource.

3. The method of claim 2 , wherein another label of a resource is selected at random from the set of labels of potential resources or the subset of labels of potential resources.

4. The method of claim 1 , further comprising removing an actual resource by removing a label allocated to the resource from the labels of working resources by decrementing a range value indicating a last label of a working resource in the stored set of labels of potential resources to exclude the removed label allocated to the resource.

5. The method of claim 1 , further comprising removing an actual resource by removing a label allocated to the resource from the labels of working resources by:

storing the set of labels of potential resources before the removal, with a last label of a working resource before the removal taking the place of the label allocated to the removed resource; and

decrementing a range value indicating a last label of a working resource in the stored set of labels of potential resources to exclude the label allocated to the removed resource.

6. The method of claim 1 , wherein the set of labels of potential resources comprises a plurality of labels for at least some of the potential resources and a number of labels for each potential resource comprises a weight given to the potential resource.

7. A system for controlling computing resources, the system comprising a processor, memory accessible by the processor, and computer program instructions stored in the memory and executable by the processor to perform:

storing a set of labels of potential resources comprising a plurality of labels of working resources allocated to actual resources and a plurality of labels of reserved resources available to be allocated;

generating an initial assignment to one of the set of labels of potential resources;

when the assignment to one of a set of labels of potential resources is to one of the labels of reserved resources, reassigning the request to another label of a resource selected from a subset of the labels of potential resources;

repeating the reassigning until the request is assigned to a label of a working resource;

removing an actual resource by removing a label allocated to the actual resource from the labels of working resources by:

moving a label of a last working resource before the removal to take the place of the label allocated to the removed resource and storing only the label of the resource that took the place of the label allocated to the removed resource; and

decrementing a range value indicating the label of the last working resource in the stored set of labels of potential resources; and

adding another actual resource by undoing a removal of the label of the last removed resource and allocating the undone label to the added actual resource.

8. The system of claim 7 , wherein the subset comprises the plurality of labels of working resources and a portion of the labels of reserved resources bounded by the currently assigned label of a resource.

9. The system of claim 8 , wherein another label of a resource is selected at random from the set of labels of potential resources or the subset of labels of potential resources.

10. The system of claim 7 , further comprising removing an actual resource by removing a label allocated to the resource from the labels of working resources by decrementing a range value indicating a last label of a working resource in the stored set of labels of potential resources to exclude the removed label allocated to the resource.

11. The system of claim 7 , further comprising removing an actual resource by removing a label allocated to the resource from the labels of working resources by:

storing the set of labels of potential resources before the removal, with a last label of a working resource before the removal taking the place of the label allocated to the removed resource; and

decrementing a range value indicating a last label of a working resource in the stored set of labels of potential resources to exclude the label allocated to the removed resource.

12. The system of claim 7 , wherein the set of labels of potential resources comprises a plurality of labels for at least some of the potential resources and a number of labels for each potential resource comprises a weight given to the potential resource.

13. A computer program product for controlling computing resources, the computer program product comprising a non-transitory computer readable storage having program instructions embodied therewith, the program instructions executable by a computer, to cause the computer to perform a method comprising:

storing a set of labels of potential resources comprising a plurality of labels of working resources allocated to actual resources and a plurality of labels of reserved resources available to be allocated;

generating an initial assignment to one of the set of labels of potential resources;

when the assignment to one of a set of labels of potential resources is to one of the labels of reserved resources, reassigning the request to another label of a resource selected from a subset of the labels of potential resources; and

repeating the reassigning until the request is assigned to a label of a working resource;

removing an actual resource by removing a label allocated to the actual resource from the labels of working resources by:

moving a label of a last working resource before the removal to take the place of the label allocated to the removed resource and storing only the label of the resource that took the place of the label allocated to the removed resource; and

decrementing a range value indicating the label of the last working resource in the stored set of labels of potential resources; and

adding another actual resource by undoing a removal of the label of the last removed resource and allocating the undone label to the added actual resource.

14. The computer program product of claim 13 , wherein the subset comprises the plurality of labels of working resources and a portion of the labels of reserved resources bounded by the currently assigned label of a resource.

15. The computer program product of claim 14 , wherein another label of a resource is selected at random from the set of labels of potential resources or the subset of labels of potential resources.

16. The computer program product of claim 13 , further comprising removing an actual resource by removing a label allocated to the resource from the labels of working resources by decrementing a range value indicating a last label of a working resource in the stored set of labels of potential resources to exclude the removed label allocated to the resource.

17. The computer program product of claim 13 , further comprising removing an actual resource by removing a label allocated to the resource from the labels of working resources by:

storing the set of labels of potential resources before the removal, with a last label of a working resource before the removal taking the place of the label allocated to the removed resource; and

decrementing a range value indicating a last label of a working resource in the stored set of labels of potential resources to exclude the label allocated to the removed resource.

18. The computer program product of claim 13 , wherein the set of labels of potential resources comprises a plurality of labels for at least some of the potential resources and a number of labels for each potential resource comprises a weight given to the potential resource.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jul 18, 2018
From: LORENZ, DEAN HAR'EL; MENDELSON, GAL; PERELMAN, VALLERIYA
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 046376/0327 →
Cited By (1)
US 12,362,922