Browse Source

Merge pull request #29 from chrislusf/master

sync
pull/1620/head
hilimd 4 years ago
committed by GitHub
parent
commit
6e63e5eaf0
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      other/java/client/pom.xml
  2. 2
      other/java/client/pom.xml.deploy
  3. 2
      other/java/client/pom_debug.xml
  4. 2
      other/java/hdfs2/dependency-reduced-pom.xml
  5. 2
      other/java/hdfs2/pom.xml
  6. 2
      other/java/hdfs2/src/main/java/seaweed/hdfs/SeaweedFileSystem.java
  7. 10
      other/java/hdfs2/src/main/java/seaweed/hdfs/SeaweedFileSystemStore.java
  8. 2
      other/java/hdfs3/dependency-reduced-pom.xml
  9. 2
      other/java/hdfs3/pom.xml
  10. 2
      other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedFileSystem.java
  11. 10
      other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedFileSystemStore.java

2
other/java/client/pom.xml

@ -5,7 +5,7 @@
<groupId>com.github.chrislusf</groupId> <groupId>com.github.chrislusf</groupId>
<artifactId>seaweedfs-client</artifactId> <artifactId>seaweedfs-client</artifactId>
<version>1.5.0</version>
<version>1.5.1</version>
<parent> <parent>
<groupId>org.sonatype.oss</groupId> <groupId>org.sonatype.oss</groupId>

2
other/java/client/pom.xml.deploy

@ -5,7 +5,7 @@
<groupId>com.github.chrislusf</groupId> <groupId>com.github.chrislusf</groupId>
<artifactId>seaweedfs-client</artifactId> <artifactId>seaweedfs-client</artifactId>
<version>1.5.0</version>
<version>1.5.1</version>
<parent> <parent>
<groupId>org.sonatype.oss</groupId> <groupId>org.sonatype.oss</groupId>

2
other/java/client/pom_debug.xml

@ -5,7 +5,7 @@
<groupId>com.github.chrislusf</groupId> <groupId>com.github.chrislusf</groupId>
<artifactId>seaweedfs-client</artifactId> <artifactId>seaweedfs-client</artifactId>
<version>1.5.0</version>
<version>1.5.1</version>
<parent> <parent>
<groupId>org.sonatype.oss</groupId> <groupId>org.sonatype.oss</groupId>

2
other/java/hdfs2/dependency-reduced-pom.xml

@ -301,7 +301,7 @@
</snapshotRepository> </snapshotRepository>
</distributionManagement> </distributionManagement>
<properties> <properties>
<seaweedfs.client.version>1.5.0</seaweedfs.client.version>
<seaweedfs.client.version>1.5.1</seaweedfs.client.version>
<hadoop.version>2.9.2</hadoop.version> <hadoop.version>2.9.2</hadoop.version>
</properties> </properties>
</project> </project>

2
other/java/hdfs2/pom.xml

@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<properties> <properties>
<seaweedfs.client.version>1.5.0</seaweedfs.client.version>
<seaweedfs.client.version>1.5.1</seaweedfs.client.version>
<hadoop.version>2.9.2</hadoop.version> <hadoop.version>2.9.2</hadoop.version>
</properties> </properties>

2
other/java/hdfs2/src/main/java/seaweed/hdfs/SeaweedFileSystem.java

@ -61,7 +61,7 @@ public class SeaweedFileSystem extends FileSystem {
setConf(conf); setConf(conf);
this.uri = uri; this.uri = uri;
seaweedFileSystemStore = new SeaweedFileSystemStore(host, port);
seaweedFileSystemStore = new SeaweedFileSystemStore(host, port, conf);
} }

10
other/java/hdfs2/src/main/java/seaweed/hdfs/SeaweedFileSystemStore.java

@ -1,5 +1,6 @@
package seaweed.hdfs; package seaweed.hdfs;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FSInputStream; import org.apache.hadoop.fs.FSInputStream;
import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.FileSystem;
@ -17,17 +18,22 @@ import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import static seaweed.hdfs.SeaweedFileSystem.FS_SEAWEED_BUFFER_SIZE;
import static seaweed.hdfs.SeaweedFileSystem.FS_SEAWEED_DEFAULT_BUFFER_SIZE;
public class SeaweedFileSystemStore { public class SeaweedFileSystemStore {
private static final Logger LOG = LoggerFactory.getLogger(SeaweedFileSystemStore.class); private static final Logger LOG = LoggerFactory.getLogger(SeaweedFileSystemStore.class);
private FilerGrpcClient filerGrpcClient; private FilerGrpcClient filerGrpcClient;
private FilerClient filerClient; private FilerClient filerClient;
private Configuration conf;
public SeaweedFileSystemStore(String host, int port) {
public SeaweedFileSystemStore(String host, int port, Configuration conf) {
int grpcPort = 10000 + port; int grpcPort = 10000 + port;
filerGrpcClient = new FilerGrpcClient(host, grpcPort); filerGrpcClient = new FilerGrpcClient(host, grpcPort);
filerClient = new FilerClient(filerGrpcClient); filerClient = new FilerClient(filerGrpcClient);
this.conf = conf;
} }
public static String getParentDirectory(Path path) { public static String getParentDirectory(Path path) {
@ -123,7 +129,7 @@ public class SeaweedFileSystemStore {
long length = SeaweedRead.fileSize(entry); long length = SeaweedRead.fileSize(entry);
boolean isDir = entry.getIsDirectory(); boolean isDir = entry.getIsDirectory();
int block_replication = 1; int block_replication = 1;
int blocksize = 512;
int blocksize = this.conf.getInt(FS_SEAWEED_BUFFER_SIZE, FS_SEAWEED_DEFAULT_BUFFER_SIZE);
long modification_time = attributes.getMtime() * 1000; // milliseconds long modification_time = attributes.getMtime() * 1000; // milliseconds
long access_time = 0; long access_time = 0;
FsPermission permission = FsPermission.createImmutable((short) attributes.getFileMode()); FsPermission permission = FsPermission.createImmutable((short) attributes.getFileMode());

2
other/java/hdfs3/dependency-reduced-pom.xml

@ -309,7 +309,7 @@
</snapshotRepository> </snapshotRepository>
</distributionManagement> </distributionManagement>
<properties> <properties>
<seaweedfs.client.version>1.5.0</seaweedfs.client.version>
<seaweedfs.client.version>1.5.1</seaweedfs.client.version>
<hadoop.version>3.1.1</hadoop.version> <hadoop.version>3.1.1</hadoop.version>
</properties> </properties>
</project> </project>

2
other/java/hdfs3/pom.xml

@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<properties> <properties>
<seaweedfs.client.version>1.5.0</seaweedfs.client.version>
<seaweedfs.client.version>1.5.1</seaweedfs.client.version>
<hadoop.version>3.1.1</hadoop.version> <hadoop.version>3.1.1</hadoop.version>
</properties> </properties>

2
other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedFileSystem.java

@ -61,7 +61,7 @@ public class SeaweedFileSystem extends FileSystem {
setConf(conf); setConf(conf);
this.uri = uri; this.uri = uri;
seaweedFileSystemStore = new SeaweedFileSystemStore(host, port);
seaweedFileSystemStore = new SeaweedFileSystemStore(host, port, conf);
} }

10
other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedFileSystemStore.java

@ -1,5 +1,6 @@
package seaweed.hdfs; package seaweed.hdfs;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FSInputStream; import org.apache.hadoop.fs.FSInputStream;
import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.FileSystem;
@ -17,17 +18,22 @@ import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import static seaweed.hdfs.SeaweedFileSystem.FS_SEAWEED_BUFFER_SIZE;
import static seaweed.hdfs.SeaweedFileSystem.FS_SEAWEED_DEFAULT_BUFFER_SIZE;
public class SeaweedFileSystemStore { public class SeaweedFileSystemStore {
private static final Logger LOG = LoggerFactory.getLogger(SeaweedFileSystemStore.class); private static final Logger LOG = LoggerFactory.getLogger(SeaweedFileSystemStore.class);
private FilerGrpcClient filerGrpcClient; private FilerGrpcClient filerGrpcClient;
private FilerClient filerClient; private FilerClient filerClient;
private Configuration conf;
public SeaweedFileSystemStore(String host, int port) {
public SeaweedFileSystemStore(String host, int port, Configuration conf) {
int grpcPort = 10000 + port; int grpcPort = 10000 + port;
filerGrpcClient = new FilerGrpcClient(host, grpcPort); filerGrpcClient = new FilerGrpcClient(host, grpcPort);
filerClient = new FilerClient(filerGrpcClient); filerClient = new FilerClient(filerGrpcClient);
this.conf = conf;
} }
public static String getParentDirectory(Path path) { public static String getParentDirectory(Path path) {
@ -123,7 +129,7 @@ public class SeaweedFileSystemStore {
long length = SeaweedRead.fileSize(entry); long length = SeaweedRead.fileSize(entry);
boolean isDir = entry.getIsDirectory(); boolean isDir = entry.getIsDirectory();
int block_replication = 1; int block_replication = 1;
int blocksize = 512;
int blocksize = this.conf.getInt(FS_SEAWEED_BUFFER_SIZE, FS_SEAWEED_DEFAULT_BUFFER_SIZE);
long modification_time = attributes.getMtime() * 1000; // milliseconds long modification_time = attributes.getMtime() * 1000; // milliseconds
long access_time = 0; long access_time = 0;
FsPermission permission = FsPermission.createImmutable((short) attributes.getFileMode()); FsPermission permission = FsPermission.createImmutable((short) attributes.getFileMode());

Loading…
Cancel
Save