You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/04/11 22:03:00 UTC

[GitHub] [arrow] BryanCutler commented on a diff in pull request #12847: ARROW-15577: [Java][Doc] WIP - Apache Arrow Flight documentation

BryanCutler commented on code in PR #12847:
URL: https://github.com/apache/arrow/pull/12847#discussion_r847731406


##########
docs/source/java/flight.rst:
##########
@@ -0,0 +1,296 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+================
+Arrow Flight RPC
+================
+
+Arrow Flight is an RPC framework for efficient transfer of Flight data
+over the network.
+
+.. contents::
+
+.. seealso::
+
+   :doc:`Flight protocol documentation <../format/Flight>`
+        Documentation of the Flight protocol, including how to use
+        Flight conceptually.
+
+   `Java Cookbook <https://arrow.apache.org/cookbook/java/flight.html>`_
+        Recipes for using Arrow Flight in Java.
+
+Writing a Flight Service
+========================
+
+Flight servers implement the `FlightProducer`_ interface. For convenience,
+they can subclass `NoOpFlightProducer`_ instead, which offers default
+implementations of all the RPC methods.
+
+.. code-block:: Java
+
+    public class TutorialFlightProducer implements FlightProducer {
+        @Override
+        // Override methods or use NoOpFlightProducer for only methods needed
+    }
+
+To start a server, create a `Location`_ to specify where to listen, and then create
+a `FlightServer`_ with an instance of a producer. This will start the server, but
+won't block the rest of the program. Call ``FlightServer.awaitTermination``
+to block until the server stops.
+
+.. code-block:: Java
+
+    import org.apache.arrow.flight.Action;
+    import org.apache.arrow.flight.ActionType;
+    import org.apache.arrow.flight.Criteria;
+    import org.apache.arrow.flight.FlightDescriptor;
+    import org.apache.arrow.flight.FlightInfo;
+    import org.apache.arrow.flight.FlightProducer;
+    import org.apache.arrow.flight.FlightServer;
+    import org.apache.arrow.flight.FlightStream;
+    import org.apache.arrow.flight.Location;
+    import org.apache.arrow.flight.PutResult;
+    import org.apache.arrow.flight.Result;
+    import org.apache.arrow.flight.SchemaResult;
+    import org.apache.arrow.flight.Ticket;
+    import org.apache.arrow.memory.BufferAllocator;
+    import org.apache.arrow.memory.RootAllocator;
+    import org.apache.arrow.util.AutoCloseables;
+
+    class TutorialFlightProducer implements FlightProducer {
+        @Override
+        // Override methods or use NoOpFlightProducer for only methods needed
+    }
+
+    Location location = Location.forGrpcInsecure("0.0.0.0", 0);
+
+    try(
+        BufferAllocator allocator = new RootAllocator();
+        FlightServer server = FlightServer.builder(

Review Comment:
   Would it make sense to use the `FlightTestUtil.getStartedServer()`? 



##########
docs/source/java/flight.rst:
##########
@@ -0,0 +1,296 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+================
+Arrow Flight RPC
+================
+
+Arrow Flight is an RPC framework for efficient transfer of Flight data

Review Comment:
   Maybe "efficient transfer of Arrow data" ?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org