SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
simplify
Chris Lu6839f96c0cd4
diff --git a/other/java/client/src/main/java/seaweedfs/client/ByteBufferPool.java b/other/java/client/src/main/java/seaweedfs/client/ByteBufferPool.javaindex 55f003a18c..994bcaa2b3 100644--- a/other/java/client/src/main/java/seaweedfs/client/ByteBufferPool.java+++ b/other/java/client/src/main/java/seaweedfs/client/ByteBufferPool.java@@ -18,6 +18,7 @@ public class ByteBufferPool {if (bufferSize < MIN_BUFFER_SIZE) {bufferSize = MIN_BUFFER_SIZE;}+ LOG.debug("requested new buffer {}", bufferSize);if (bufferList.isEmpty()) {return ByteBuffer.allocate(bufferSize);}@@ -33,6 +34,7 @@ public class ByteBufferPool {}public static synchronized void release(ByteBuffer obj) {+ obj.clear();bufferList.add(0, obj);}diff --git a/other/java/hdfs2/src/main/java/seaweed/hdfs/SeaweedOutputStream.java b/other/java/hdfs2/src/main/java/seaweed/hdfs/SeaweedOutputStream.javaindex d62d74fb13..1a638677f4 100644--- a/other/java/hdfs2/src/main/java/seaweed/hdfs/SeaweedOutputStream.java+++ b/other/java/hdfs2/src/main/java/seaweed/hdfs/SeaweedOutputStream.java@@ -187,7 +187,6 @@ public class SeaweedOutputStream extends OutputStream {// System.out.println(path + " is going to save [" + (writePosition) + "," + ((writePosition) + bytesLength) + ")");SeaweedWrite.writeData(entry, replication, filerGrpcClient, writePosition, bufferToWrite.array(), bufferToWrite.position(), bufferToWrite.limit());// System.out.println(path + " saved [" + (writePosition) + "," + ((writePosition) + bytesLength) + ")");- bufferToWrite.clear();ByteBufferPool.release(bufferToWrite);return null;});diff --git a/other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedOutputStream.java b/other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedOutputStream.javaindex 05805b9e57..37068c73ae 100644--- a/other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedOutputStream.java+++ b/other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedOutputStream.java@@ -234,7 +234,6 @@ public class SeaweedOutputStream extends OutputStream implements Syncable, Strea// System.out.println(path + " is going to save [" + (writePosition) + "," + ((writePosition) + bytesLength) + ")");SeaweedWrite.writeData(entry, replication, filerGrpcClient, writePosition, bufferToWrite.array(), bufferToWrite.position(), bufferToWrite.limit());// System.out.println(path + " saved [" + (writePosition) + "," + ((writePosition) + bytesLength) + ")");- bufferToWrite.clear();ByteBufferPool.release(bufferToWrite);return null;});