dbw9580 commented on a change in pull request #2084:
URL: https://github.com/apache/drill/pull/2084#discussion_r467971039



##########
File path: 
contrib/storage-ipfs/src/main/java/org/apache/drill/exec/store/ipfs/IPFSCompat.java
##########
@@ -0,0 +1,284 @@
+/*
+ * 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.drill.exec.store.ipfs;
+
+import io.ipfs.api.IPFS;
+import io.ipfs.api.JSONParser;
+import io.ipfs.multihash.Multihash;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+import java.util.concurrent.atomic.AtomicReference;
+import java.util.function.Consumer;
+import java.util.function.Predicate;
+
+/**
+ * Compatibility fixes for java-ipfs-http-client library
+ *
+ * Supports IPFS up to version v0.4.23, due to new restrictions enforcing all 
API calls to be made with POST method.
+ * Upstream issue tracker: 
https://github.com/ipfs-shipyard/java-ipfs-http-client/issues/157
+ */

Review comment:
       > Drill can't query IPFS version > 0.4.2 due to library restrictions. We 
can't simply upgrade the library because it requires Java 11 and Drill is built 
on Java 8. Is that correct?
   
   Yes, `java-ipfs-http-client` v1.2.3, the last version which requires Java 8, 
supports IPFS up to version 0.4.23, the last release before version 0.5 which 
introduced the incompatibility in 
https://github.com/ipfs-shipyard/java-ipfs-http-client/issues/157. The latest 
library version v.1.3.2 supports IPFS v0.5+ but requires Java 11.
   
   >How criticial would you say this is for functionality?
   
   I'm not sure how many users of IPFS have upgraded to v0.5+, but users can 
[downgrade to a previous version of 
IPFS](https://github.com/ipfs/ipfs-update#revert) if they want to run Drill 
with IPFS support for the time being. Newer IPFS versions bring performance 
improvements, which could help Drill do queries faster, but the basic 
functionalities should be the same.
   
   > Is there some workaround possible so that Drill will work with the latest 
IPFS version?
   
   At a first glance the `java-ipfs-http-client` lib seems to be using some 
features from Java 11, but only in tests. We could fork the library and revert 
the Java target version to 8 and ignore those tests. I need to investigate more 
about this to see if it's really a solution.




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to