Skip to content

Commit 6181f96

Browse files
author
Jonathan Coveney
committed
Merge branch 'release/0.3.6'
2 parents 185a1db + 6e45a4c commit 6181f96

File tree

22 files changed

+1799
-52
lines changed

22 files changed

+1799
-52
lines changed

CHANGES.md

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
11
# chill #
22

3+
### 0.3.6
4+
* Add ScalaAnyRefMapConfig, deals with non-string keys in cascading: https://github.com/twitter/chill/pull/174
5+
* added AvroSerializer: https://github.com/twitter/chill/pull/172
6+
* Add sbt script for homogeneity with SB, Scalding, etc: https://github.com/twitter/chill/pull/170
7+
* Support for akka 2.2.1: https://github.com/twitter/chill/pull/169
8+
* Protobuf should be in the all target: https://github.com/twitter/chill/pull/168
9+
* Enable getClass equality checking in tests: https://github.com/twitter/chill/pull/165
10+
* Add chill-protobuf, with tests: https://github.com/twitter/chill/pull/163
11+
* support serialization of scala sortedmap: https://github.com/twitter/chill/pull/162
12+
313
### 0.3.5
4-
* Add Serializers for scala SortedList and ListSet. https://github.com/twitter/chill/pull/152
14+
* Add Serializers for scala SortedList and ListSet: https://github.com/twitter/chill/pull/152
515
* Fix Range serialization (and remove broken subclass-serialization of Iterable, Seq, etc): https://github.com/twitter/chill/pull/154
616
* Build and test chill-akka for 2.10: https://github.com/twitter/chill/pull/155
717
* Add chill-thrift: https://github.com/twitter/chill/pull/156
818
* Support JavaConverter-built classes: https://github.com/twitter/chill/pull/159
19+
* Back to 2.21: https://github.com/twitter/chill/pull/157
20+
* Adds a test from issue #8: https://github.com/twitter/chill/pull/158
921

1022
### 0.3.4
1123
* Bugfixes for Externalizer with looped object graphs https://github.com/twitter/chill/pull/143

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ Discussion occurs primarily on the [Chill mailing list](https://groups.google.co
147147

148148
## Maven
149149

150-
Chill modules are available on Maven Central. The current groupid and version for all modules is, respectively, `"com.twitter"` and `0.3.5`.
150+
Chill modules are available on Maven Central. The current groupid and version for all modules is, respectively, `"com.twitter"` and `0.3.6`.
151151

152152
Current published artifacts are
153153

chill-akka/src/main/scala/com/twitter/chill/akka/ActorRefSerializer.scala

+1-4
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@ class ActorRefSerializer(system: ExtendedActorSystem) extends Serializer[ActorRe
4747
}
4848

4949
override def write(kryo: Kryo, output: Output, obj: ActorRef) = {
50-
Serialization.currentTransportAddress.value match {
51-
case null => output.writeString(obj.path.toString)
52-
case addr => output.writeString(obj.path.toStringWithAddress(addr))
53-
}
50+
output.writeString(Serialization.serializedActorPath(obj))
5451
}
5552
}

chill-akka/src/test/scala/com/twitter/chill/akka/AkkaTests.scala

+18
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,23 @@ class AkkaTests extends Specification {
4646
val serializer = serialization.findSerializerFor((1,2,3))
4747
serializer.getClass.equals(classOf[AkkaSerializer]) must beTrue
4848
}
49+
50+
"be selected for ActorRef" in {
51+
val serializer = serialization.findSerializerFor(system.actorFor("akka://test-system/test-actor"))
52+
serializer.getClass.equals(classOf[AkkaSerializer]) must beTrue
53+
}
54+
55+
"serialize and deserialize ActorRef successfully" in {
56+
val actorRef = system.actorFor("akka://test-system/test-actor")
57+
58+
val serialized = serialization.serialize(actorRef)
59+
serialized.isSuccess must beTrue
60+
61+
val deserialized = serialization.deserialize(serialized.get, classOf[ActorRef])
62+
deserialized.isSuccess must beTrue
63+
64+
deserialized.get.equals(actorRef) must beTrue
65+
}
66+
4967
}
5068
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.
14+
*/
15+
package com.twitter.chill.avro
16+
17+
import org.apache.avro.specific.SpecificRecordBase
18+
import com.twitter.chill.{InjectiveSerializer, KSerializer}
19+
import com.twitter.bijection.avro.SpecificAvroCodecs
20+
import org.apache.avro.Schema
21+
import com.twitter.bijection.Injection
22+
23+
/**
24+
* @author Mansur Ashraf
25+
* @since 2/9/14.
26+
*/
27+
object AvroSerializer {
28+
29+
def SpecificRecordSerializer[T <: SpecificRecordBase : Manifest]: KSerializer[T] = {
30+
implicit val inj = SpecificAvroCodecs[T]
31+
InjectiveSerializer.asKryo
32+
}
33+
34+
def SpecificRecordBinarySerializer[T <: SpecificRecordBase : Manifest]: KSerializer[T] = {
35+
implicit val inj = SpecificAvroCodecs.toBinary[T]
36+
InjectiveSerializer.asKryo
37+
}
38+
39+
def SpecificRecordJsonSerializer[T <: SpecificRecordBase : Manifest](schema: Schema): KSerializer[T] = {
40+
import com.twitter.bijection.StringCodec.utf8
41+
implicit val inj = SpecificAvroCodecs.toJson[T](schema)
42+
implicit val avroToArray = Injection.connect[T, String, Array[Byte]]
43+
InjectiveSerializer.asKryo
44+
}
45+
}

0 commit comments

Comments
 (0)