Skip to content

Commit

Permalink
t
Browse files Browse the repository at this point in the history
Signed-off-by: Wine93 <[email protected]>
  • Loading branch information
Wine93 committed Nov 2, 2023
1 parent 7fab03d commit 7282e25
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 18 deletions.
21 changes: 21 additions & 0 deletions curvefs/sdk/java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,30 @@
<directory>src/main/resources</directory>
</resource>
</resources>

<plugins>
<!-- any other plugins -->
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
</plugins>
</build>

<dependencies>

<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna-platform</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ private String now() {
return formatter.format(new Date());
}

private int getIndex() {
long id = Thread.currentThread().getId();
}
//private int getIndex() {
// long id = Thread.currentThread().getId();
//}

public void log(String fn, Object... args) {
String value = System.getenv(CURVEFS_DEBUG_ENV_VAR);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.opencurve.curve.fs.flink;

import io.opencurve.curve.fs.common.StackLogger;
import io.opencurve.curve.fs.hadoop.CurveFileSystem;
import org.apache.flink.core.fs.FileSystem;
import org.apache.flink.core.fs.FileSystemFactory;
Expand All @@ -11,32 +12,25 @@

public class CurveFileSystemFactory implements FileSystemFactory {
private org.apache.hadoop.conf.Configuration conf;

private static final String CURVE_FS_CONFIG_PREFIXES = "curvefs.";
private static final String FLINK_CONFIG_PREFIXES = "fs.";
public static String SCHEME = "curvefs";
private static final StackLogger logger =
new StackLogger("CurveFileSystemFactory", 0);

@Override
public void configure(org.apache.flink.configuration.Configuration config) {
conf = new Configuration();
if (config != null) {
for (String key : config.keySet()) {
if (key.startsWith(CURVE_FS_CONFIG_PREFIXES) || key.startsWith(FLINK_CONFIG_PREFIXES)) {
String value = config.getString(key, null);
if (value != null) {
if (CurveFileSystem.class.getCanonicalName().equals(value.trim())) {
SCHEME = key.split("\\.")[1];
}
conf.set(key, value);
}
}
}
}
config.keySet()
.stream()
.filter(key -> key.startsWith(CURVE_FS_CONFIG_PREFIXES) || key.startsWith(FLINK_CONFIG_PREFIXES))
.forEach(key -> conf.set(key, config.getString(key, "")));
}

@Override
public String getScheme() {
return SCHEME;
logger.log("getScheme");
return "hdfs";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ public static List<Entry> getAllUsers() {
}
lib.endpwent();
return users;

//List<Entry> users = new ArrayList<Entry>();
//return users;
}

public static List<Entry> getAllGroups() {
Expand All @@ -101,5 +104,8 @@ public static List<Entry> getAllGroups() {
}
lib.endgrent();
return groups;

//List<Entry> groups = new ArrayList<Entry>();
//return groups;
}
}

0 comments on commit 7282e25

Please sign in to comment.