Skip to content

Commit 4526742

Browse files
committed
add avro services
1 parent 15aa30e commit 4526742

24 files changed

Lines changed: 1598 additions & 2 deletions

.dockerignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

assets/JustATest.avdl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
@namespace("com.neohope.avro.test")
2+
protocol JustATest{
3+
record Person {
4+
string name;
5+
int age;
6+
string sex;
7+
string address;
8+
}
9+
10+
string SayHelloTo(Person person);
11+
int Add(int a,int b);
12+
}
13+

assets/JustATest.avpr

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"protocol" : "JustATest",
3+
"namespace" : "com.neohope.avro.test",
4+
"types" : [ {
5+
"type" : "record",
6+
"name" : "Person",
7+
"fields" : [ {
8+
"name" : "name",
9+
"type" : "string"
10+
}, {
11+
"name" : "age",
12+
"type" : "int"
13+
}, {
14+
"name" : "sex",
15+
"type" : "string"
16+
}, {
17+
"name" : "address",
18+
"type" : "string"
19+
} ]
20+
} ],
21+
"messages" : {
22+
"SayHelloTo" : {
23+
"request" : [ {
24+
"name" : "person",
25+
"type" : "Person"
26+
} ],
27+
"response" : "string"
28+
},
29+
"Add" : {
30+
"request" : [ {
31+
"name" : "a",
32+
"type" : "int"
33+
}, {
34+
"name" : "b",
35+
"type" : "int"
36+
} ],
37+
"response" : "int"
38+
}
39+
}
40+
}

assets/JustATest.gen.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
# Main-Class: org.apache.avro.tool.Main
3+
jarpath=${JCLOUD_HOME}/tool/avro/avro-tools-1.8.1.jar
4+
java -jar $jarpath idl JustATest.avdl JustATest.avpr
5+
java -jar $jarpath compile protocol JustATest.avpr avpr
6+
7+
cp -r avpr/com/neohope ../src/main/java/com/
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/**
2+
* Autogenerated by Avro
3+
*
4+
* DO NOT EDIT DIRECTLY
5+
*/
6+
package com.neohope.avro.test;
7+
8+
@SuppressWarnings("all")
9+
@org.apache.avro.specific.AvroGenerated
10+
public interface JustATest {
11+
public static final org.apache.avro.Protocol PROTOCOL = org.apache.avro.Protocol.parse("{\"protocol\":\"JustATest\",\"namespace\":\"com.neohope.avro.test\",\"types\":[{\"type\":\"record\",\"name\":\"Person\",\"fields\":[{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"age\",\"type\":\"int\"},{\"name\":\"sex\",\"type\":\"string\"},{\"name\":\"address\",\"type\":\"string\"}]}],\"messages\":{\"SayHelloTo\":{\"request\":[{\"name\":\"person\",\"type\":\"Person\"}],\"response\":\"string\"},\"Add\":{\"request\":[{\"name\":\"a\",\"type\":\"int\"},{\"name\":\"b\",\"type\":\"int\"}],\"response\":\"int\"}}}");
12+
/**
13+
*/
14+
java.lang.CharSequence SayHelloTo(com.neohope.avro.test.Person person) throws org.apache.avro.AvroRemoteException;
15+
/**
16+
*/
17+
int Add(int a, int b) throws org.apache.avro.AvroRemoteException;
18+
19+
@SuppressWarnings("all")
20+
public interface Callback extends JustATest {
21+
public static final org.apache.avro.Protocol PROTOCOL = com.neohope.avro.test.JustATest.PROTOCOL;
22+
/**
23+
* @throws java.io.IOException The async call could not be completed.
24+
*/
25+
void SayHelloTo(com.neohope.avro.test.Person person, org.apache.avro.ipc.Callback<java.lang.CharSequence> callback) throws java.io.IOException;
26+
/**
27+
* @throws java.io.IOException The async call could not be completed.
28+
*/
29+
void Add(int a, int b, org.apache.avro.ipc.Callback<java.lang.Integer> callback) throws java.io.IOException;
30+
}
31+
}

0 commit comments

Comments
 (0)