|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.master.RegionPlacementMaintainer.RandomizedMatrix
protected static class RegionPlacementMaintainer.RandomizedMatrix
Some algorithms for solving the assignment problem may traverse workers or jobs in linear order which may result in skewing the assignments of the first jobs in the matrix toward the last workers in the matrix if the costs are uniform. To avoid this kind of clumping, we can randomize the rows and columns of the cost matrix in a reversible way, such that the solution to the assignment problem can be interpreted in terms of the original untransformed cost matrix. Rows and columns are transformed independently such that the elements contained in any row of the input matrix are the same as the elements in the corresponding output matrix, and each row has its elements transformed in the same way. Similarly for columns.
Constructor Summary | |
---|---|
RegionPlacementMaintainer.RandomizedMatrix(int rows,
int cols)
Create a randomization scheme for a matrix of a given size. |
Method Summary | |
---|---|
float[][] |
invert(float[][] matrix)
Copy a given matrix into a new matrix, transforming each row index and each column index according to the inverse of the randomization scheme that was created at construction time. |
int[] |
invertIndices(int[] indices)
Given an array where each element indices[i] represents the
randomized column index corresponding to randomized row index i ,
create a new array with the corresponding inverted indices. |
float[][] |
transform(float[][] matrix)
Copy a given matrix into a new matrix, transforming each row index and each column index according to the randomization scheme that was created at construction time. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RegionPlacementMaintainer.RandomizedMatrix(int rows, int cols)
rows
- the number of rows in the matrixcols
- the number of columns in the matrixMethod Detail |
---|
public float[][] transform(float[][] matrix)
matrix
- the cost matrix to transform
public float[][] invert(float[][] matrix)
matrix
- the cost matrix to be inverted
public int[] invertIndices(int[] indices)
indices[i]
represents the
randomized column index corresponding to randomized row index i
,
create a new array with the corresponding inverted indices.
indices
- an array of transformed indices to be inverted
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |