Skip to content

Commit 22ddd6e

Browse files
committed
move shading of the thrift jar to the storm-core pom
rename 'thrift7' back to 'thrift' in imports remove 'storm-deps' submodule
1 parent d84eb23 commit 22ddd6e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+2850
-3108
lines changed

pom.xml

+4-9
Original file line numberDiff line numberDiff line change
@@ -405,17 +405,12 @@
405405
<scope>test</scope>
406406
</dependency>
407407
<dependency>
408-
<groupId>org.apache.storm</groupId>
409-
<artifactId>libthrift7</artifactId>
410-
<version>${project.version}</version>
408+
<groupId>org.apache.thrift</groupId>
409+
<artifactId>libthrift</artifactId>
410+
<version>0.7.0</version>
411411
<scope>compile</scope>
412-
<exclusions>
413-
<exclusion>
414-
<groupId>org.slf4j</groupId>
415-
<artifactId>slf4j-api</artifactId>
416-
</exclusion>
417-
</exclusions>
418412
</dependency>
413+
419414
</dependencies>
420415
</dependencyManagement>
421416

storm-core/pom.xml

+57-2
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,19 @@
8888
<artifactId>commons-exec</artifactId>
8989
</dependency>
9090
<dependency>
91-
<groupId>org.apache.storm</groupId>
92-
<artifactId>libthrift7</artifactId>
91+
<groupId>org.apache.thrift</groupId>
92+
<artifactId>libthrift</artifactId>
93+
<version>0.7.0</version>
94+
<scope>compile</scope>
95+
<exclusions>
96+
<exclusion>
97+
<groupId>org.slf4j</groupId>
98+
<artifactId>slf4j-api</artifactId>
99+
</exclusion>
100+
</exclusions>
93101
</dependency>
94102

103+
95104
<dependency>
96105
<groupId>com.netflix.curator</groupId>
97106
<artifactId>curator-framework</artifactId>
@@ -201,6 +210,52 @@
201210
</reportsDirectories>
202211
</configuration>
203212
</plugin>
213+
<plugin>
214+
<groupId>org.apache.maven.plugins</groupId>
215+
<artifactId>maven-shade-plugin</artifactId>
216+
<version>2.2</version>
217+
<executions>
218+
<execution>
219+
<phase>package</phase>
220+
<goals>
221+
<goal>shade</goal>
222+
</goals>
223+
</execution>
224+
</executions>
225+
<configuration>
226+
<keepDependenciesWithProvidedScope>true</keepDependenciesWithProvidedScope>
227+
<promoteTransitiveDependencies>true</promoteTransitiveDependencies>
228+
<createDependencyReducedPom>true</createDependencyReducedPom>
229+
<promoteTransitiveDependencies>false</promoteTransitiveDependencies>
230+
<artifactSet>
231+
<includes>
232+
<include>org.apache.thrift:*</include>
233+
</includes>
234+
</artifactSet>
235+
236+
<relocations>
237+
<relocation>
238+
<pattern>org.apache.thrift</pattern>
239+
<shadedPattern>org.apache.thrift7</shadedPattern>
240+
</relocation>
241+
</relocations>
242+
<filters>
243+
<filter>
244+
<artifact>*:*</artifact>
245+
<excludes>
246+
<exclude>META-INF/license/**</exclude>
247+
<exclude>META-INF/*</exclude>
248+
<exclude>META-INF/maven/**</exclude>
249+
<exclude>LICENSE</exclude>
250+
<exclude>NOTICE</exclude>
251+
<exclude>/*.txt</exclude>
252+
<exclude>build.properties</exclude>
253+
</excludes>
254+
</filter>
255+
</filters>
256+
</configuration>
257+
</plugin>
258+
204259
</plugins>
205260
</build>
206261
</project>

storm-core/src/clj/backtype/storm/daemon/drpc.clj

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
;; See the License for the specific language governing permissions and
1515
;; limitations under the License.
1616
(ns backtype.storm.daemon.drpc
17-
(:import [org.apache.thrift7.server THsHaServer THsHaServer$Args])
18-
(:import [org.apache.thrift7.protocol TBinaryProtocol TBinaryProtocol$Factory])
19-
(:import [org.apache.thrift7 TException])
20-
(:import [org.apache.thrift7.transport TNonblockingServerTransport TNonblockingServerSocket])
17+
(:import [org.apache.thrift.server THsHaServer THsHaServer$Args])
18+
(:import [org.apache.thrift.protocol TBinaryProtocol TBinaryProtocol$Factory])
19+
(:import [org.apache.thrift.exception])
20+
(:import [org.apache.thrift.transport TNonblockingServerTransport TNonblockingServerSocket])
2121
(:import [backtype.storm.generated DistributedRPC DistributedRPC$Iface DistributedRPC$Processor
2222
DRPCRequest DRPCExecutionException DistributedRPCInvocations DistributedRPCInvocations$Iface
2323
DistributedRPCInvocations$Processor])

storm-core/src/clj/backtype/storm/daemon/nimbus.clj

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
;; See the License for the specific language governing permissions and
1515
;; limitations under the License.
1616
(ns backtype.storm.daemon.nimbus
17-
(:import [org.apache.thrift7.server THsHaServer THsHaServer$Args])
18-
(:import [org.apache.thrift7.protocol TBinaryProtocol TBinaryProtocol$Factory])
19-
(:import [org.apache.thrift7 TException])
20-
(:import [org.apache.thrift7.transport TNonblockingServerTransport TNonblockingServerSocket])
17+
(:import [org.apache.thrift.server THsHaServer THsHaServer$Args])
18+
(:import [org.apache.thrift.protocol TBinaryProtocol TBinaryProtocol$Factory])
19+
(:import [org.apache.thrift.exception])
20+
(:import [org.apache.thrift.transport TNonblockingServerTransport TNonblockingServerSocket])
2121
(:import [java.nio ByteBuffer])
2222
(:import [java.io FileNotFoundException])
2323
(:import [java.nio.channels Channels WritableByteChannel])

storm-core/src/clj/backtype/storm/thrift.clj

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
(:import [backtype.storm.grouping CustomStreamGrouping])
2424
(:import [backtype.storm.topology TopologyBuilder])
2525
(:import [backtype.storm.clojure RichShellBolt RichShellSpout])
26-
(:import [org.apache.thrift7.protocol TBinaryProtocol TProtocol])
27-
(:import [org.apache.thrift7.transport TTransport TFramedTransport TSocket])
26+
(:import [org.apache.thrift.protocol TBinaryProtocol TProtocol])
27+
(:import [org.apache.thrift.transport TTransport TFramedTransport TSocket])
2828
(:use [backtype.storm util config log])
2929
)
3030

storm-core/src/jvm/backtype/storm/StormSubmitter.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import java.util.Map;
2727
import org.slf4j.Logger;
2828
import org.slf4j.LoggerFactory;
29-
import org.apache.thrift7.TException;
29+
import org.apache.thrift.TException;
3030
import org.json.simple.JSONValue;
3131

3232
/**

storm-core/src/jvm/backtype/storm/drpc/DRPCInvocationsClient.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919

2020
import backtype.storm.generated.DRPCRequest;
2121
import backtype.storm.generated.DistributedRPCInvocations;
22-
import org.apache.thrift7.TException;
23-
import org.apache.thrift7.protocol.TBinaryProtocol;
24-
import org.apache.thrift7.transport.TFramedTransport;
25-
import org.apache.thrift7.transport.TSocket;
26-
import org.apache.thrift7.transport.TTransport;
22+
import org.apache.thrift.TException;
23+
import org.apache.thrift.protocol.TBinaryProtocol;
24+
import org.apache.thrift.transport.TFramedTransport;
25+
import org.apache.thrift.transport.TSocket;
26+
import org.apache.thrift.transport.TTransport;
2727

2828
public class DRPCInvocationsClient implements DistributedRPCInvocations.Iface {
2929
private TTransport conn;

storm-core/src/jvm/backtype/storm/drpc/DRPCSpout.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
import java.util.Map;
3636
import org.slf4j.Logger;
3737
import org.slf4j.LoggerFactory;
38-
import org.apache.thrift7.TException;
38+
import org.apache.thrift.TException;
3939
import org.json.simple.JSONValue;
4040

4141
public class DRPCSpout extends BaseRichSpout {
@@ -114,7 +114,7 @@ public void nextTuple() {
114114
_collector.emit(new Values(req.get_func_args(), JSONValue.toJSONString(returnInfo)), new DRPCMessageId(req.get_request_id(), i));
115115
break;
116116
}
117-
} catch (TException e) {
117+
} catch (Exception e) {
118118
LOG.error("Failed to fetch DRPC result from DRPC server", e);
119119
}
120120
}

storm-core/src/jvm/backtype/storm/drpc/ReturnResults.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
import java.util.Map;
3333
import org.slf4j.Logger;
3434
import org.slf4j.LoggerFactory;
35-
import org.apache.thrift7.TException;
35+
import org.apache.thrift.TException;
3636
import org.json.simple.JSONValue;
3737

3838

storm-core/src/jvm/backtype/storm/generated/AlreadyAliveException.java

+23-23
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@
3838
import org.slf4j.Logger;
3939
import org.slf4j.LoggerFactory;
4040

41-
public class AlreadyAliveException extends Exception implements org.apache.thrift7.TBase<AlreadyAliveException, AlreadyAliveException._Fields>, java.io.Serializable, Cloneable {
42-
private static final org.apache.thrift7.protocol.TStruct STRUCT_DESC = new org.apache.thrift7.protocol.TStruct("AlreadyAliveException");
41+
public class AlreadyAliveException extends Exception implements org.apache.thrift.TBase<AlreadyAliveException, AlreadyAliveException._Fields>, java.io.Serializable, Cloneable {
42+
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("AlreadyAliveException");
4343

44-
private static final org.apache.thrift7.protocol.TField MSG_FIELD_DESC = new org.apache.thrift7.protocol.TField("msg", org.apache.thrift7.protocol.TType.STRING, (short)1);
44+
private static final org.apache.thrift.protocol.TField MSG_FIELD_DESC = new org.apache.thrift.protocol.TField("msg", org.apache.thrift.protocol.TType.STRING, (short)1);
4545

4646
private String msg; // required
4747

4848
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
49-
public enum _Fields implements org.apache.thrift7.TFieldIdEnum {
49+
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
5050
MSG((short)1, "msg");
5151

5252
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@@ -105,13 +105,13 @@ public String getFieldName() {
105105

106106
// isset id assignments
107107

108-
public static final Map<_Fields, org.apache.thrift7.meta_data.FieldMetaData> metaDataMap;
108+
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
109109
static {
110-
Map<_Fields, org.apache.thrift7.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift7.meta_data.FieldMetaData>(_Fields.class);
111-
tmpMap.put(_Fields.MSG, new org.apache.thrift7.meta_data.FieldMetaData("msg", org.apache.thrift7.TFieldRequirementType.REQUIRED,
112-
new org.apache.thrift7.meta_data.FieldValueMetaData(org.apache.thrift7.protocol.TType.STRING)));
110+
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
111+
tmpMap.put(_Fields.MSG, new org.apache.thrift.meta_data.FieldMetaData("msg", org.apache.thrift.TFieldRequirementType.REQUIRED,
112+
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
113113
metaDataMap = Collections.unmodifiableMap(tmpMap);
114-
org.apache.thrift7.meta_data.FieldMetaData.addStructMetaDataMap(AlreadyAliveException.class, metaDataMap);
114+
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(AlreadyAliveException.class, metaDataMap);
115115
}
116116

117117
public AlreadyAliveException() {
@@ -250,7 +250,7 @@ public int compareTo(AlreadyAliveException other) {
250250
return lastComparison;
251251
}
252252
if (is_set_msg()) {
253-
lastComparison = org.apache.thrift7.TBaseHelper.compareTo(this.msg, typedOther.msg);
253+
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.msg, typedOther.msg);
254254
if (lastComparison != 0) {
255255
return lastComparison;
256256
}
@@ -262,33 +262,33 @@ public _Fields fieldForId(int fieldId) {
262262
return _Fields.findByThriftId(fieldId);
263263
}
264264

265-
public void read(org.apache.thrift7.protocol.TProtocol iprot) throws org.apache.thrift7.TException {
266-
org.apache.thrift7.protocol.TField field;
265+
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
266+
org.apache.thrift.protocol.TField field;
267267
iprot.readStructBegin();
268268
while (true)
269269
{
270270
field = iprot.readFieldBegin();
271-
if (field.type == org.apache.thrift7.protocol.TType.STOP) {
271+
if (field.type == org.apache.thrift.protocol.TType.STOP) {
272272
break;
273273
}
274274
switch (field.id) {
275275
case 1: // MSG
276-
if (field.type == org.apache.thrift7.protocol.TType.STRING) {
276+
if (field.type == org.apache.thrift.protocol.TType.STRING) {
277277
this.msg = iprot.readString();
278278
} else {
279-
org.apache.thrift7.protocol.TProtocolUtil.skip(iprot, field.type);
279+
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
280280
}
281281
break;
282282
default:
283-
org.apache.thrift7.protocol.TProtocolUtil.skip(iprot, field.type);
283+
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
284284
}
285285
iprot.readFieldEnd();
286286
}
287287
iprot.readStructEnd();
288288
validate();
289289
}
290290

291-
public void write(org.apache.thrift7.protocol.TProtocol oprot) throws org.apache.thrift7.TException {
291+
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
292292
validate();
293293

294294
oprot.writeStructBegin(STRUCT_DESC);
@@ -317,26 +317,26 @@ public String toString() {
317317
return sb.toString();
318318
}
319319

320-
public void validate() throws org.apache.thrift7.TException {
320+
public void validate() throws org.apache.thrift.TException {
321321
// check for required fields
322322
if (!is_set_msg()) {
323-
throw new org.apache.thrift7.protocol.TProtocolException("Required field 'msg' is unset! Struct:" + toString());
323+
throw new org.apache.thrift.protocol.TProtocolException("Required field 'msg' is unset! Struct:" + toString());
324324
}
325325

326326
}
327327

328328
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
329329
try {
330-
write(new org.apache.thrift7.protocol.TCompactProtocol(new org.apache.thrift7.transport.TIOStreamTransport(out)));
331-
} catch (org.apache.thrift7.TException te) {
330+
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
331+
} catch (org.apache.thrift.TException te) {
332332
throw new java.io.IOException(te);
333333
}
334334
}
335335

336336
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
337337
try {
338-
read(new org.apache.thrift7.protocol.TCompactProtocol(new org.apache.thrift7.transport.TIOStreamTransport(in)));
339-
} catch (org.apache.thrift7.TException te) {
338+
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
339+
} catch (org.apache.thrift.TException te) {
340340
throw new java.io.IOException(te);
341341
}
342342
}

0 commit comments

Comments
 (0)