Update thrift to 0.16.0 (#1111)
* Bump libthrift dependency
* Regenerate thrift files
* Fix breakage because org.apache.thrift.transport.TFastFramedTransport
got moved to org.apache.thrift.transport.layered.TFastFramedTransport
* Also remove some unused imports
* Ensure the ITs that use accumulo2-maven-plugin use Accumulo's version of libthrift
diff --git a/modules/command/src/main/java/org/apache/fluo/command/FluoWorker.java b/modules/command/src/main/java/org/apache/fluo/command/FluoWorker.java
index 3fd02a7..fc8ab51 100644
--- a/modules/command/src/main/java/org/apache/fluo/command/FluoWorker.java
+++ b/modules/command/src/main/java/org/apache/fluo/command/FluoWorker.java
@@ -19,8 +19,6 @@
import org.apache.fluo.api.client.FluoFactory;
import org.apache.fluo.api.config.FluoConfiguration;
import org.apache.fluo.core.util.UtilWaitThread;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
@Parameters(commandNames = "worker", commandDescription = "Starts Fluo Worker process for <app>")
public class FluoWorker extends AppCommand {
diff --git a/modules/core/src/main/java/org/apache/fluo/core/impl/AsyncReader.java b/modules/core/src/main/java/org/apache/fluo/core/impl/AsyncReader.java
index c549c5a..3bb1885 100644
--- a/modules/core/src/main/java/org/apache/fluo/core/impl/AsyncReader.java
+++ b/modules/core/src/main/java/org/apache/fluo/core/impl/AsyncReader.java
@@ -29,7 +29,6 @@
import org.apache.fluo.api.data.Bytes;
import org.apache.fluo.api.data.Column;
import org.apache.fluo.api.data.RowColumn;
-import org.apache.fluo.core.impl.TransactionImpl;
public class AsyncReader {
private BlockingQueue<AsyncGet> asyncGetsQueue;
diff --git a/modules/core/src/main/java/org/apache/fluo/core/impl/SnapshotScanner.java b/modules/core/src/main/java/org/apache/fluo/core/impl/SnapshotScanner.java
index 8397c15..3defc89 100644
--- a/modules/core/src/main/java/org/apache/fluo/core/impl/SnapshotScanner.java
+++ b/modules/core/src/main/java/org/apache/fluo/core/impl/SnapshotScanner.java
@@ -21,7 +21,6 @@
import java.util.List;
import java.util.Map.Entry;
import java.util.NoSuchElementException;
-import java.util.function.Consumer;
import com.google.common.collect.ImmutableSet;
import org.apache.accumulo.core.client.IteratorSetting;
diff --git a/modules/core/src/main/java/org/apache/fluo/core/impl/TransactionImpl.java b/modules/core/src/main/java/org/apache/fluo/core/impl/TransactionImpl.java
index 9597662..8c32aec 100644
--- a/modules/core/src/main/java/org/apache/fluo/core/impl/TransactionImpl.java
+++ b/modules/core/src/main/java/org/apache/fluo/core/impl/TransactionImpl.java
@@ -75,7 +75,6 @@
import org.apache.fluo.core.async.SyncCommitObserver;
import org.apache.fluo.core.exceptions.AlreadyAcknowledgedException;
import org.apache.fluo.core.exceptions.StaleScanException;
-import org.apache.fluo.core.impl.AsyncReader;
import org.apache.fluo.core.impl.scanner.ScannerBuilderImpl;
import org.apache.fluo.core.oracle.Stamp;
import org.apache.fluo.core.util.ByteUtil;
diff --git a/modules/core/src/main/java/org/apache/fluo/core/oracle/OracleClient.java b/modules/core/src/main/java/org/apache/fluo/core/oracle/OracleClient.java
index cda6e0b..e9547cf 100644
--- a/modules/core/src/main/java/org/apache/fluo/core/oracle/OracleClient.java
+++ b/modules/core/src/main/java/org/apache/fluo/core/oracle/OracleClient.java
@@ -46,10 +46,10 @@
import org.apache.thrift.TException;
import org.apache.thrift.protocol.TCompactProtocol;
import org.apache.thrift.protocol.TProtocol;
-import org.apache.thrift.transport.TFastFramedTransport;
import org.apache.thrift.transport.TSocket;
import org.apache.thrift.transport.TTransport;
import org.apache.thrift.transport.TTransportException;
+import org.apache.thrift.transport.layered.TFastFramedTransport;
import org.apache.zookeeper.KeeperException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/modules/core/src/main/java/org/apache/fluo/core/oracle/OracleServer.java b/modules/core/src/main/java/org/apache/fluo/core/oracle/OracleServer.java
index 71ad696..92a822d 100644
--- a/modules/core/src/main/java/org/apache/fluo/core/oracle/OracleServer.java
+++ b/modules/core/src/main/java/org/apache/fluo/core/oracle/OracleServer.java
@@ -55,11 +55,11 @@
import org.apache.thrift.protocol.TCompactProtocol;
import org.apache.thrift.protocol.TProtocol;
import org.apache.thrift.server.THsHaServer;
-import org.apache.thrift.transport.TFastFramedTransport;
import org.apache.thrift.transport.TNonblockingServerSocket;
import org.apache.thrift.transport.TSocket;
import org.apache.thrift.transport.TTransport;
import org.apache.thrift.transport.TTransportException;
+import org.apache.thrift.transport.layered.TFastFramedTransport;
import org.apache.zookeeper.KeeperException.NoNodeException;
import org.apache.zookeeper.data.Stat;
import org.slf4j.Logger;
@@ -397,7 +397,6 @@
public synchronized void stop() throws Exception {
if (started) {
-
isLeader = false;
server.stop();
diff --git a/modules/core/src/main/java/org/apache/fluo/core/thrift/OracleService.java b/modules/core/src/main/java/org/apache/fluo/core/thrift/OracleService.java
index a0149c4..9c459bf 100644
--- a/modules/core/src/main/java/org/apache/fluo/core/thrift/OracleService.java
+++ b/modules/core/src/main/java/org/apache/fluo/core/thrift/OracleService.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
/**
- * Autogenerated by Thrift Compiler (0.12.0)
+ * Autogenerated by Thrift Compiler (0.16.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
@@ -716,8 +716,6 @@
@Override
public boolean equals(java.lang.Object that) {
- if (that == null)
- return false;
if (that instanceof getTimestamps_args)
return this.equals((getTimestamps_args) that);
return false;
@@ -771,7 +769,7 @@
int lastComparison = 0;
- lastComparison = java.lang.Boolean.valueOf(isSetId()).compareTo(other.isSetId());
+ lastComparison = java.lang.Boolean.compare(isSetId(), other.isSetId());
if (lastComparison != 0) {
return lastComparison;
}
@@ -781,7 +779,7 @@
return lastComparison;
}
}
- lastComparison = java.lang.Boolean.valueOf(isSetNum()).compareTo(other.isSetNum());
+ lastComparison = java.lang.Boolean.compare(isSetNum(), other.isSetNum());
if (lastComparison != 0) {
return lastComparison;
}
@@ -1168,8 +1166,6 @@
@Override
public boolean equals(java.lang.Object that) {
- if (that == null)
- return false;
if (that instanceof getTimestamps_result)
return this.equals((getTimestamps_result) that);
return false;
@@ -1212,7 +1208,7 @@
int lastComparison = 0;
- lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
+ lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
@@ -1514,8 +1510,6 @@
@Override
public boolean equals(java.lang.Object that) {
- if (that == null)
- return false;
if (that instanceof isLeader_args)
return this.equals((isLeader_args) that);
return false;
@@ -1863,8 +1857,6 @@
@Override
public boolean equals(java.lang.Object that) {
- if (that == null)
- return false;
if (that instanceof isLeader_result)
return this.equals((isLeader_result) that);
return false;
@@ -1905,7 +1897,7 @@
int lastComparison = 0;
- lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
+ lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
diff --git a/modules/core/src/main/java/org/apache/fluo/core/thrift/Stamps.java b/modules/core/src/main/java/org/apache/fluo/core/thrift/Stamps.java
index 852dac9..f011a6c 100644
--- a/modules/core/src/main/java/org/apache/fluo/core/thrift/Stamps.java
+++ b/modules/core/src/main/java/org/apache/fluo/core/thrift/Stamps.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
/**
- * Autogenerated by Thrift Compiler (0.12.0)
+ * Autogenerated by Thrift Compiler (0.16.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
@@ -263,8 +263,6 @@
@Override
public boolean equals(java.lang.Object that) {
- if (that == null)
- return false;
if (that instanceof Stamps)
return this.equals((Stamps) that);
return false;
@@ -316,8 +314,7 @@
int lastComparison = 0;
- lastComparison =
- java.lang.Boolean.valueOf(isSetTxStampsStart()).compareTo(other.isSetTxStampsStart());
+ lastComparison = java.lang.Boolean.compare(isSetTxStampsStart(), other.isSetTxStampsStart());
if (lastComparison != 0) {
return lastComparison;
}
@@ -328,7 +325,7 @@
return lastComparison;
}
}
- lastComparison = java.lang.Boolean.valueOf(isSetGcStamp()).compareTo(other.isSetGcStamp());
+ lastComparison = java.lang.Boolean.compare(isSetGcStamp(), other.isSetGcStamp());
if (lastComparison != 0) {
return lastComparison;
}
diff --git a/modules/integration-tests/pom.xml b/modules/integration-tests/pom.xml
index 41cf2a9..b700434 100644
--- a/modules/integration-tests/pom.xml
+++ b/modules/integration-tests/pom.xml
@@ -24,6 +24,10 @@
<artifactId>fluo-integration-tests</artifactId>
<name>Apache Fluo Integration Tests</name>
<description>This module contains Apache Fluo integration tests</description>
+ <properties>
+ <!-- accumulo2-maven-plugin requires the accumulo version of thrift -->
+ <thrift.version>0.12.0</thrift.version>
+ </properties>
<dependencies>
<dependency>
<groupId>com.google.guava</groupId>
diff --git a/modules/mapreduce/pom.xml b/modules/mapreduce/pom.xml
index ef10ca8..ae9f802 100644
--- a/modules/mapreduce/pom.xml
+++ b/modules/mapreduce/pom.xml
@@ -25,6 +25,10 @@
<name>Apache Fluo MapReduce Utilities</name>
<description>This module provides utility code for MapReduce jobs that read from or write to a
Apache Fluo table.</description>
+ <properties>
+ <!-- accumulo2-maven-plugin requires the accumulo version of thrift -->
+ <thrift.version>0.12.0</thrift.version>
+ </properties>
<dependencies>
<dependency>
<groupId>org.apache.accumulo</groupId>
diff --git a/pom.xml b/pom.xml
index b679392..d60fe8f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -66,7 +66,7 @@
<hadoop.version>3.1.1</hadoop.version>
<releaseProfiles>fluo-release</releaseProfiles>
<slf4j.version>1.7.12</slf4j.version>
- <thrift.version>0.12.0</thrift.version>
+ <thrift.version>0.16.0</thrift.version>
<zookeeper.version>3.4.14</zookeeper.version>
</properties>
<dependencyManagement>