yunfengzhou-hub commented on code in PR #97:
URL: https://github.com/apache/flink-ml/pull/97#discussion_r890917094
##########
flink-ml-core/src/main/java/org/apache/flink/ml/linalg/typeinfo/DenseVectorSerializer.java:
##########
@@ -20,29 +20,36 @@
package org.apache.flink.ml.linalg.typeinfo;
import org.apache.flink.api.common.typeutils.SimpleTypeSerializerSnapshot;
+import org.apache.flink.api.common.typeutils.TypeSerializer;
import org.apache.flink.api.common.typeutils.TypeSerializerSnapshot;
-import org.apache.flink.api.common.typeutils.base.TypeSerializerSingleton;
import org.apache.flink.core.memory.DataInputView;
import org.apache.flink.core.memory.DataOutputView;
import org.apache.flink.ml.linalg.DenseVector;
+import org.apache.flink.ml.util.Bits;
import java.io.IOException;
import java.util.Arrays;
+import java.util.Objects;
/** Specialized serializer for {@link DenseVector}. */
-public final class DenseVectorSerializer extends
TypeSerializerSingleton<DenseVector> {
+public final class DenseVectorSerializer extends TypeSerializer<DenseVector> {
private static final long serialVersionUID = 1L;
private static final double[] EMPTY = new double[0];
- public static final DenseVectorSerializer INSTANCE = new
DenseVectorSerializer();
+ private final byte[] buf = new byte[1024];
Review Comment:
According to offline discussion, BufferedOutputStream cannot avoid it that
there will be a lot of small byte array read/write, and still have performance
issues. We'll still use the internal-byte-buffer practice.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]