ilovemesomeramen commented on a change in pull request #1261:
URL: https://github.com/apache/systemds/pull/1261#discussion_r631398550



##########
File path: 
src/main/java/org/apache/sysds/runtime/transform/encode/MultiColumnEncoder.java
##########
@@ -463,4 +589,72 @@ public void applyColumnOffset() {
                if(_legacyMVImpute != null)
                        _legacyMVImpute.shiftCols(_colOffset);
        }
+
+       private static class ColumnApplyTask implements Callable<Integer> {
+
+               private final ColumnEncoder _encoder;
+               private final FrameBlock _input;
+               private final MatrixBlock _out;
+               private final int _columnOut;
+               private int _rowStart = 0;
+               private int _blk = -1;
+
+               protected ColumnApplyTask(ColumnEncoder encoder, FrameBlock 
input, MatrixBlock out, int columnOut) {
+                       _encoder = encoder;
+                       _input = input;
+                       _out = out;
+                       _columnOut = columnOut;
+               }
+
+               protected ColumnApplyTask(ColumnEncoder encoder, FrameBlock 
input, MatrixBlock out, int columnOut, int rowStart,
+                       int blk) {
+                       this(encoder, input, out, columnOut);
+                       _rowStart = rowStart;
+                       _blk = blk;
+               }
+
+               @Override
+               public Integer call() throws Exception {
+                       _encoder.apply(_input, _out, _columnOut, _rowStart, 
_blk);
+                       // TODO return NNZ
+                       return 1;
+               }
+       }
+
+       private static class ColumnBuildTask implements Callable<Integer> {
+
+               private final ColumnEncoder _encoder;
+               private final FrameBlock _input;
+
+               // if a pool is passed the task may be split up into multiple 
smaller tasks.
+               protected ColumnBuildTask(ColumnEncoder encoder, FrameBlock 
input) {
+                       _encoder = encoder;
+                       _input = input;
+               }
+
+               @Override
+               public Integer call() throws Exception {
+                       _encoder.build(_input);
+                       return 1;
+               }
+       }
+
+       private static class ColumnMergeBuildPartialTask implements 
Callable<Integer> {
+
+               private final ColumnEncoderComposite _encoder;
+               private final List<Future<Object>> _partials;
+
+               // if a pool is passed the task may be split up into multiple 
smaller tasks.
+               protected ColumnMergeBuildPartialTask(ColumnEncoderComposite 
encoder, List<Future<Object>> partials) {
+                       _encoder = encoder;
+                       _partials = partials;
+               }
+
+               @Override
+               public Integer call() throws Exception {
+                       _encoder.mergeBuildPartial(_partials, 0, 
_partials.size());
+                       return 1;

Review comment:
       I missed that. should be null and the callable should be a 
Callable<Void>.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to