Skip to content

Commit 676d301

Browse files
authored
feat(java,info): revert java info to pre protobuf version (#727)
* revert to the pre-protobuf version * format * remove extra util class * format * fix
1 parent 6dba1d3 commit 676d301

File tree

18 files changed

+797
-595
lines changed

18 files changed

+797
-595
lines changed

maven-projects/info/pom.xml

Lines changed: 5 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,9 @@
4242
<maven.compiler.source>11</maven.compiler.source>
4343
<maven.compiler.target>11</maven.compiler.target>
4444
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
45-
<protobuf-maven-plugin.version>2.3.0</protobuf-maven-plugin.version>
46-
<protobuf.version>4.27.1</protobuf.version>
4745
</properties>
4846

4947
<dependencies>
50-
<dependency>
51-
<groupId>com.google.protobuf</groupId>
52-
<artifactId>protobuf-java</artifactId>
53-
<version>${protobuf.version}</version>
54-
<scope>compile</scope>
55-
</dependency>
5648
<dependency>
5749
<groupId>junit</groupId>
5850
<artifactId>junit</artifactId>
@@ -65,28 +57,15 @@
6557
<version>2.0</version>
6658
<scope>compile</scope>
6759
</dependency>
60+
<dependency>
61+
<groupId>org.apache.hadoop</groupId>
62+
<artifactId>hadoop-common</artifactId>
63+
<version>3.4.0</version>
64+
</dependency>
6865
</dependencies>
6966

7067
<build>
7168
<plugins>
72-
<plugin>
73-
<groupId>io.github.ascopes</groupId>
74-
<artifactId>protobuf-maven-plugin</artifactId>
75-
<version>${protobuf-maven-plugin.version}</version>
76-
<configuration>
77-
<sourceDirectories>
78-
<sourceDirectory>${project.basedir}/../../format</sourceDirectory>
79-
</sourceDirectories>
80-
<protocVersion>${protobuf.version}</protocVersion>
81-
</configuration>
82-
<executions>
83-
<execution>
84-
<goals>
85-
<goal>generate</goal>
86-
</goals>
87-
</execution>
88-
</executions>
89-
</plugin>
9069
<plugin>
9170
<groupId>com.diffplug.spotless</groupId>
9271
<artifactId>spotless-maven-plugin</artifactId>
@@ -100,54 +79,6 @@
10079
</java>
10180
</configuration>
10281
</plugin>
103-
<plugin>
104-
<groupId>org.apache.maven.plugins</groupId>
105-
<artifactId>maven-shade-plugin</artifactId>
106-
<version>3.6.0</version>
107-
<configuration>
108-
<shadedArtifactAttached>false</shadedArtifactAttached>
109-
<shadeTestJar>false</shadeTestJar>
110-
<artifactSet>
111-
<includes>
112-
<include>com.google.protobuf:*</include>
113-
<include>org.yaml:*</include>
114-
</includes>
115-
</artifactSet>
116-
<relocations>
117-
<relocation>
118-
<pattern>com.google.protobuf</pattern>
119-
<shadedPattern>org.graphar.protobuf</shadedPattern>
120-
<includes>
121-
<include>com.google.protobuf.**</include>
122-
</includes>
123-
</relocation>
124-
<relocation>
125-
<pattern>org.yaml</pattern>
126-
<shadedPattern>org.graphar.yaml</shadedPattern>
127-
<includes>
128-
<include>org.yaml.**</include>
129-
</includes>
130-
</relocation>
131-
</relocations>
132-
<filters>
133-
<filter>
134-
<artifact>*:*</artifact>
135-
<excludes>
136-
<exclude>google/protobuf/**</exclude>
137-
<exclude>yaml/snakeyaml/**</exclude>
138-
</excludes>
139-
</filter>
140-
</filters>
141-
</configuration>
142-
<executions>
143-
<execution>
144-
<phase>package</phase>
145-
<goals>
146-
<goal>shade</goal>
147-
</goals>
148-
</execution>
149-
</executions>
150-
</plugin>
15182
</plugins>
15283
</build>
15384

maven-projects/info/src/main/java/org/apache/graphar/info/AdjacentList.java

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,42 +19,38 @@
1919

2020
package org.apache.graphar.info;
2121

22-
import org.apache.graphar.proto.AdjListType;
23-
import org.apache.graphar.proto.FileType;
22+
import org.apache.graphar.info.type.AdjListType;
23+
import org.apache.graphar.info.type.FileType;
24+
import org.apache.graphar.info.yaml.AdjacentListYaml;
2425

2526
public class AdjacentList {
26-
private final org.apache.graphar.proto.AdjacentList protoAdjacentList;
27+
private final AdjListType type;
28+
private final FileType fileType;
29+
private final String prefix;
2730

2831
public AdjacentList(AdjListType type, FileType fileType, String prefix) {
29-
protoAdjacentList =
30-
org.apache.graphar.proto.AdjacentList.newBuilder()
31-
.setType(type)
32-
.setFileType(fileType)
33-
.setPrefix(prefix)
34-
.build();
32+
this.type = type;
33+
this.fileType = fileType;
34+
this.prefix = prefix;
3535
}
3636

37-
private AdjacentList(org.apache.graphar.proto.AdjacentList protoAdjacentList) {
38-
this.protoAdjacentList = protoAdjacentList;
39-
}
40-
41-
public static AdjacentList ofProto(org.apache.graphar.proto.AdjacentList protoAdjacentList) {
42-
return new AdjacentList(protoAdjacentList);
37+
AdjacentList(AdjacentListYaml yamlParser) {
38+
this.type =
39+
AdjListType.fromOrderedAndAlignedBy(
40+
yamlParser.isOrdered(), yamlParser.getAligned_by());
41+
this.fileType = FileType.fromString(yamlParser.getFile_type());
42+
this.prefix = yamlParser.getPrefix();
4343
}
4444

4545
public AdjListType getType() {
46-
return protoAdjacentList.getType();
46+
return type;
4747
}
4848

4949
public FileType getFileType() {
50-
return protoAdjacentList.getFileType();
50+
return fileType;
5151
}
5252

5353
public String getPrefix() {
54-
return protoAdjacentList.getPrefix();
55-
}
56-
57-
org.apache.graphar.proto.AdjacentList getProto() {
58-
return protoAdjacentList;
54+
return prefix;
5955
}
6056
}

0 commit comments

Comments
 (0)