Skip to content

Commit 109f39b

Browse files
committed
Merge branch 'release/0.7.0'
Conflicts: project/Build.scala
2 parents 476c70e + b85e59f commit 109f39b

9 files changed

Lines changed: 53 additions & 30 deletions

File tree

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
language: scala
22
sudo: false
33
scala:
4-
- 2.10.4
5-
- 2.11.2
4+
- 2.10.5
5+
- 2.11.7

CHANGES.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# chill #
22

3+
### 0.7.0 ###
4+
* Adds Scrooge 2.11 support now that the artifact is out, sets up for c…: https://github.com/twitter/chill/pull/236
5+
* make chill 1.6 compatible: https://github.com/twitter/chill/pull/231
6+
* Update README.md: https://github.com/twitter/chill/pull/232
7+
* Alter scala collection default serializer registration order: https://github.com/twitter/chill/pull/229
8+
* Build chill-scrooge for scala 2.11, too: https://github.com/twitter/chill/pull/219
9+
310
### 0.6.0 ###
411
* Add build instructions to readme and make InjectiveSerializer serializable #216
512
* Build chill-scrooge for scala 2.11, too #219

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ serializers and a set of classes to ease configuration of Kryo in systems like H
55
Akka, etc.
66

77

8-
### Buidling Chill
8+
### Building Chill
99

1010
```bash
1111
./sbt

chill-java/src/main/java/com/twitter/chill/java/BitSetSerializer.java

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import java.io.Serializable;
2929
import java.lang.reflect.Constructor;
3030
import java.lang.reflect.Field;
31+
import java.lang.reflect.InvocationTargetException;
3132
import java.lang.reflect.Method;
3233
import java.util.BitSet;
3334

@@ -89,18 +90,27 @@ public BitSet read(Kryo kryo, Input input, Class<BitSet> bitSetClass) {
8990
}
9091

9192
BitSet ret = null;
92-
// call a private constructor: (the BitSet.valueOf() cTor is only available from Java 1.7)
93+
9394
try {
9495
ret = bitSetConstructor.newInstance(target);
95-
} catch (ReflectiveOperationException e) {
96-
throw new KryoException("Unable to call BitSet(long[]) constructor", e);
96+
} catch (InstantiationException e) {
97+
throw new KryoException("Exception thrown while creating new instance BitSetConstructor", e);
98+
} catch (IllegalAccessException e) {
99+
throw new KryoException("Exception thrown while creating new instance of BitSetConstructor", e);
100+
} catch (InvocationTargetException e) {
101+
throw new KryoException("Exception thrown while creating new instance of BitSetConstructor", e);
102+
} catch (IllegalArgumentException e) {
103+
throw new KryoException("Exception thrown while creating new instance of BitSetConstructor", e);
97104
}
98105
try {
99106
recalculateWordsInUseMethod.invoke(ret);
100-
} catch (ReflectiveOperationException e) {
101-
throw new KryoException("Unable to call BitSet.recalculateWordsInUse() method", e);
107+
} catch (InvocationTargetException e) {
108+
throw new KryoException("Exception thrown while invoking recalculateWordsInUseMethod", e);
109+
} catch (IllegalAccessException e) {
110+
throw new KryoException("Exception thrown while invoking recalculateWordsInUseMethod", e);
111+
} catch (IllegalArgumentException e) {
112+
throw new KryoException("Exception thrown while invoking recalculateWordsInUseMethod", e);
102113
}
103-
104114
return ret;
105115
}
106116
}

chill-java/src/test/scala/com/twitter/chill/java/BitSetTest.scala

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package com.twitter.chill.java
33
import java.util
44

55
import com.esotericsoftware.kryo.Kryo
6-
import com.esotericsoftware.kryo.io.{Input, Output}
6+
import com.esotericsoftware.kryo.io.{ Input, Output }
77
import org.objenesis.strategy.StdInstantiatorStrategy
88
import org.scalatest._
99

@@ -63,19 +63,19 @@ class BitSetSpec extends WordSpec with MustMatchers {
6363
}
6464

6565
// warmup In case anybody wants to see hotspot
66-
var lastBitSetFromOld : util.BitSet = null
67-
for(i <- 0 to 50000) {
66+
var lastBitSetFromOld: util.BitSet = null
67+
for (i <- 0 to 50000) {
6868
lastBitSetFromOld = rt(element)(oldKryo)
6969
}
7070
var start = System.currentTimeMillis()
71-
for(i <- 0 to 100000) {
71+
for (i <- 0 to 100000) {
7272
rt(element)(oldKryo)
7373
}
74-
println("The old serializer took "+(System.currentTimeMillis() - start)+"ms")
74+
println("The old serializer took " + (System.currentTimeMillis() - start) + "ms")
7575

76-
var lastBitSetFromNew : util.BitSet = null
76+
var lastBitSetFromNew: util.BitSet = null
7777
// warmup for the new kryo
78-
for(i <- 0 to 50000) {
78+
for (i <- 0 to 50000) {
7979
lastBitSetFromNew = rt(element)(newKryo)
8080
}
8181
// check for the three bitsets to be equal
@@ -87,23 +87,22 @@ class BitSetSpec extends WordSpec with MustMatchers {
8787
element.get(i) must be(lastBitSetFromNew.get(i))
8888
}
8989

90-
9190
start = System.currentTimeMillis()
92-
for(i <- 0 to 100000) {
91+
for (i <- 0 to 100000) {
9392
rt(element)(newKryo)
9493
}
95-
println("The new serializer took "+(System.currentTimeMillis() - start)+"ms")
94+
println("The new serializer took " + (System.currentTimeMillis() - start) + "ms")
9695

9796
var out = new Output(1, -1)
9897
oldKryo.writeObject(out, element)
9998
out.flush()
10099
var oldBytes = out.total()
101-
println("The old serializer needs "+oldBytes+" bytes")
100+
println("The old serializer needs " + oldBytes + " bytes")
102101
out = new Output(1, -1)
103102
newKryo.writeObject(out, element)
104103
out.flush()
105104
var newBytes = out.total()
106-
println("The new serializer needs "+newBytes+" bytes")
105+
println("The new serializer needs " + newBytes + " bytes")
107106

108107
oldBytes >= newBytes must be(true)
109108
}

chill-scala/src/main/scala/com/twitter/chill/ScalaKryoInstantiator.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ class ScalaCollectionsRegistrar extends IKryoRegistrar {
123123
.forTraversableSubclass(Queue.empty[Any])
124124
// List is a sealed class, so there are only two subclasses:
125125
.forTraversableSubclass(List.empty[Any])
126+
// Add ListBuffer subclass before Buffer to prevent the more general case taking precedence
127+
.forTraversableSubclass(ListBuffer.empty[Any], isImmutable = false)
126128
// add mutable Buffer before Vector, otherwise Vector is used
127129
.forTraversableSubclass(Buffer.empty[Any], isImmutable = false)
128130
// Vector is a final class
@@ -159,7 +161,6 @@ class ScalaCollectionsRegistrar extends IKryoRegistrar {
159161
.forTraversableSubclass(MQueue.empty[Any], isImmutable = false)
160162
.forTraversableSubclass(MMap.empty[Any, Any], isImmutable = false)
161163
.forTraversableSubclass(MSet.empty[Any], isImmutable = false)
162-
.forTraversableSubclass(ListBuffer.empty[Any], isImmutable = false)
163164
}
164165
}
165166

project/Build.scala

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@ import scala.collection.JavaConverters._
1212
object ChillBuild extends Build {
1313
val kryoVersion = "2.21"
1414

15+
val bijectionVersion = "0.8.1"
16+
val algebirdVersion = "0.11.0"
1517

1618
def isScala210x(scalaVersion: String) = scalaVersion match {
1719
case version if version startsWith "2.10" => true
1820
case _ => false
1921
}
2022

2123
val sharedSettings = Project.defaultSettings ++ mimaDefaultSettings ++ scalariformSettings ++ Seq(
22-
23-
version := "0.6.0",
2424
organization := "com.twitter",
2525
scalaVersion := "2.10.5",
26-
crossScalaVersions := Seq("2.10.5", "2.11.5"),
26+
crossScalaVersions := Seq("2.10.5", "2.11.7"),
2727
scalacOptions ++= Seq("-unchecked", "-deprecation"),
2828
ScalariformKeys.preferences := formattingPreferences,
2929

@@ -133,7 +133,12 @@ object ChillBuild extends Build {
133133
val id = "chill-%s".format(name)
134134
Project(id = id, base = file(id), settings = sharedSettings ++ Seq(
135135
Keys.name := id,
136-
previousArtifact := youngestForwardCompatible(name))
136+
previousArtifact := youngestForwardCompatible(name),
137+
// Disable cross publishing for java artifacts
138+
publishArtifact <<= (scalaVersion) { scalaVersion =>
139+
if(javaOnly.contains(name) && scalaVersion.startsWith("2.10")) false else true
140+
}
141+
)
137142
)
138143
}
139144

@@ -145,7 +150,7 @@ object ChillBuild extends Build {
145150
settings = sharedSettings
146151
).settings(
147152
name := "chill",
148-
previousArtifact := Some("com.twitter" % "chill_2.10" % "0.5.0")
153+
previousArtifact := Some("com.twitter" % "chill_2.10" % "0.7.0")
149154
).dependsOn(chillJava)
150155

151156
lazy val chillAkka = module("akka").settings(
@@ -201,8 +206,8 @@ object ChillBuild extends Build {
201206

202207
lazy val chillScrooge = module("scrooge").settings(
203208
libraryDependencies ++= Seq(
204-
"org.apache.thrift" % "libthrift" % "0.9.1" exclude("junit", "junit"),
205-
"com.twitter" %% "scrooge-serializer" % "3.17.0"
209+
"org.apache.thrift" % "libthrift" % "0.6.1" exclude("junit", "junit"),
210+
"com.twitter" %% "scrooge-serializer" % "3.20.0"
206211
)
207212
).dependsOn(chill % "test->test;compile->compile")
208213

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=0.13.5
1+
sbt.version=0.13.8

version.sbt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
version in ThisBuild := "0.7.0"

0 commit comments

Comments
 (0)