This is an automated email from the ASF dual-hosted git repository.

maobaolong pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-uniffle.git


The following commit(s) were added to refs/heads/master by this push:
     new 51b009ae3 [MINOR] feat(server): Introduce LocalFileNullDeviceWriter to 
flush data into null device (#2337)
51b009ae3 is described below

commit 51b009ae3a7c0fd4bfabc1b9a52d2895e5dbe350
Author: maobaolong <[email protected]>
AuthorDate: Mon Jan 13 14:23:10 2025 +0800

    [MINOR] feat(server): Introduce LocalFileNullDeviceWriter to flush data 
into null device (#2337)
    
    ### What changes were proposed in this pull request?
    
    Introduce a new implementation of FileWriter, named 
LocalFileNullDeviceWriter.
    
    ### Why are the changes needed?
    
    Write all the data into null device, specify LocalFileNullDeviceWriter for 
test the ceiling performance of flush event but kept the cost for file level 
api.
    
    ### Does this PR introduce _any_ user-facing change?
    
    No.
    
    ### How was this patch tested?
    
    Tested on our test cluster.
---
 .../handler/impl/LocalFileNullDeviceWriter.java    | 37 ++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git 
a/storage/src/main/java/org/apache/uniffle/storage/handler/impl/LocalFileNullDeviceWriter.java
 
b/storage/src/main/java/org/apache/uniffle/storage/handler/impl/LocalFileNullDeviceWriter.java
new file mode 100644
index 000000000..152b96025
--- /dev/null
+++ 
b/storage/src/main/java/org/apache/uniffle/storage/handler/impl/LocalFileNullDeviceWriter.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.uniffle.storage.handler.impl;
+
+import java.io.File;
+import java.io.IOException;
+
+import com.google.common.annotations.VisibleForTesting;
+
+/** A shuffle writer that write data into null device for performance test 
purpose only. */
+public class LocalFileNullDeviceWriter extends LocalFileNioWriter {
+  private static final File NULL_DEVICE_FILE = new File("/dev/null");
+
+  @VisibleForTesting
+  public LocalFileNullDeviceWriter(File file) throws IOException {
+    this(file, 8 * 1024);
+  }
+
+  public LocalFileNullDeviceWriter(File file, int bufferSize) throws 
IOException {
+    super(NULL_DEVICE_FILE, bufferSize);
+  }
+}

Reply via email to