Skip to content

Commit

Permalink
README: updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
anhldbk committed Mar 22, 2020
1 parent 893cfbb commit 6093724
Show file tree
Hide file tree
Showing 28 changed files with 80 additions and 28 deletions.
54 changes: 53 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,60 @@ public class Meta {
}
```

## Installation
## Usage

### Installation

```bash
$ scripts/local-install.sh
```

### Dependency

```xml
<dependency>
<groupId>org.apache.avro</groupId>
<artifactId>avro</artifactId>
<version>1.10.0.avro-2723</version>
</dependency>

```

### Code

Simply just use normal Java code, no additional annotations.

```java
public class Human {
String name = "Andy";
ArrayList<Human> friends = new ArrayList<>();
}

ReflectData.UseInitialValueAsDefault reflect = ReflectData.UseInitialValueAsDefault.get();
Schema schema = reflect.getSchema(Human.class);

System.out.println(schema.toString(true));
```

The output:

```json
{
"type" : "record",
"name" : "Human",
"namespace" : "org.apache.avro.reflect.TestReflectUseInitialValueAsDefault",
"fields" : [ {
"name" : "name",
"type" : [ "null", "string" ],
"default" : "Andy"
}, {
"name" : "friends",
"type" : [ "null", {
"type" : "array",
"items" : "Human",
"java-class" : "java.util.ArrayList"
} ],
"default" : [ ]
} ]
}
```
2 changes: 1 addition & 1 deletion lang/java/archetypes/avro-service-archetype/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<artifactId>avro-archetypes-parent</artifactId>
<groupId>org.apache.avro</groupId>
<version>1.10.0-SNAPSHOT</version>
<version>1.10.0.avro-2723</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion lang/java/archetypes/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.avro</groupId>
<artifactId>avro-parent</artifactId>
<version>1.10.0-SNAPSHOT</version>
<version>1.10.0.avro-2723</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion lang/java/avro/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<artifactId>avro-parent</artifactId>
<groupId>org.apache.avro</groupId>
<version>1.10.0-SNAPSHOT</version>
<version>1.10.0.avro-2723</version>
<relativePath>../</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion lang/java/compiler/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<artifactId>avro-parent</artifactId>
<groupId>org.apache.avro</groupId>
<version>1.10.0-SNAPSHOT</version>
<version>1.10.0.avro-2723</version>
<relativePath>../</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion lang/java/grpc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.avro</groupId>
<artifactId>avro-parent</artifactId>
<version>1.10.0-SNAPSHOT</version>
<version>1.10.0.avro-2723</version>
<relativePath>../</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion lang/java/integration-test/codegen-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<artifactId>avro-integration-test</artifactId>
<groupId>org.apache.avro</groupId>
<version>1.10.0-SNAPSHOT</version>
<version>1.10.0.avro-2723</version>
<relativePath>../</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion lang/java/integration-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<artifactId>avro-parent</artifactId>
<groupId>org.apache.avro</groupId>
<version>1.10.0-SNAPSHOT</version>
<version>1.10.0.avro-2723</version>
<relativePath>../</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion lang/java/integration-test/test-custom-conversions/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<artifactId>avro-integration-test</artifactId>
<groupId>org.apache.avro</groupId>
<version>1.10.0-SNAPSHOT</version>
<version>1.10.0.avro-2723</version>
<relativePath>../</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion lang/java/ipc-jetty/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<artifactId>avro-parent</artifactId>
<groupId>org.apache.avro</groupId>
<version>1.10.0-SNAPSHOT</version>
<version>1.10.0.avro-2723</version>
<relativePath>../</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion lang/java/ipc-netty/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<artifactId>avro-parent</artifactId>
<groupId>org.apache.avro</groupId>
<version>1.10.0-SNAPSHOT</version>
<version>1.10.0.avro-2723</version>
<relativePath>../</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion lang/java/ipc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<artifactId>avro-parent</artifactId>
<groupId>org.apache.avro</groupId>
<version>1.10.0-SNAPSHOT</version>
<version>1.10.0.avro-2723</version>
<relativePath>../</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion lang/java/mapred/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<artifactId>avro-parent</artifactId>
<groupId>org.apache.avro</groupId>
<version>1.10.0-SNAPSHOT</version>
<version>1.10.0.avro-2723</version>
<relativePath>../</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion lang/java/maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<artifactId>avro-parent</artifactId>
<groupId>org.apache.avro</groupId>
<version>1.10.0-SNAPSHOT</version>
<version>1.10.0.avro-2723</version>
<relativePath>../</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion lang/java/maven-plugin/src/test/resources/unit/idl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<artifactId>avro-parent</artifactId>
<groupId>org.apache.avro</groupId>
<version>1.10.0-SNAPSHOT</version>
<version>1.10.0.avro-2723</version>
<relativePath>../../../../../../../../../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<artifactId>avro-parent</artifactId>
<groupId>org.apache.avro</groupId>
<version>1.10.0-SNAPSHOT</version>
<version>1.10.0.avro-2723</version>
<relativePath>../../../../../../../../../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<artifactId>avro-parent</artifactId>
<groupId>org.apache.avro</groupId>
<version>1.10.0-SNAPSHOT</version>
<version>1.10.0.avro-2723</version>
<relativePath>../../../../../../../../../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion lang/java/perf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<artifactId>avro-parent</artifactId>
<groupId>org.apache.avro</groupId>
<version>1.10.0-SNAPSHOT</version>
<version>1.10.0.avro-2723</version>
<relativePath>../</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion lang/java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.avro</groupId>
<artifactId>avro-toplevel</artifactId>
<version>1.10.0-SNAPSHOT</version>
<version>1.10.0.avro-2723</version>
<relativePath>../../</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion lang/java/protobuf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<artifactId>avro-parent</artifactId>
<groupId>org.apache.avro</groupId>
<version>1.10.0-SNAPSHOT</version>
<version>1.10.0.avro-2723</version>
<relativePath>../</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion lang/java/thrift/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<artifactId>avro-parent</artifactId>
<groupId>org.apache.avro</groupId>
<version>1.10.0-SNAPSHOT</version>
<version>1.10.0.avro-2723</version>
<relativePath>../</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion lang/java/tools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<artifactId>avro-parent</artifactId>
<groupId>org.apache.avro</groupId>
<version>1.10.0-SNAPSHOT</version>
<version>1.10.0.avro-2723</version>
<relativePath>../</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion lang/java/trevni/avro/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<artifactId>trevni-java</artifactId>
<groupId>org.apache.avro</groupId>
<version>1.10.0-SNAPSHOT</version>
<version>1.10.0.avro-2723</version>
<relativePath>../</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion lang/java/trevni/core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<artifactId>trevni-java</artifactId>
<groupId>org.apache.avro</groupId>
<version>1.10.0-SNAPSHOT</version>
<version>1.10.0.avro-2723</version>
<relativePath>../</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion lang/java/trevni/doc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<artifactId>trevni-java</artifactId>
<groupId>org.apache.avro</groupId>
<version>1.10.0-SNAPSHOT</version>
<version>1.10.0.avro-2723</version>
<relativePath>..</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion lang/java/trevni/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<artifactId>avro-parent</artifactId>
<groupId>org.apache.avro</groupId>
<version>1.10.0-SNAPSHOT</version>
<version>1.10.0.avro-2723</version>
<relativePath>../</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

<groupId>org.apache.avro</groupId>
<artifactId>avro-toplevel</artifactId>
<version>1.10.0-SNAPSHOT</version>
<version>1.10.0.avro-2723</version>
<packaging>pom</packaging>

<name>Apache Avro Toplevel</name>
Expand Down
2 changes: 1 addition & 1 deletion share/VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.10.0-SNAPSHOT
1.10.0.avro-2723

0 comments on commit 6093724

Please sign in to comment.