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
refactor
Chris Lu9123d799b86a
diff --git a/other/java/client/pom.xml b/other/java/client/pom.xmlindex db2634b2b2..1ea39863f5 100644--- a/other/java/client/pom.xml+++ b/other/java/client/pom.xml@@ -50,6 +50,17 @@<artifactId>slf4j-api</artifactId><version>1.7.25</version></dependency>+ <dependency>+ <groupId>org.apache.httpcomponents</groupId>+ <artifactId>httpmime</artifactId>+ <version>4.5.6</version>+ </dependency>+ <dependency>+ <groupId>junit</groupId>+ <artifactId>junit</artifactId>+ <version>4.12</version>+ <scope>test</scope>+ </dependency></dependencies><distributionManagement>diff --git a/other/java/hdfs/src/main/java/seaweed/hdfs/ByteBufferOutputStream.java b/other/java/client/src/main/java/seaweedfs/client/ByteBufferOutputStream.javasimilarity index 94%rename from other/java/hdfs/src/main/java/seaweed/hdfs/ByteBufferOutputStream.javarename to other/java/client/src/main/java/seaweedfs/client/ByteBufferOutputStream.javaindex e9ea81f36c..efcc265de3 100644--- a/other/java/hdfs/src/main/java/seaweed/hdfs/ByteBufferOutputStream.java+++ b/other/java/client/src/main/java/seaweedfs/client/ByteBufferOutputStream.java@@ -1,4 +1,4 @@-package seaweed.hdfs;+package seaweedfs.client;import java.io.IOException;import java.io.OutputStream;diff --git a/other/java/hdfs/src/main/java/seaweed/hdfs/SeaweedRead.java b/other/java/client/src/main/java/seaweedfs/client/SeaweedRead.javasimilarity index 98%rename from other/java/hdfs/src/main/java/seaweed/hdfs/SeaweedRead.javarename to other/java/client/src/main/java/seaweedfs/client/SeaweedRead.javaindex a4a2e97437..a906a689b0 100644--- a/other/java/hdfs/src/main/java/seaweed/hdfs/SeaweedRead.java+++ b/other/java/client/src/main/java/seaweedfs/client/SeaweedRead.java@@ -1,4 +1,4 @@-package seaweed.hdfs;+package seaweedfs.client;import org.apache.http.HttpEntity;import org.apache.http.HttpHeaders;@@ -6,8 +6,6 @@ import org.apache.http.HttpResponse;import org.apache.http.client.HttpClient;import org.apache.http.client.methods.HttpGet;import org.apache.http.impl.client.HttpClientBuilder;-import seaweedfs.client.FilerGrpcClient;-import seaweedfs.client.FilerProto;import java.io.IOException;import java.io.OutputStream;diff --git a/other/java/hdfs/src/main/java/seaweed/hdfs/SeaweedWrite.java b/other/java/client/src/main/java/seaweedfs/client/SeaweedWrite.javasimilarity index 96%rename from other/java/hdfs/src/main/java/seaweed/hdfs/SeaweedWrite.javarename to other/java/client/src/main/java/seaweedfs/client/SeaweedWrite.javaindex ee21310075..a7cede09fc 100644--- a/other/java/hdfs/src/main/java/seaweed/hdfs/SeaweedWrite.java+++ b/other/java/client/src/main/java/seaweedfs/client/SeaweedWrite.java@@ -1,4 +1,4 @@-package seaweed.hdfs;+package seaweedfs.client;import org.apache.http.HttpResponse;import org.apache.http.client.methods.HttpPost;@@ -6,8 +6,6 @@ import org.apache.http.entity.mime.HttpMultipartMode;import org.apache.http.entity.mime.MultipartEntityBuilder;import org.apache.http.impl.client.CloseableHttpClient;import org.apache.http.impl.client.HttpClientBuilder;-import seaweedfs.client.FilerGrpcClient;-import seaweedfs.client.FilerProto;import java.io.ByteArrayInputStream;import java.io.IOException;diff --git a/other/java/hdfs/src/test/java/seaweed/hdfs/SeaweedReadTest.java b/other/java/client/src/test/java/seaweedfs/client/SeaweedReadTest.javasimilarity index 55%rename from other/java/hdfs/src/test/java/seaweed/hdfs/SeaweedReadTest.javarename to other/java/client/src/test/java/seaweedfs/client/SeaweedReadTest.javaindex e3ab979106..ccfcdb1174 100644--- a/other/java/hdfs/src/test/java/seaweed/hdfs/SeaweedReadTest.java+++ b/other/java/client/src/test/java/seaweedfs/client/SeaweedReadTest.java@@ -1,13 +1,11 @@-package seaweed.hdfs;+package seaweedfs.client;+import org.junit.Assert;import org.junit.Test;-import seaweedfs.client.FilerProto;import java.util.ArrayList;import java.util.List;-import static org.junit.Assert.assertEquals;-public class SeaweedReadTest {@Test@@ -31,33 +29,33 @@ public class SeaweedReadTest {System.out.println("visible:" + visibleInterval);}- assertEquals(visibleIntervals.size(), 2);+ Assert.assertEquals(visibleIntervals.size(), 2);SeaweedRead.VisibleInterval visibleInterval = visibleIntervals.get(0);- assertEquals(visibleInterval.start, 0);- assertEquals(visibleInterval.stop, 100);- assertEquals(visibleInterval.modifiedTime, 1000);- assertEquals(visibleInterval.fileId, "aaa");+ Assert.assertEquals(visibleInterval.start, 0);+ Assert.assertEquals(visibleInterval.stop, 100);+ Assert.assertEquals(visibleInterval.modifiedTime, 1000);+ Assert.assertEquals(visibleInterval.fileId, "aaa");visibleInterval = visibleIntervals.get(1);- assertEquals(visibleInterval.start, 100);- assertEquals(visibleInterval.stop, 233);- assertEquals(visibleInterval.modifiedTime, 2000);- assertEquals(visibleInterval.fileId, "bbb");+ Assert.assertEquals(visibleInterval.start, 100);+ Assert.assertEquals(visibleInterval.stop, 233);+ Assert.assertEquals(visibleInterval.modifiedTime, 2000);+ Assert.assertEquals(visibleInterval.fileId, "bbb");List<SeaweedRead.ChunkView> chunkViews = SeaweedRead.viewFromVisibles(visibleIntervals, 0, 233);SeaweedRead.ChunkView chunkView = chunkViews.get(0);- assertEquals(chunkView.offset, 0);- assertEquals(chunkView.size, 100);- assertEquals(chunkView.logicOffset, 0);- assertEquals(chunkView.fileId, "aaa");+ Assert.assertEquals(chunkView.offset, 0);+ Assert.assertEquals(chunkView.size, 100);+ Assert.assertEquals(chunkView.logicOffset, 0);+ Assert.assertEquals(chunkView.fileId, "aaa");chunkView = chunkViews.get(1);- assertEquals(chunkView.offset, 0);- assertEquals(chunkView.size, 133);- assertEquals(chunkView.logicOffset, 100);- assertEquals(chunkView.fileId, "bbb");+ Assert.assertEquals(chunkView.offset, 0);+ Assert.assertEquals(chunkView.size, 133);+ Assert.assertEquals(chunkView.logicOffset, 100);+ Assert.assertEquals(chunkView.fileId, "bbb");}diff --git a/other/java/hdfs/pom.xml b/other/java/hdfs/pom.xmlindex d8d6f8b8ca..a0cab8752a 100644--- a/other/java/hdfs/pom.xml+++ b/other/java/hdfs/pom.xml@@ -154,17 +154,6 @@<artifactId>hadoop-common</artifactId><version>${hadoop.version}</version></dependency>- <dependency>- <groupId>org.apache.httpcomponents</groupId>- <artifactId>httpmime</artifactId>- <version>4.5.6</version>- </dependency>- <dependency>- <groupId>junit</groupId>- <artifactId>junit</artifactId>- <version>4.12</version>- <scope>test</scope>- </dependency></dependencies></project>diff --git a/other/java/hdfs/src/main/java/seaweed/hdfs/SeaweedFileSystemStore.java b/other/java/hdfs/src/main/java/seaweed/hdfs/SeaweedFileSystemStore.javaindex ffc109b203..27678e615f 100644--- a/other/java/hdfs/src/main/java/seaweed/hdfs/SeaweedFileSystemStore.java+++ b/other/java/hdfs/src/main/java/seaweed/hdfs/SeaweedFileSystemStore.java@@ -10,6 +10,7 @@ import org.slf4j.LoggerFactory;import seaweedfs.client.FilerClient;import seaweedfs.client.FilerGrpcClient;import seaweedfs.client.FilerProto;+import seaweedfs.client.SeaweedRead;import java.io.FileNotFoundException;import java.io.IOException;diff --git a/other/java/hdfs/src/main/java/seaweed/hdfs/SeaweedInputStream.java b/other/java/hdfs/src/main/java/seaweed/hdfs/SeaweedInputStream.javaindex c0b296fb9d..90c14c7721 100644--- a/other/java/hdfs/src/main/java/seaweed/hdfs/SeaweedInputStream.java+++ b/other/java/hdfs/src/main/java/seaweed/hdfs/SeaweedInputStream.java@@ -10,6 +10,7 @@ import org.slf4j.Logger;import org.slf4j.LoggerFactory;import seaweedfs.client.FilerGrpcClient;import seaweedfs.client.FilerProto;+import seaweedfs.client.SeaweedRead;import java.io.EOFException;import java.io.IOException;diff --git a/other/java/hdfs/src/main/java/seaweed/hdfs/SeaweedOutputStream.java b/other/java/hdfs/src/main/java/seaweed/hdfs/SeaweedOutputStream.javaindex 4dee4bf099..4f307ff962 100644--- a/other/java/hdfs/src/main/java/seaweed/hdfs/SeaweedOutputStream.java+++ b/other/java/hdfs/src/main/java/seaweed/hdfs/SeaweedOutputStream.java@@ -11,6 +11,7 @@ import org.slf4j.Logger;import org.slf4j.LoggerFactory;import seaweedfs.client.FilerGrpcClient;import seaweedfs.client.FilerProto;+import seaweedfs.client.SeaweedWrite;import java.io.IOException;import java.io.InterruptedIOException;