Skip to content

Commit ec0e108

Browse files
author
bs
committed
separate jackson module for core. filesystem config page contribution. filesystem recording contribution. snapshot summary widget for jdbc and filesystem
1 parent 1af3f53 commit ec0e108

68 files changed

Lines changed: 1638 additions & 87 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
package io.drift.core.infra;
2+
3+
import com.fasterxml.jackson.core.JsonGenerator;
4+
import com.fasterxml.jackson.core.JsonParser;
5+
import com.fasterxml.jackson.core.JsonProcessingException;
6+
import com.fasterxml.jackson.databind.DeserializationContext;
7+
import com.fasterxml.jackson.databind.SerializerProvider;
8+
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
9+
import com.fasterxml.jackson.databind.module.SimpleModule;
10+
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
11+
import io.drift.core.system.EnvironmentKey;
12+
import io.drift.core.system.SubSystemEnvironmentKey;
13+
import io.drift.core.system.SubSystemEnvironmentKeyDeserializer;
14+
import io.drift.core.system.SubSystemKey;
15+
16+
import java.io.IOException;
17+
18+
public class DriftCoreJacksonModule extends SimpleModule {
19+
20+
class EnvironmentKeySerializer extends StdSerializer<EnvironmentKey> {
21+
22+
EnvironmentKeySerializer() {
23+
super(EnvironmentKey.class);
24+
}
25+
26+
@Override
27+
public void serialize(EnvironmentKey environmentKey, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
28+
jsonGenerator.writeString(environmentKey.getName());
29+
}
30+
}
31+
32+
class SubSystemKeySerializer extends StdSerializer<SubSystemKey> {
33+
34+
SubSystemKeySerializer() {
35+
super(SubSystemKey.class);
36+
}
37+
38+
@Override
39+
public void serialize(SubSystemKey subSystemKey, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
40+
jsonGenerator.writeString(subSystemKey.getName());
41+
}
42+
}
43+
44+
45+
class EnvironmentKeyDeserializer extends StdDeserializer<EnvironmentKey> {
46+
47+
EnvironmentKeyDeserializer() {
48+
super(EnvironmentKey.class);
49+
}
50+
51+
@Override
52+
public EnvironmentKey deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
53+
return new EnvironmentKey(jsonParser.getValueAsString());
54+
}
55+
}
56+
57+
class SubSystemKeyDeserializer extends StdDeserializer<SubSystemKey> {
58+
59+
SubSystemKeyDeserializer() {
60+
super(SubSystemKey.class);
61+
}
62+
63+
@Override
64+
public SubSystemKey deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
65+
return new SubSystemKey(jsonParser.getValueAsString());
66+
}
67+
}
68+
69+
70+
71+
public DriftCoreJacksonModule() {
72+
super();
73+
addKeyDeserializer(SubSystemEnvironmentKey.class, new SubSystemEnvironmentKeyDeserializer());
74+
75+
addSerializer(new EnvironmentKeySerializer());
76+
addDeserializer(EnvironmentKey.class, new EnvironmentKeyDeserializer());
77+
78+
addSerializer(new SubSystemKeySerializer());
79+
addDeserializer(SubSystemKey.class, new SubSystemKeyDeserializer());
80+
}
81+
82+
83+
}

drift-core/drift-core-domain/src/main/java/io/drift/core/store/serialization/JsonModelSerializer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public Storable loadModel(String content, Class<? extends Storable> storableClas
4747
}
4848
}
4949

50-
public void registerJacksonModule(Module module) {
50+
public void registerModule(Module module) {
5151
objectMapper.registerModule(module);
5252
}
5353
}

drift-core/drift-core-domain/src/main/java/io/drift/core/system/MapSettings.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,4 @@ public void setMap(Map<String, String> map) {
1919
this.map = map;
2020
}
2121

22-
@Override
23-
public SubSystemEnvironmentKey getKey() {
24-
return null;
25-
}
2622
}

drift-core/drift-core-domain/src/main/java/io/drift/core/system/NullDetails.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,4 @@
22

33
public class NullDetails implements SubSystemConnectionDetails{
44

5-
private SubSystemEnvironmentKey subSystemEnvironmentKey;
6-
7-
public NullDetails(SubSystemEnvironmentKey subSystemEnvironmentKey) {
8-
this.subSystemEnvironmentKey = subSystemEnvironmentKey;
9-
}
10-
11-
@Override
12-
public SubSystemEnvironmentKey getKey() {
13-
return subSystemEnvironmentKey;
14-
}
155
}

drift-core/drift-core-domain/src/main/java/io/drift/core/system/SubSystemConnectionDetails.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,4 @@
77
@JsonSubTypes(value={})
88
public interface SubSystemConnectionDetails {
99

10-
public SubSystemEnvironmentKey getKey();
11-
1210
}

drift-core/drift-core-domain/src/main/java/io/drift/core/system/SystemDescription.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public void addConnectionDetails(SubSystemKey subSystemKey, EnvironmentKey envir
4040
public SubSystemConnectionDetails getConnectionDetails(SubSystemKey subSystemKey, EnvironmentKey environmentKey) {
4141
SubSystemEnvironmentKey subSystemEnvironmentKey = new SubSystemEnvironmentKey(subSystemKey, environmentKey);
4242
SubSystemConnectionDetails subSystemConnectionDetails = connectionDetails.get(subSystemEnvironmentKey);
43-
return subSystemConnectionDetails == null ? new NullDetails(subSystemEnvironmentKey) : subSystemConnectionDetails;
43+
return subSystemConnectionDetails == null ? new NullDetails() : subSystemConnectionDetails;
4444
}
4545

4646
public Map<SubSystemKey, SubSystemConnectionDetails> getConnectionDetails(EnvironmentKey environmentKey) {
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/target
2+
.classpath
3+
.project
4+
/.settings
5+
.iml
6+
/.idea
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" version="4">
3+
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
4+
<output url="file://$MODULE_DIR$/target/classes" />
5+
<output-test url="file://$MODULE_DIR$/target/test-classes" />
6+
<content url="file://$MODULE_DIR$">
7+
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
8+
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
9+
<excludeFolder url="file://$MODULE_DIR$/target" />
10+
</content>
11+
<orderEntry type="inheritedJdk" />
12+
<orderEntry type="sourceFolder" forTests="false" />
13+
<orderEntry type="module" module-name="drift-core-domain" />
14+
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.9.8" level="project" />
15+
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.9.0" level="project" />
16+
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.9.8" level="project" />
17+
<orderEntry type="library" name="Maven: com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.9.8" level="project" />
18+
<orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.23" level="project" />
19+
<orderEntry type="library" name="Maven: org.apache.lucene:lucene-core:7.1.0" level="project" />
20+
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.3" level="project" />
21+
<orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.3" level="project" />
22+
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.26" level="project" />
23+
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.11" level="project" />
24+
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
25+
</component>
26+
</module>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<project xmlns="http://maven.apache.org/POM/4.0.0"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
6+
<parent>
7+
<groupId>io.drift</groupId>
8+
<artifactId>drift-filesystem</artifactId>
9+
<version>0.0.3-SNAPSHOT</version>
10+
</parent>
11+
<modelVersion>4.0.0</modelVersion>
12+
13+
<artifactId>drift-filesystem-domain</artifactId>
14+
<packaging>jar</packaging>
15+
<name>Drift :: FileSystem :: Domain</name>
16+
17+
<properties>
18+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
19+
<maven.compiler.source>1.8</maven.compiler.source>
20+
<maven.compiler.target>1.8</maven.compiler.target>
21+
</properties>
22+
23+
<dependencies>
24+
<dependency>
25+
<groupId>io.drift</groupId>
26+
<artifactId>drift-core-domain</artifactId>
27+
</dependency>
28+
<dependency>
29+
<groupId>junit</groupId>
30+
<artifactId>junit</artifactId>
31+
</dependency>
32+
</dependencies>
33+
34+
</project>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package io.drift.filesystem;
2+
3+
import java.io.Serializable;
4+
5+
public class DirectoryDelta extends FileSystemDeltaItem implements Serializable {
6+
7+
public DirectoryDelta() {
8+
}
9+
10+
public DirectoryDelta(String path, FileSystemDeltaType deltaType) {
11+
super(path, deltaType);
12+
}
13+
14+
}

0 commit comments

Comments
 (0)