Skip to content

Commit 44daace

Browse files
committed
fix docs
1 parent 312fab6 commit 44daace

File tree

1 file changed

+31
-5
lines changed
  • src/main/java/org/apache/sysds/runtime/frame/data/columns

1 file changed

+31
-5
lines changed

src/main/java/org/apache/sysds/runtime/frame/data/columns/Array.java

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,14 @@ public synchronized final Map<T, Integer> getRecodeMap() {
9393
return getRecodeMap(4);
9494
}
9595

96+
/**
97+
* Get a recode map that maps each unique value in the array, to a long ID. Null values are ignored, and not included
98+
* in the mapping. The resulting recode map in stored in a soft reference to speed up repeated calls to the same
99+
* column.
100+
*
101+
* @param estimate The estimated number of unique values in this Array to start the initial hashmap size at
102+
* @return A recode map
103+
*/
96104
public synchronized final Map<T, Integer> getRecodeMap(int estimate) {
97105
return getRecodeMap(estimate, null);
98106
}
@@ -102,7 +110,7 @@ public synchronized final Map<T, Integer> getRecodeMap(int estimate) {
102110
* in the mapping. The resulting recode map in stored in a soft reference to speed up repeated calls to the same
103111
* column.
104112
*
105-
* @param estimate the estimated number of unique.
113+
* @param estimate the estimated number of unique values in this array.
106114
* @param pool An executor pool to be used for parallel execution
107115
* @return A recode map
108116
*/
@@ -123,6 +131,15 @@ public synchronized final Map<T, Integer> getRecodeMap(int estimate, ExecutorSer
123131
return map;
124132
}
125133

134+
/**
135+
* Get a recode map that maps each unique value in the array, to a long ID. Null values are ignored, and not included
136+
* in the mapping. The resulting recode map in stored in a soft reference to speed up repeated calls to the same
137+
* column.
138+
*
139+
* @param estimate The estimate number of unique values inside this array.
140+
* @param pool The thread pool to use for parallel creation of recode map (can be null).
141+
* @return The recode map created.
142+
*/
126143
protected Map<T, Integer> createRecodeMap(int estimate, ExecutorService pool) {
127144
Timing t = new Timing();
128145
final int s = size();
@@ -167,6 +184,15 @@ private Map<T, Integer> parallelCreateRecodeMap(int estimate, ExecutorService po
167184
}
168185
}
169186

187+
/**
188+
* Merge Recode maps, most likely from parallel threads.
189+
*
190+
* If the unique value is present in the target, use that ID, otherwise this method map to new ID's based on the
191+
* target mapping's size.
192+
*
193+
* @param target The target object to merge the two maps into
194+
* @param from The Map to take entries from.
195+
*/
170196
protected abstract void mergeRecodeMaps(Map<T, Integer> target, Map<T, Integer> from);
171197

172198
private Map<T, Integer> createRecodeMap(final int estimate, final int s, final int e) {
@@ -990,8 +1016,8 @@ public double[] minMax(int l, int u) {
9901016
* Set the index i in the map given based on the mapping provided. The map should be guaranteed to contain all unique
9911017
* values.
9921018
*
993-
* @param map Map containing all unique values of this array
994-
* @param m The array mapping to set the value part of the Map<T,Integer> from
1019+
* @param map A map containing all unique values of this array
1020+
* @param m The MapToData to set the value part of the Map from
9951021
* @param i The index to set in m
9961022
*/
9971023
public void setM(Map<T, Integer> map, AMapToData m, int i) {
@@ -1002,9 +1028,9 @@ public void setM(Map<T, Integer> map, AMapToData m, int i) {
10021028
* Set the index i in the map given based on the mapping provided. The map should be guaranteed to contain all unique
10031029
* values except null. Therefore in case of null we set the provided si value.
10041030
*
1005-
* @param map Map containing all unique values of this array
1031+
* @param map A map containing all unique values of this array
10061032
* @param si The default value to use in m if this Array contains null at index i
1007-
* @param m The array mapping to set the value part of the Map<T,Integer> from
1033+
* @param m The MapToData to set the value part of the Map from
10081034
* @param i The index to set in m
10091035
*/
10101036
public void setM(Map<T, Integer> map, int si, AMapToData m, int i) {

0 commit comments

Comments
 (0)