CodingCat commented on code in PR #2348:
URL: 
https://github.com/apache/incubator-celeborn/pull/2348#discussion_r1511322290


##########
client/src/main/java/org/apache/celeborn/client/read/CelebornInputStream.java:
##########
@@ -516,26 +510,40 @@ public int read(byte[] b, int off, int len) throws 
IOException {
       return readBytes;
     }
 
+    private void clear() {}

Review Comment:
   +1



##########
client/src/main/java/org/apache/celeborn/client/read/CelebornInputStream.java:
##########
@@ -516,26 +510,40 @@ public int read(byte[] b, int off, int len) throws 
IOException {
       return readBytes;
     }
 
+    private void clear() {}
+
     @Override
-    public void close() {
-      int locationsCount = locations.length;
-      logger.debug(
-          "total location count {} read {} skip {}",
-          locationsCount,
-          locationsCount - skipCount.sum(),
-          skipCount.sum());
-      if (currentChunk != null) {
-        logger.debug("Release chunk {}", currentChunk);
-        currentChunk.release();
-        currentChunk = null;
-      }
-      if (currentReader != null) {
-        logger.debug("Closing reader");
-        currentReader.close();
-        currentReader = null;
-      }
-      if (containLocalRead) {
-        ShuffleClient.printReadStats(logger);
+    public synchronized void close() {

Review Comment:
   add `@Override`?



##########
tests/spark-it/src/test/scala/org/apache/celeborn/tests/spark/SparkTestBase.scala:
##########
@@ -32,6 +32,19 @@ import org.apache.celeborn.service.deploy.MiniClusterFeature
 
 trait SparkTestBase extends AnyFunSuite
   with Logging with MiniClusterFeature with BeforeAndAfterAll with 
BeforeAndAfterEach {
+
+  val sparkConf = new 
SparkConf().setAppName("rss-demo").setMaster("local[2,3]")
+  val sparkSession = SparkSession.builder().config(sparkConf).getOrCreate()
+  val version =
+    try {
+      sparkSession.sql("select version()").collect()(0).getString(0)
+    } catch {
+      case _: Exception => ""
+    }
+  sparkSession.close()

Review Comment:
   is it sparksession only for fetching version number?



##########
tests/spark-it/src/test/scala/org/apache/celeborn/tests/spark/SparkTestBase.scala:
##########
@@ -32,6 +32,19 @@ import org.apache.celeborn.service.deploy.MiniClusterFeature
 
 trait SparkTestBase extends AnyFunSuite
   with Logging with MiniClusterFeature with BeforeAndAfterAll with 
BeforeAndAfterEach {
+
+  val sparkConf = new 
SparkConf().setAppName("rss-demo").setMaster("local[2,3]")
+  val sparkSession = SparkSession.builder().config(sparkConf).getOrCreate()
+  val version =
+    try {
+      sparkSession.sql("select version()").collect()(0).getString(0)
+    } catch {
+      case _: Exception => ""
+    }
+  sparkSession.close()

Review Comment:
   if yes, you can just `import org.apache.spark.SPARK_VERSION`



-- 
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]

Reply via email to