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 2020/11/04 01:54:13 UTC

[GitHub] [arrow] lidavidm commented on a change in pull request #8572: ARROW-10467: [Java] Add the ability to pass arbitrary client headers.

lidavidm commented on a change in pull request #8572:
URL: https://github.com/apache/arrow/pull/8572#discussion_r517054957



##########
File path: java/flight/flight-core/src/test/java/org/apache/arrow/flight/TestCallOptions.java
##########
@@ -64,6 +67,61 @@ public void underTimeout() {
     });
   }
 
+  @Test
+  public void singleProperty() {
+    final MetadataAdapter headers = new MetadataAdapter(new Metadata());

Review comment:
       We probably need a CallHeaders implementation that doesn't come from the flight-grpc package, or there's no way to use HeaderCallOption.

##########
File path: java/flight/flight-core/src/main/java/org/apache/arrow/flight/FlightConstants.java
##########
@@ -23,5 +23,6 @@
 public interface FlightConstants {
 
   String SERVICE = "arrow.flight.protocol.FlightService";
+  String PROPERTY_HEADER = "Arrow-Properties";

Review comment:
       Let's rename this to something more specific (HEADERS_KEY?) and make it an instance of `FlightServerMiddleware.Key`. Let's also change the constant to something that's more clearly namespaced under arrow, e.g. "org.apache.arrow.flight.ServerHeaderHandler".

##########
File path: java/flight/flight-core/src/main/java/org/apache/arrow/flight/ServerHeaderHandler.java
##########
@@ -0,0 +1,30 @@
+/*
+ * 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.
+ */
+
+package org.apache.arrow.flight;
+
+import java.util.function.Consumer;
+
+/**
+ * Interface for server side property handling.
+ */
+public interface ServerHeaderHandler extends Consumer<CallHeaders> {

Review comment:
       This interface confuses me, as it seems within an RPC handler, there's no way to get the headers associated with that particular call.




----------------------------------------------------------------
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.

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