public class Label extends Object
Modifier and Type | Field and Description |
---|---|
private BitSet |
label |
private int |
length |
Modifier | Constructor and Description |
---|---|
private |
Label(BitSet bits,
int length) |
|
Label(String label)
Returns the corresponding label given the "binary" label.
|
private |
Label(String label,
int length) |
Modifier and Type | Method and Description |
---|---|
static int |
_lowestCommonAncestor(Label label1,
Label label2)
Calculates the lowestCommonAncestor between two of Label
|
static Set<Label> |
branchNodesBetweenLabels(Label label,
Label region)
Among all branch nodes (i.e., the second children of the ancestors) in the local tree, there exist one or more whose
regions overlap the query range.
|
boolean |
equals(Object obj) |
private BitSet |
getBitSet() |
String |
getLabel() |
int |
getLength() |
Range |
interval() |
static Range |
interval(Label label)
Dual of prefix.
|
boolean |
isLeft()
Returns true if label ends by 0 bit, which means this is the child node on the left
|
boolean |
isRight()
Returns true if label ends by 1 bit, which means this is the child node on the right
|
Label |
leftChild()
Creates a Label that could be mapped as a Left Child in the tree
|
static Label |
lowestCommonAncestor(Label... labels)
Calculates the lowestCommonAncestor between a list of Label
|
Label |
namingFunction()
Apply the naming function to calculate the internal node where the Label
(Leaf) is mapped.
|
private static Label |
namingFunction(BitSet bits,
int dimentions,
int len)
the real static implementation of the NamingFunction
|
static Label |
namingFunction(Label label)
The static implementation of the NamingFunction for 1D-LIGHT
|
static Label |
namingFunction(Label label,
int dimentions)
The static implementation of the NamingFunction for MD-LIGHT
|
Label |
nextNamingFunction(int prefixLength,
int treeLength)
NextNamingFunction is used to optimize the increments in the Lookup.
|
static Label |
nextNamingFunction(Label label,
int prefixLength,
int treeLength)
Γ(μ) is the set of possible prefixes of μ
Γ(μ, D) set of possibile prefixes with maximum length D
Notation: μ = label, x = prefix
Locates the first bit in the suffix of μ (with respect to x) that differs from x’s ending bit; the value
nextNamingFunction(μ, x) is then the prefix of μ, which ends up with this located bit.
|
static Label |
prefix(int length,
long value)
Given the value, returns the prefix label with the specified length.
|
Label |
rightChild()
Creates a Label that could be mapped as a Right Child in the tree
|
Key |
toDataKey()
get the hashed key for the data referenced by this Label
|
Label |
toDHTKey()
get the associated Label for the bucket corresponding with this label
it is the Label of an internal node
|
Key |
toKey()
get the Key for the internal node associated with the Label, this is the
Hashed key to make lookups in the chord overlay network
|
String |
toString()
Get a binary-readable string of the Label
|
private final BitSet label
private int length
public Label(String label)
label
- |private Label(String label, int length)
private Label(BitSet bits, int length)
public String getLabel()
public static Label prefix(int length, long value)
length
- |value
- |public int getLength()
public String toString()
public Label toDHTKey()
public Key toKey()
public Key toDataKey()
public Label namingFunction()
public Label nextNamingFunction(int prefixLength, int treeLength)
treeLength
- |prefixLength
- |public Range interval()
public boolean isRight()
public boolean isLeft()
public Label leftChild()
public Label rightChild()
private BitSet getBitSet()
public static Range interval(Label label)
label
- |public static Label namingFunction(Label label)
label
- |public static Label namingFunction(Label label, int dimentions)
label
- |dimentions
- |private static Label namingFunction(BitSet bits, int dimentions, int len)
bits
- |dimentions
- |len
- |public static Label nextNamingFunction(Label label, int prefixLength, int treeLength)
label
- |prefixLength
- |treeLength
- |public static Label lowestCommonAncestor(Label... labels)
labels
- |public static int _lowestCommonAncestor(Label label1, Label label2)
label1
- |label2
- |public static Set<Label> branchNodesBetweenLabels(Label label, Label region)
label
- |region
- |Copyright © 2018. All rights reserved.