You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by li...@apache.org on 2022/04/07 17:29:23 UTC

[arrow] branch master updated: ARROW-15917: [Java][Docs] Document how to use Flight artifacts

This is an automated email from the ASF dual-hosted git repository.

lidavidm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new aa0d96b12b ARROW-15917: [Java][Docs] Document how to use Flight artifacts
aa0d96b12b is described below

commit aa0d96b12b39493c5f73e145e852552009623ae6
Author: david dali susanibar arce <da...@gmail.com>
AuthorDate: Thu Apr 7 13:29:08 2022 -0400

    ARROW-15917: [Java][Docs] Document how to use Flight artifacts
    
    Closes #12820 from davisusanibar/java-tutorial-ARROW-15917
    
    Lead-authored-by: david dali susanibar arce <da...@gmail.com>
    Co-authored-by: David Li <li...@gmail.com>
    Signed-off-by: David Li <li...@gmail.com>
---
 docs/source/java/install.rst | 167 ++++++++++++++++++++++++++++++-------------
 1 file changed, 117 insertions(+), 50 deletions(-)

diff --git a/docs/source/java/install.rst b/docs/source/java/install.rst
index ded41a3303..05b9af2259 100644
--- a/docs/source/java/install.rst
+++ b/docs/source/java/install.rst
@@ -28,7 +28,7 @@ Java modules are regularly built and tested on macOS and Linux distributions.
 Java Compatibility
 ------------------
 
-Java modules are currently compatible with Java 8 / 9 / 10 / 11.
+Java modules are currently compatible with JDK 8, 9, 10, or 11, but only JDK 11 is tested in CI.
 
 Installing from Maven
 ---------------------
@@ -36,7 +36,7 @@ Installing from Maven
 By default, Maven will download from the central repository: https://repo.maven.apache.org/maven2/org/apache/arrow/
 
 Configure your pom.xml with the Java modules needed, for example:
-``arrow-memory-netty``, ``arrow-format``, and ``arrow-vector``.
+arrow-vector, and arrow-memory-netty.
 
 .. code-block::
 
@@ -49,7 +49,7 @@ Configure your pom.xml with the Java modules needed, for example:
         <artifactId>demo</artifactId>
         <version>1.0-SNAPSHOT</version>
         <properties>
-            <arrow.version>7.0.0</arrow.version>
+            <arrow.version>8.0.0</arrow.version>
         </properties>
         <dependencies>
             <dependency>
@@ -62,12 +62,43 @@ Configure your pom.xml with the Java modules needed, for example:
                 <artifactId>arrow-memory-netty</artifactId>
                 <version>${arrow.version}</version>
             </dependency>
+        </dependencies>
+    </project>
+
+To use the Arrow Flight dependencies, also add the ``os-maven-plugin``
+plugin. This plugin generates useful platform-dependent properties
+such as ``os.detected.name`` and ``os.detected.arch`` needed to resolve
+transitive dependencies of Flight.
+
+.. code-block::
+
+    <?xml version="1.0" encoding="UTF-8"?>
+    <project xmlns="http://maven.apache.org/POM/4.0.0"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+        <modelVersion>4.0.0</modelVersion>
+        <groupId>org.example</groupId>
+        <artifactId>demo</artifactId>
+        <version>1.0-SNAPSHOT</version>
+        <properties>
+            <arrow.version>8.0.0</arrow.version>
+        </properties>
+        <dependencies>
             <dependency>
                 <groupId>org.apache.arrow</groupId>
-                <artifactId>arrow-format</artifactId>
+                <artifactId>flight-core</artifactId>
                 <version>${arrow.version}</version>
             </dependency>
         </dependencies>
+        <build>
+            <extensions>
+                <extension>
+                    <groupId>kr.motd.maven</groupId>
+                    <artifactId>os-maven-plugin</artifactId>
+                    <version>1.7.0</version>
+                </extension>
+            </extensions>
+        </build>
     </project>
 
 Installing from Source
@@ -87,80 +118,116 @@ The artifacts are uploaded to GitHub. For example, for 2022/03/01, they can be f
 Maven cannot directly use the artifacts from GitHub.
 Instead, install them to the local Maven repository:
 
-1. Decide nightly packages repository to use, for example: https://github.com/ursacomputing/crossbow/releases/tag/nightly-2022-03-03-0-github-java-jars
-2. Add packages to your pom.xml, for example: ``arrow-vector`` and ``arrow-format``:
+1. Decide nightly packages repository to use, for example: https://github.com/ursacomputing/crossbow/releases/tag/nightly-2022-03-19-0-github-java-jars
+2. Add packages to your pom.xml, for example: flight-core (it depends on: arrow-format, arrow-vector, arrow-memeory-core and arrow-memory-netty).
 
 .. code-block:: xml
 
     <properties>
         <maven.compiler.source>8</maven.compiler.source>
         <maven.compiler.target>8</maven.compiler.target>
-        <arrow.version>8.0.0.dev165</arrow.version>
+        <arrow.version>8.0.0.dev254</arrow.version>
     </properties>
 
     <dependencies>
         <dependency>
             <groupId>org.apache.arrow</groupId>
-            <artifactId>arrow-vector</artifactId>
-            <version>${arrow.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.arrow</groupId>
-            <artifactId>arrow-format</artifactId>
+            <artifactId>flight-core</artifactId>
             <version>${arrow.version}</version>
         </dependency>
     </dependencies>
 
-3. Download packages needed to a temporary directory:
+3. Download the necessary pom and jar files to a temporary directory:
 
 .. code-block:: shell
 
-    $ mkdir nightly-2022-03-03-0-github-java-jars
-    $ cd nightly-2022-03-03-0-github-java-jars
-    $ wget https://github.com/ursacomputing/crossbow/releases/download/nightly-2022-03-03-0-github-java-jars/arrow-vector-8.0.0.dev165.jar
-    $ wget https://github.com/ursacomputing/crossbow/releases/download/nightly-2022-03-03-0-github-java-jars/arrow-format-8.0.0.dev165.jar
+    $ mkdir nightly-2022-03-19-0-github-java-jars
+    $ cd nightly-2022-03-19-0-github-java-jars
+    $ wget https://github.com/ursacomputing/crossbow/releases/download/nightly-2022-03-19-0-github-java-jars/arrow-java-root-8.0.0.dev254.pom
+    $ wget https://github.com/ursacomputing/crossbow/releases/download/nightly-2022-03-19-0-github-java-jars/arrow-format-8.0.0.dev254.pom
+    $ wget https://github.com/ursacomputing/crossbow/releases/download/nightly-2022-03-19-0-github-java-jars/arrow-format-8.0.0.dev254.jar
+    $ wget https://github.com/ursacomputing/crossbow/releases/download/nightly-2022-03-19-0-github-java-jars/arrow-vector-8.0.0.dev254.pom
+    $ wget https://github.com/ursacomputing/crossbow/releases/download/nightly-2022-03-19-0-github-java-jars/arrow-vector-8.0.0.dev254.jar
+    $ wget https://github.com/ursacomputing/crossbow/releases/download/nightly-2022-03-19-0-github-java-jars/arrow-memory-8.0.0.dev254.pom
+    $ wget https://github.com/ursacomputing/crossbow/releases/download/nightly-2022-03-19-0-github-java-jars/arrow-memory-core-8.0.0.dev254.pom
+    $ wget https://github.com/ursacomputing/crossbow/releases/download/nightly-2022-03-19-0-github-java-jars/arrow-memory-netty-8.0.0.dev254.pom
+    $ wget https://github.com/ursacomputing/crossbow/releases/download/nightly-2022-03-19-0-github-java-jars/arrow-memory-core-8.0.0.dev254.jar
+    $ wget https://github.com/ursacomputing/crossbow/releases/download/nightly-2022-03-19-0-github-java-jars/arrow-memory-netty-8.0.0.dev254.jar
+    $ wget https://github.com/ursacomputing/crossbow/releases/download/nightly-2022-03-19-0-github-java-jars/arrow-flight-8.0.0.dev254.pom
+    $ wget https://github.com/ursacomputing/crossbow/releases/download/nightly-2022-03-19-0-github-java-jars/flight-core-8.0.0.dev254.pom
+    $ wget https://github.com/ursacomputing/crossbow/releases/download/nightly-2022-03-19-0-github-java-jars/flight-core-8.0.0.dev254.jar
     $ tree
-    |__ arrow-format-8.0.0.dev165.jar
-    |__ arrow-vector-8.0.0.dev165.jar
+    .
+    ├── arrow-flight-8.0.0.dev254.pom
+    ├── arrow-format-8.0.0.dev254.jar
+    ├── arrow-format-8.0.0.dev254.pom
+    ├── arrow-java-root-8.0.0.dev254.pom
+    ├── arrow-memory-8.0.0.dev254.pom
+    ├── arrow-memory-core-8.0.0.dev254.jar
+    ├── arrow-memory-core-8.0.0.dev254.pom
+    ├── arrow-memory-netty-8.0.0.dev254.jar
+    ├── arrow-memory-netty-8.0.0.dev254.pom
+    ├── arrow-vector-8.0.0.dev254.jar
+    ├── arrow-vector-8.0.0.dev254.pom
+    ├── flight-core-8.0.0.dev254.jar
+    └── flight-core-8.0.0.dev254.pom
 
 4. Install the artifacts to the local Maven repository with ``mvn install:install-file``:
 
 .. code-block:: shell
 
-    $ mvn install:install-file \
-        -Dfile="$(pwd)/arrow-format-8.0.0.dev165.jar" \
-        -DgroupId=org.apache.arrow \
-        -DartifactId=arrow-format \
-        -Dversion=8.0.0.dev165 \
-        -Dpackaging=jar \
-        -DcreateChecksum=true \
-        -Dgenerate.pom=true
-    [INFO] Installing /nightly-2022-03-03-0-github-java-jars/arrow-format-8.0.0.dev165.jar to /Users/arrow/.m2/repository/org/apache/arrow/arrow-format/8.0.0.dev165/arrow-format-8.0.0.dev165.jar
-    $ mvn install:install-file \
-        -Dfile="$(pwd)/arrow-vector-8.0.0.dev165.jar" \
-        -DgroupId=org.apache.arrow \
-        -DartifactId=arrow-vector \
-        -Dversion=8.0.0.dev165 \
-        -Dpackaging=jar \
-        -DcreateChecksum=true \
-        -Dgenerate.pom=true
-    [INFO] Installing /nightly-2022-03-03-0-github-java-jars/arrow-vector-8.0.0.dev165.jar to /Users/arrow/.m2/repository/org/apache/arrow/arrow-vector/8.0.0.dev165/arrow-vector-8.0.0.dev165.jar
+    $ mvn install:install-file -Dfile="$(pwd)/arrow-java-root-8.0.0.dev254.pom" -DgroupId=org.apache.arrow -DartifactId=arrow-java-root -Dversion=8.0.0.dev254 -Dpackaging=pom
+    $ mvn install:install-file -Dfile="$(pwd)/arrow-format-8.0.0.dev254.pom" -DgroupId=org.apache.arrow -DartifactId=arrow-format -Dversion=8.0.0.dev254 -Dpackaging=pom
+    $ mvn install:install-file -Dfile="$(pwd)/arrow-format-8.0.0.dev254.jar" -DgroupId=org.apache.arrow -DartifactId=arrow-format -Dversion=8.0.0.dev254 -Dpackaging=jar
+    $ mvn install:install-file -Dfile="$(pwd)/arrow-vector-8.0.0.dev254.pom" -DgroupId=org.apache.arrow -DartifactId=arrow-vector -Dversion=8.0.0.dev254 -Dpackaging=pom
+    $ mvn install:install-file -Dfile="$(pwd)/arrow-vector-8.0.0.dev254.jar" -DgroupId=org.apache.arrow -DartifactId=arrow-vector -Dversion=8.0.0.dev254 -Dpackaging=jar
+    $ mvn install:install-file -Dfile="$(pwd)/arrow-memory-8.0.0.dev254.pom" -DgroupId=org.apache.arrow -DartifactId=arrow-memory -Dversion=8.0.0.dev254 -Dpackaging=pom
+    $ mvn install:install-file -Dfile="$(pwd)/arrow-memory-core-8.0.0.dev254.pom" -DgroupId=org.apache.arrow -DartifactId=arrow-memory-core -Dversion=8.0.0.dev254 -Dpackaging=pom
+    $ mvn install:install-file -Dfile="$(pwd)/arrow-memory-netty-8.0.0.dev254.pom" -DgroupId=org.apache.arrow -DartifactId=arrow-memory-netty -Dversion=8.0.0.dev254 -Dpackaging=pom
+    $ mvn install:install-file -Dfile="$(pwd)/arrow-memory-core-8.0.0.dev254.jar" -DgroupId=org.apache.arrow -DartifactId=arrow-memory-core -Dversion=8.0.0.dev254 -Dpackaging=jar
+    $ mvn install:install-file -Dfile="$(pwd)/arrow-memory-netty-8.0.0.dev254.jar" -DgroupId=org.apache.arrow -DartifactId=arrow-memory-netty -Dversion=8.0.0.dev254 -Dpackaging=jar
+    $ mvn install:install-file -Dfile="$(pwd)/arrow-flight-8.0.0.dev254.pom" -DgroupId=org.apache.arrow -DartifactId=arrow-flight -Dversion=8.0.0.dev254 -Dpackaging=pom
+    $ mvn install:install-file -Dfile="$(pwd)/flight-core-8.0.0.dev254.pom" -DgroupId=org.apache.arrow -DartifactId=flight-core -Dversion=8.0.0.dev254 -Dpackaging=pom
+    $ mvn install:install-file -Dfile="$(pwd)/flight-core-8.0.0.dev254.jar" -DgroupId=org.apache.arrow -DartifactId=flight-core -Dversion=8.0.0.dev254 -Dpackaging=jar
 
 5. Validate that the packages were installed:
 
 .. code-block:: shell
 
-    $ tree /Users/arrow/.m2/repository/org/apache/arrow
-    |__ arrow-format
-        |__ 8.0.0.dev165
-            |__ arrow-format-8.0.0.dev165.jar
-            |__ arrow-format-8.0.0.dev165.pom
-    |__ arrow-vector
-        |__ 8.0.0.dev165
-            |__ arrow-vector-8.0.0.dev165.jar
-            |__ arrow-vector-8.0.0.dev165.pom
-
-6. Compile your project like usual with ``mvn install``.
+    $ tree ~/.m2/repository/org/apache/arrow
+    .
+    ├── arrow-flight
+    │   ├── 8.0.0.dev254
+    │   │   └── arrow-flight-8.0.0.dev254.pom
+    ├── arrow-format
+    │   ├── 8.0.0.dev254
+    │   │   ├── arrow-format-8.0.0.dev254.jar
+    │   │   └── arrow-format-8.0.0.dev254.pom
+    ├── arrow-java-root
+    │   ├── 8.0.0.dev254
+    │   │   └── arrow-java-root-8.0.0.dev254.pom
+    ├── arrow-memory
+    │   ├── 8.0.0.dev254
+    │   │   └── arrow-memory-8.0.0.dev254.pom
+    ├── arrow-memory-core
+    │   ├── 8.0.0.dev254
+    │   │   ├── arrow-memory-core-8.0.0.dev254.jar
+    │   │   └── arrow-memory-core-8.0.0.dev254.pom
+    ├── arrow-memory-netty
+    │   ├── 8.0.0.dev254
+    │   │   ├── arrow-memory-netty-8.0.0.dev254.jar
+    │   │   └── arrow-memory-netty-8.0.0.dev254.pom
+    ├── arrow-vector
+    │   ├── 8.0.0.dev254
+    │   │   ├── _remote.repositories
+    │   │   ├── arrow-vector-8.0.0.dev254.jar
+    │   │   └── arrow-vector-8.0.0.dev254.pom
+    └── flight-core
+        ├── 8.0.0.dev254
+        │   ├── flight-core-8.0.0.dev254.jar
+        │   └── flight-core-8.0.0.dev254.pom
+
+6. Compile your project like usual with ``mvn clean install``.
 
 .. _builds@arrow.apache.org: https://lists.apache.org/list.html?builds@arrow.apache.org
-.. _Github Nightly: https://github.com/ursacomputing/crossbow/releases/tag/nightly-2022-03-01-0-github-java-jars
\ No newline at end of file
+.. _Github Nightly: https://github.com/ursacomputing/crossbow/releases/tag/nightly-2022-03-19-0-github-java-jars
\ No newline at end of file