Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[split] some changes from security for open source

commit 742e01dba5f070b3d038470a46f2aa2062262d72 1 parent 003ae65
Ryan King authored
Showing with 1,291 additions and 223 deletions.
  1. +26 −0 NOTICE
  2. +0 −2  OWNERS
  3. +14 −1 cassie-core/src/main/scala/com/twitter/cassie/BaseColumnFamily.scala
  4. +16 −8 cassie-core/src/main/scala/com/twitter/cassie/BatchMutationBuilder.scala
  5. +17 −4 cassie-core/src/main/scala/com/twitter/cassie/Cluster.scala
  6. +25 −7 cassie-core/src/main/scala/com/twitter/cassie/ClusterRemapper.scala
  7. +17 −4 cassie-core/src/main/scala/com/twitter/cassie/Column.scala
  8. +14 −0 cassie-core/src/main/scala/com/twitter/cassie/ColumnFamily.scala
  9. +15 −1 cassie-core/src/main/scala/com/twitter/cassie/ColumnsIteratee.scala
  10. +15 −3 cassie-core/src/main/scala/com/twitter/cassie/CounterBatchMutationBuilder.scala
  11. +15 −1 cassie-core/src/main/scala/com/twitter/cassie/CounterColumn.scala
  12. +14 −0 cassie-core/src/main/scala/com/twitter/cassie/CounterColumnFamily.scala
  13. +15 −1 cassie-core/src/main/scala/com/twitter/cassie/CounterColumnsIteratee.scala
  14. +17 −3 cassie-core/src/main/scala/com/twitter/cassie/CounterRowsIteratee.scala
  15. +14 −0 cassie-core/src/main/scala/com/twitter/cassie/FNV1A.scala
  16. +18 −4 cassie-core/src/main/scala/com/twitter/cassie/Keyspace.scala
  17. +14 −0 cassie-core/src/main/scala/com/twitter/cassie/Order.scala
  18. +14 −0 cassie-core/src/main/scala/com/twitter/cassie/ReadConsistency.scala
  19. +17 −3 cassie-core/src/main/scala/com/twitter/cassie/RowsIteratee.scala
  20. +14 −0 cassie-core/src/main/scala/com/twitter/cassie/SuperColumnFamily.scala
  21. +14 −0 cassie-core/src/main/scala/com/twitter/cassie/SuperCounterBatchMutationBuilder.scala
  22. +14 −0 cassie-core/src/main/scala/com/twitter/cassie/SuperCounterColumnFamily.scala
  23. +14 −0 cassie-core/src/main/scala/com/twitter/cassie/WriteConsistency.scala
  24. +14 −0 cassie-core/src/main/scala/com/twitter/cassie/clocks/Clock.scala
  25. +14 −0 cassie-core/src/main/scala/com/twitter/cassie/clocks/MicrosecondEpochClock.scala
  26. +14 −0 cassie-core/src/main/scala/com/twitter/cassie/clocks/StrictlyIncreasingClock.scala
  27. +14 −0 cassie-core/src/main/scala/com/twitter/cassie/codecs/ByteArrayCodec.scala
  28. +14 −0 cassie-core/src/main/scala/com/twitter/cassie/codecs/Codec.scala
  29. +14 −0 cassie-core/src/main/scala/com/twitter/cassie/codecs/IntCodec.scala
  30. +17 −3 cassie-core/src/main/scala/com/twitter/cassie/codecs/LegacyUtf8Codec.scala
  31. +14 −0 cassie-core/src/main/scala/com/twitter/cassie/codecs/LexicalUUIDCodec.scala
  32. +14 −0 cassie-core/src/main/scala/com/twitter/cassie/codecs/LongCodec.scala
  33. +14 −0 cassie-core/src/main/scala/com/twitter/cassie/codecs/ThriftCodec.scala
  34. +14 −0 cassie-core/src/main/scala/com/twitter/cassie/codecs/Utf8Codec.scala
  35. +16 −1 cassie-core/src/main/scala/com/twitter/cassie/connection/CCluster.scala
  36. +14 −0 cassie-core/src/main/scala/com/twitter/cassie/connection/ClientProvider.scala
  37. +23 −11 cassie-core/src/main/scala/com/twitter/cassie/connection/ClusterClientProvider.scala
  38. +23 −16 cassie-core/src/main/scala/com/twitter/cassie/tests/util/FakeCassandra.scala
  39. +16 −2 cassie-core/src/main/scala/com/twitter/cassie/types/LexicalUUID.scala
  40. +14 −0 cassie-core/src/main/scala/com/twitter/cassie/types/ThriftEncoded.scala
  41. +14 −0 cassie-core/src/main/scala/com/twitter/cassie/util/ByteBufferUtil.scala
  42. +14 −0 cassie-core/src/main/scala/com/twitter/cassie/util/FutureUtil.scala
  43. +21 −10 cassie-core/src/test/java/com/twitter/cassie/MockCassandraClient.java
  44. +18 −6 cassie-core/src/test/java/com/twitter/cassie/jtests/ClusterTest.java
  45. +21 −10 cassie-core/src/test/java/com/twitter/cassie/jtests/ColumnFamilyTest.java
  46. +19 −6 cassie-core/src/test/java/com/twitter/cassie/jtests/examples/CassieRun.java
  47. +15 −1 cassie-core/src/test/scala/com/twitter/cassie/FNV1ATest.scala
  48. +14 −0 cassie-core/src/test/scala/com/twitter/cassie/Mutations.scala
  49. +14 −0 cassie-core/src/test/scala/com/twitter/cassie/clocks/tests/MicrosecondEpochClockTest.scala
  50. +14 −0 cassie-core/src/test/scala/com/twitter/cassie/codecs/tests/ByteArrayCodecTest.scala
  51. +14 −0 cassie-core/src/test/scala/com/twitter/cassie/codecs/tests/ByteBufferLiteral.scala
  52. +14 −0 cassie-core/src/test/scala/com/twitter/cassie/codecs/tests/CodecTest.scala
  53. +14 −0 cassie-core/src/test/scala/com/twitter/cassie/codecs/tests/IntCodecTest.scala
  54. +14 −0 cassie-core/src/test/scala/com/twitter/cassie/codecs/tests/LexicalUUIDCodecTest.scala
  55. +14 −0 cassie-core/src/test/scala/com/twitter/cassie/codecs/tests/LongCodecTest.scala
  56. +14 −0 cassie-core/src/test/scala/com/twitter/cassie/codecs/tests/ThriftCodecTest.scala
  57. +14 −0 cassie-core/src/test/scala/com/twitter/cassie/codecs/tests/Utf8CodecTest.scala
  58. +15 −1 cassie-core/src/test/scala/com/twitter/cassie/examples/CassieRun.scala
  59. +18 −4 cassie-core/src/test/scala/com/twitter/cassie/tests/BatchMutationBuilderTest.scala
  60. +20 −7 cassie-core/src/test/scala/com/twitter/cassie/tests/ClusterRemapperTest.scala
  61. +17 −3 cassie-core/src/test/scala/com/twitter/cassie/tests/ClusterTest.scala
  62. +25 −11 cassie-core/src/test/scala/com/twitter/cassie/tests/ColumnFamilyTest.scala
  63. +16 −2 cassie-core/src/test/scala/com/twitter/cassie/tests/ColumnTest.scala
  64. +20 −6 cassie-core/src/test/scala/com/twitter/cassie/tests/ColumnsIterateeTest.scala
  65. +14 −0 cassie-core/src/test/scala/com/twitter/cassie/tests/CounterColumnFamilyTest.scala
  66. +14 −0 cassie-core/src/test/scala/com/twitter/cassie/tests/CounterRowsIterateeTest.scala
  67. +25 −11 cassie-core/src/test/scala/com/twitter/cassie/tests/KeyspaceTest.scala
  68. +16 −2 cassie-core/src/test/scala/com/twitter/cassie/tests/ReadConsistencyTest.scala
  69. +20 −6 cassie-core/src/test/scala/com/twitter/cassie/tests/RowsIterateeTest.scala
  70. +16 −2 cassie-core/src/test/scala/com/twitter/cassie/tests/WriteConsistencyTest.scala
  71. +17 −3 cassie-core/src/test/scala/com/twitter/cassie/types/tests/LexicalUUIDTest.scala
  72. +17 −3 cassie-core/src/test/scala/com/twitter/cassie/util/ColumnFamilyTestHelper.scala
  73. +23 −10 cassie-core/src/test/scala/com/twitter/cassie/util/FakeCassandraTest.scala
  74. +14 −0 cassie-core/src/test/thrift/person.thrift
  75. +14 −0 cassie-hadoop/src/main/java/com/twitter/cassie/hadoop/CassieCounters.java
  76. +24 −10 cassie-hadoop/src/main/scala/com/twitter/cassie/hadoop/CassieReducer.scala
  77. +17 −3 cassie-hadoop/src/main/scala/com/twitter/cassie/hadoop/ColumnWritable.scala
  78. +30 −20 cassie-hadoop/src/test/scala/com/twitter/cassie/hadoop/CassieReducerTest.scala
  79. +20 −10 cassie-serversets/src/main/scala/com/twitter/cassie/serversets/ServerSetsCluster.scala
  80. +1 −1  project/build/Cassie.scala
View
26 NOTICE
@@ -0,0 +1,26 @@
+Cassie is Scala client for Cassandra
+Copyright 2011-2012 Twitter, Inc.
+
+This work was originally inspired by Coda Hale's client on GitHub
+https://github.com/codahale/cassie
+
+Copyright (c) 2010 Coda Hale
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
2  OWNERS
@@ -1,2 +0,0 @@
-*: ryan, stuhood, harish
-review_group:cassandra
View
15 cassie-core/src/main/scala/com/twitter/cassie/BaseColumnFamily.scala
@@ -1,3 +1,17 @@
+// Copyright 2012 Twitter, Inc.
+//
+// Licensed 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 com.twitter.cassie
import com.twitter.cassie.codecs.ThriftCodec
@@ -9,7 +23,6 @@ import com.twitter.util.Future
import org.apache.cassandra.finagle.thrift
import org.apache.cassandra.finagle.thrift.Cassandra.ServiceToClient
-
object BaseColumnFamily {
val annPredCodec = new ThriftCodec[thrift.SlicePredicate](classOf[thrift.SlicePredicate])
}
View
24 cassie-core/src/main/scala/com/twitter/cassie/BatchMutationBuilder.scala
@@ -1,17 +1,25 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie
+import com.twitter.util.Future
import java.nio.ByteBuffer
-import java.util.{
- List => JList,
- Map => JMap,
- Set => JSet,
- ArrayList => JArrayList,
- HashMap => JHashMap
-}
import java.util.Collections.{ singleton => singletonJSet }
+import java.util.{ List => JList, Map => JMap, Set => JSet, ArrayList => JArrayList,HashMap => JHashMap}
import org.apache.cassandra.finagle.thrift
import scala.collection.mutable.ListBuffer
-import com.twitter.util.Future
trait BatchMutation {
private[cassie] def mutations: JMap[ByteBuffer, JMap[String, JList[thrift.Mutation]]]
View
21 cassie-core/src/main/scala/com/twitter/cassie/Cluster.scala
@@ -1,13 +1,26 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie
-import connection._
-import scala.collection.JavaConversions._
-import com.twitter.cassie.connection.{ CCluster, RetryPolicy, SocketAddressCluster }
-import com.twitter.util.Duration
+import com.twitter.cassie.connection.{ CCluster, ClusterClientProvider, RetryPolicy, SocketAddressCluster }
import com.twitter.conversions.time._
import com.twitter.finagle.stats.{ StatsReceiver, NullStatsReceiver }
import com.twitter.finagle.tracing.{ Tracer, NullTracer }
+import com.twitter.util.Duration
import java.net.{ SocketAddress, InetSocketAddress }
+import scala.collection.JavaConversions._
/**
* A Cassandra cluster.
View
32 cassie-core/src/main/scala/com/twitter/cassie/ClusterRemapper.scala
@@ -1,18 +1,36 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie
-import com.twitter.cassie.connection.ClusterClientProvider
-import com.twitter.cassie.connection.SocketAddressCluster
+import com.google.common.collect.ImmutableSet
import com.twitter.cassie.connection.CCluster
+import com.twitter.cassie.connection.{ClusterClientProvider, SocketAddressCluster}
+import com.twitter.concurrent.Spool
+import com.twitter.finagle.builder.{Cluster => FCluster}
+import com.twitter.finagle.ServiceFactory
import com.twitter.finagle.stats.{ StatsReceiver, NullStatsReceiver }
import com.twitter.finagle.util.Timer
+import com.twitter.finagle.WriteException
import com.twitter.logging.Logger
-import java.net.{ SocketAddress, InetSocketAddress }
+import com.twitter.util.{ Duration, Future, Promise, Return, Time }
+import java.io.IOException
+import java.net.{ InetSocketAddress, SocketAddress }
import org.jboss.netty.util.HashedWheelTimer
import scala.collection.JavaConversions._
-import com.twitter.concurrent.Spool
-import com.twitter.util._
-import com.twitter.finagle.builder.{Cluster => FCluster}
-
+import scala.collection.SeqProxy
+import scala.util.parsing.json.JSON
/**
* Given a seed host and port, returns a set of nodes in the cluster.
View
21 cassie-core/src/main/scala/com/twitter/cassie/Column.scala
@@ -1,10 +1,23 @@
-package com.twitter.cassie
+// Copyright 2012 Twitter, Inc.
-import clocks.Clock
+// Licensed 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
-import codecs.Codec
-import com.twitter.util.Duration
+// 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 com.twitter.cassie
+
+import com.twitter.cassie.clocks.Clock
+import com.twitter.cassie.codecs.Codec
import com.twitter.conversions.time._
+import com.twitter.util.Duration
import org.apache.cassandra.finagle.thrift
object Column {
View
14 cassie-core/src/main/scala/com/twitter/cassie/ColumnFamily.scala
@@ -1,3 +1,17 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie
import com.twitter.cassie.clocks.{ MicrosecondEpochClock, Clock }
View
16 cassie-core/src/main/scala/com/twitter/cassie/ColumnsIteratee.scala
@@ -1,9 +1,23 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie
-import scala.collection.JavaConversions._
import com.twitter.util.{ Future, Promise }
import java.util.{ Map => JMap, List => JList, ArrayList => JArrayList }
import org.apache.cassandra.finagle.thrift
+import scala.collection.JavaConversions._
/**
* Async iteration across the columns for a given key.
View
18 cassie-core/src/main/scala/com/twitter/cassie/CounterBatchMutationBuilder.scala
@@ -1,6 +1,20 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie
-import codecs.Codec
+import com.twitter.cassie.codecs.Codec
import com.twitter.util.Future
import java.nio.ByteBuffer
import java.util.Collections.{ singleton => singletonJSet }
@@ -11,8 +25,6 @@ import scala.collection.mutable.ListBuffer
/**
* A ColumnFamily-alike which batches mutations into a single API call for counters.
- *
- * TODO: Port to Java collections.
*/
class CounterBatchMutationBuilder[Key, Name](cf: CounterColumnFamily[Key, Name])
extends BatchMutation {
View
16 cassie-core/src/main/scala/com/twitter/cassie/CounterColumn.scala
@@ -1,6 +1,20 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie
-import codecs.Codec
+import com.twitter.cassie.codecs.Codec
import org.apache.cassandra.finagle.thrift
object CounterColumn {
View
14 cassie-core/src/main/scala/com/twitter/cassie/CounterColumnFamily.scala
@@ -1,3 +1,17 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie
import com.twitter.cassie.clocks.{ MicrosecondEpochClock, Clock }
View
16 cassie-core/src/main/scala/com/twitter/cassie/CounterColumnsIteratee.scala
@@ -1,9 +1,23 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie
-import scala.collection.JavaConversions._
import com.twitter.util.{ Future, Promise }
import java.util.{ Map => JMap, List => JList, ArrayList => JArrayList }
import org.apache.cassandra.finagle.thrift
+import scala.collection.JavaConversions._
/**
* Async iteration across the columns for a given key.
View
20 cassie-core/src/main/scala/com/twitter/cassie/CounterRowsIteratee.scala
@@ -1,10 +1,24 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie
-import scala.collection.JavaConversions._
+import com.twitter.cassie.util.ByteBufferUtil
import com.twitter.util.{ Future, Promise }
-import org.apache.cassandra.finagle.thrift
import java.util.{ List => JList }
-import com.twitter.cassie.util.ByteBufferUtil
+import org.apache.cassandra.finagle.thrift
+import scala.collection.JavaConversions._
/**
* Given a column family, a key range, a batch size, a slice predicate,
View
14 cassie-core/src/main/scala/com/twitter/cassie/FNV1A.scala
@@ -1,3 +1,17 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie
/**
View
22 cassie-core/src/main/scala/com/twitter/cassie/Keyspace.scala
@@ -1,14 +1,28 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie
import com.twitter.cassie.codecs.{ ThriftCodec, Codec }
import com.twitter.cassie.connection.ClientProvider
+import com.twitter.cassie.util.FutureUtil.timeFutureWithFailures
+import com.twitter.finagle.stats.{ StatsReceiver, NullStatsReceiver }
import com.twitter.util.Future
-import scala.collection.JavaConversions._
+import java.nio.ByteBuffer
import java.util.{ HashMap => JHashMap, Map => JMap, List => JList, ArrayList => JArrayList }
import org.apache.cassandra.finagle.thrift
-import java.nio.ByteBuffer
-import com.twitter.finagle.stats.{ StatsReceiver, NullStatsReceiver }
-import com.twitter.cassie.util.FutureUtil.timeFutureWithFailures
+import scala.collection.JavaConversions._
/**
* A Cassandra keyspace, which maintains a connection pool.
View
14 cassie-core/src/main/scala/com/twitter/cassie/Order.scala
@@ -1,3 +1,17 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie
/**
View
14 cassie-core/src/main/scala/com/twitter/cassie/ReadConsistency.scala
@@ -1,3 +1,17 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie
import org.apache.cassandra.finagle.thrift
View
20 cassie-core/src/main/scala/com/twitter/cassie/RowsIteratee.scala
@@ -1,10 +1,24 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie
-import scala.collection.JavaConversions._
+import com.twitter.cassie.util.ByteBufferUtil
import com.twitter.util.{ Future, Promise }
-import org.apache.cassandra.finagle.thrift
import java.util.{ List => JList }
-import com.twitter.cassie.util.ByteBufferUtil
+import org.apache.cassandra.finagle.thrift
+import scala.collection.JavaConversions._
/**
* Given a column family, a key range, a batch size, a slice predicate,
View
14 cassie-core/src/main/scala/com/twitter/cassie/SuperColumnFamily.scala
@@ -1,3 +1,17 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie
import com.twitter.cassie.clocks.{ MicrosecondEpochClock, Clock }
View
14 cassie-core/src/main/scala/com/twitter/cassie/SuperCounterBatchMutationBuilder.scala
@@ -1,3 +1,17 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie
import com.twitter.util.Future
View
14 cassie-core/src/main/scala/com/twitter/cassie/SuperCounterColumnFamily.scala
@@ -1,3 +1,17 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie
import com.twitter.cassie.codecs.Codec
View
14 cassie-core/src/main/scala/com/twitter/cassie/WriteConsistency.scala
@@ -1,3 +1,17 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie
import org.apache.cassandra.finagle.thrift
View
14 cassie-core/src/main/scala/com/twitter/cassie/clocks/Clock.scala
@@ -1,3 +1,17 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie.clocks
/**
View
14 cassie-core/src/main/scala/com/twitter/cassie/clocks/MicrosecondEpochClock.scala
@@ -1,3 +1,17 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie.clocks
/**
View
14 cassie-core/src/main/scala/com/twitter/cassie/clocks/StrictlyIncreasingClock.scala
@@ -1,3 +1,17 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie.clocks
import java.util.concurrent.atomic.AtomicLong
View
14 cassie-core/src/main/scala/com/twitter/cassie/codecs/ByteArrayCodec.scala
@@ -1,3 +1,17 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie.codecs
import java.nio.ByteBuffer
View
14 cassie-core/src/main/scala/com/twitter/cassie/codecs/Codec.scala
@@ -1,3 +1,17 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie.codecs
import java.nio.ByteBuffer
View
14 cassie-core/src/main/scala/com/twitter/cassie/codecs/IntCodec.scala
@@ -1,3 +1,17 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie.codecs
import java.nio.ByteBuffer
View
20 cassie-core/src/main/scala/com/twitter/cassie/codecs/LegacyUtf8Codec.scala
@@ -1,3 +1,17 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie.codecs
import java.nio.ByteBuffer
@@ -8,15 +22,15 @@ import org.apache.thrift.bootleg.Utf8Helper
* Encodes and decodes values as UTF-8 strings.
*/
@deprecated("""Use the new Utf8Codec if you can. You may need to use this for backwards
- compatability with your stored data. This should only be a problem if you
+ compatability with your stored data. This should only be a problem if you
use codepoints outside the BMP.""")
object LegacyUtf8Codec extends Codec[String] {
@deprecated("""Use the new Utf8Codec if you can. You may need to use this for backwards
- compatability with your stored data. This should only be a problem if you
+ compatability with your stored data. This should only be a problem if you
use codepoints outside the BMP.""")
def encode(s: String) = b2b(Utf8Helper.encode(s))
@deprecated("""Use the new Utf8Codec if you can. You may need to use this for backwards
- compatability with your stored data. This should only be a problem if you
+ compatability with your stored data. This should only be a problem if you
use codepoints outside the BMP.""")
def decode(ary: ByteBuffer) = Utf8Helper.decode(b2b(ary))
}
View
14 cassie-core/src/main/scala/com/twitter/cassie/codecs/LexicalUUIDCodec.scala
@@ -1,3 +1,17 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie.codecs
import com.twitter.cassie.types.LexicalUUID
View
14 cassie-core/src/main/scala/com/twitter/cassie/codecs/LongCodec.scala
@@ -1,3 +1,17 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie.codecs
import java.nio.ByteBuffer
View
14 cassie-core/src/main/scala/com/twitter/cassie/codecs/ThriftCodec.scala
@@ -1,3 +1,17 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie.codecs
import org.apache.thrift._
View
14 cassie-core/src/main/scala/com/twitter/cassie/codecs/Utf8Codec.scala
@@ -1,3 +1,17 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie.codecs
import java.nio.ByteBuffer
View
17 cassie-core/src/main/scala/com/twitter/cassie/connection/CCluster.scala
@@ -1,7 +1,22 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie.connection
-import java.net.SocketAddress
import com.twitter.finagle.builder.{ StaticCluster => FStaticCluster, Cluster => FCluster }
+import com.twitter.finagle.ServiceFactory
+import java.net.SocketAddress
trait CCluster[T] extends FCluster[T] {
def close
View
14 cassie-core/src/main/scala/com/twitter/cassie/connection/ClientProvider.scala
@@ -1,3 +1,17 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie.connection
import com.twitter.util.Future
View
34 cassie-core/src/main/scala/com/twitter/cassie/connection/ClusterClientProvider.scala
@@ -1,22 +1,35 @@
package com.twitter.cassie.connection
-import java.util.concurrent.TimeUnit
+// Copyright 2012 Twitter, Inc.
-import org.apache.cassandra.finagle.thrift.Cassandra.ServiceToClient
-import org.apache.cassandra.finagle.thrift.{ UnavailableException, TimedOutException }
-import org.apache.thrift.protocol.{ TBinaryProtocol, TProtocolFactory }
+// Licensed 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.
-import com.twitter.finagle.{ WriteException, RequestTimeoutException, ChannelException }
import com.twitter.finagle.builder.ClientBuilder
-import com.twitter.finagle.service.{ Backoff, RetryPolicy => FinagleRetryPolicy }
import com.twitter.finagle.Service
+import com.twitter.finagle.service.{ Backoff, RetryPolicy => FinagleRetryPolicy }
import com.twitter.finagle.stats.{ StatsReceiver, NullStatsReceiver }
import com.twitter.finagle.thrift.{ ThriftClientRequest, ThriftClientFramedCodec }
-import com.twitter.finagle.{ CodecFactory, ClientCodecConfig }
import com.twitter.finagle.tracing.{ Tracer, NullTracer }
+import com.twitter.finagle.{ ChannelException, CodecFactory, Codec, ClientCodecConfig, RequestTimeoutException, WriteException }
import com.twitter.util.Duration
+import com.twitter.util.{ Duration, Future, Throw, Timer, TimerTask, Time, Try }
import com.twitter.util.{ Future, Throw, Timer, TimerTask, Time, Try }
+import java.net.InetSocketAddress
import java.net.{ SocketAddress }
+import java.util.concurrent.TimeUnit
+import org.apache.cassandra.finagle.thrift.Cassandra.ServiceToClient
+import org.apache.cassandra.finagle.thrift.{ UnavailableException, TimedOutException }
+import org.apache.thrift.protocol.{ TBinaryProtocol, TProtocolFactory }
sealed case class RetryPolicy()
@@ -57,10 +70,9 @@ private[cassie] class ClusterClientProvider(val hosts: CCluster[SocketAddress],
case Throw(x: RequestTimeoutException) => recordRetryable(x)
case Throw(x: ChannelException) => recordRetryable(x)
case Throw(x: UnavailableException) => recordRetryable(x)
- // TODO: see http://jira.local.twitter.com/browse/CORESTORAGE-494: if this is a legit
- // serverside timeout, then we should be careful about retrying, since the serverside
- // timeout is ideally set to just a smidgeon below our client timeout, and we would
- // thus wait a lot of extra time
+ // TODO: if this is a legit serverside timeout, then we should be careful about retrying, since the
+ // serverside timeout is ideally set to just a smidgeon below our client timeout, and we would thus
+ // wait a lot of extra time
case Throw(x: TimedOutException) => recordRetryable(x)
// TODO: do we need to retry IndividualRequestTimeoutException?
}
View
39 cassie-core/src/main/scala/com/twitter/cassie/tests/util/FakeCassandra.scala
@@ -1,25 +1,32 @@
+// Copyright 2012 Twitter, Inc.
+// Licensed 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 com.twitter.cassie.tests.util
-import org.apache.thrift.transport.{ TServerSocket, TFramedTransport }
-import org.apache.thrift.protocol.TBinaryProtocol
-import org.apache.thrift.server.TThreadPoolServer
+import com.twitter.cassie.codecs.Utf8Codec
+
+import java.net.ServerSocket
+import java.nio.ByteBuffer
import java.util.concurrent.CountDownLatch
+import java.util.{ HashSet => JHashSet, ArrayList => JArrayList, SortedSet => JSortedSet,
+ TreeMap => JTreeMap, List => JList, TreeSet => JTreeSet, Map => JMap }
+import java.util.Comparator
import org.apache.cassandra.finagle.thrift._
-import java.nio.ByteBuffer
-import com.twitter.cassie.codecs.Utf8Codec
+import org.apache.thrift.protocol.TBinaryProtocol
+import org.apache.thrift.server.TThreadPoolServer
+import org.apache.thrift.transport.{ TServerSocket, TFramedTransport }
import scala.collection.JavaConversions._
-import java.util.{
- HashSet => JHashSet,
- ArrayList => JArrayList,
- SortedSet => JSortedSet,
- TreeMap => JTreeMap,
- List => JList,
- TreeSet => JTreeSet,
- Map => JMap
-}
-import java.util.Comparator
import scala.math.min
-import java.net.ServerSocket
object FakeCassandra {
class ServerThread(cassandra: Cassandra.Iface) extends Thread {
View
18 cassie-core/src/main/scala/com/twitter/cassie/types/LexicalUUID.scala
@@ -1,10 +1,24 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie.types
import com.twitter.cassie.clocks.Clock
+import com.twitter.cassie.FNV1A
import java.net.InetAddress.{ getLocalHost => localHost }
-import org.apache.commons.codec.binary.Hex.decodeHex
import java.nio.ByteBuffer
-import com.twitter.cassie.FNV1A
+import org.apache.commons.codec.binary.Hex.decodeHex
object LexicalUUID {
private val defaultWorkerID = FNV1A(localHost.getHostName.getBytes)
View
14 cassie-core/src/main/scala/com/twitter/cassie/types/ThriftEncoded.scala
@@ -1,3 +1,17 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie.types
import org.apache.thrift._
View
14 cassie-core/src/main/scala/com/twitter/cassie/util/ByteBufferUtil.scala
@@ -1,3 +1,17 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie.util
import java.nio.ByteBuffer
View
14 cassie-core/src/main/scala/com/twitter/cassie/util/FutureUtil.scala
@@ -1,3 +1,17 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie.util
import com.twitter.util.Future
View
31 cassie-core/src/test/java/com/twitter/cassie/MockCassandraClient.java
@@ -1,22 +1,33 @@
-package com.twitter.cassie;
+// Copyright 2012 Twitter, Inc.
-import java.nio.ByteBuffer;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
+// Licensed 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
-import com.twitter.util.Future;
-import com.twitter.util.Promise;
+// 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 com.twitter.cassie;
+
+import com.twitter.cassie.codecs.Utf8Codec;
import com.twitter.cassie.ColumnFamily;
import com.twitter.cassie.connection.ClientProvider;
-import com.twitter.cassie.codecs.Utf8Codec;
import com.twitter.cassie.ReadConsistency;
import com.twitter.cassie.WriteConsistency;
-
+import com.twitter.util.Future;
+import com.twitter.util.Promise;
+import java.nio.ByteBuffer;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
import org.apache.cassandra.finagle.thrift.*;
-import org.junit.Test;
import org.junit.Before;
+import org.junit.Test;
import static junit.framework.Assert.assertEquals;
import static org.mockito.Mockito.*;
View
24 cassie-core/src/test/java/com/twitter/cassie/jtests/ClusterTest.java
@@ -1,15 +1,27 @@
-package com.twitter.cassie.jtests;
+// Copyright 2012 Twitter, Inc.
-import java.nio.ByteBuffer;
+// Licensed 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 com.twitter.cassie.jtests;
import com.twitter.cassie.Cluster;
import com.twitter.cassie.Keyspace;
-
-import org.junit.Test;
+import com.twitter.finagle.stats.NullStatsReceiver$;
+import com.twitter.util.Duration;
+import java.nio.ByteBuffer;
import org.junit.Before;
+import org.junit.Test;
import static junit.framework.Assert.assertEquals;
-import com.twitter.util.Duration;
-import com.twitter.finagle.stats.NullStatsReceiver$;
public class ClusterTest {
public Cluster cluster;
View
31 cassie-core/src/test/java/com/twitter/cassie/jtests/ColumnFamilyTest.java
@@ -1,23 +1,34 @@
-package com.twitter.cassie.jtests;
+// Copyright 2012 Twitter, Inc.
-import java.nio.ByteBuffer;
+// Licensed 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 com.twitter.cassie.jtests;
+import com.twitter.cassie.codecs.Codec;
+import com.twitter.cassie.codecs.Utf8Codec;
import com.twitter.cassie.ColumnFamily;
import com.twitter.cassie.MockCassandraClient;
import com.twitter.cassie.ReadConsistency;
import com.twitter.cassie.WriteConsistency;
-import com.twitter.cassie.codecs.Codec;
-import com.twitter.cassie.codecs.Utf8Codec;
-
+import com.twitter.finagle.stats.NullStatsReceiver$;
+import java.nio.ByteBuffer;
import org.apache.cassandra.finagle.thrift.*;
-
-import org.junit.Test;
import org.junit.Before;
-import static junit.framework.Assert.assertEquals;
+import org.junit.Test;
import org.mockito.ArgumentCaptor;
-import static org.mockito.Mockito.*;
+import static junit.framework.Assert.assertEquals;
import static org.mockito.Matchers.*;
-import com.twitter.finagle.stats.NullStatsReceiver$;
+import static org.mockito.Mockito.*;
public class ColumnFamilyTest {
protected MockCassandraClient mock;
View
25 cassie-core/src/test/java/com/twitter/cassie/jtests/examples/CassieRun.java
@@ -1,17 +1,30 @@
-package com.twitter.cassie.jtests.examples;
+// Copyright 2012 Twitter, Inc.
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
+// Licensed 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 com.twitter.cassie.jtests.examples;
import com.twitter.cassie.*;
import com.twitter.cassie.clocks.MicrosecondEpochClock;
-import com.twitter.cassie.types.*;
import com.twitter.cassie.codecs.*;
+import com.twitter.cassie.types.*;
+import com.twitter.finagle.stats.NullStatsReceiver$;
import com.twitter.util.Function2;
import com.twitter.util.Function;
import com.twitter.util.Future;
-import com.twitter.finagle.stats.NullStatsReceiver$;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
public final class CassieRun {
public static <V> HashSet<V> Set(V... values) {
View
16 cassie-core/src/test/scala/com/twitter/cassie/FNV1ATest.scala
@@ -1,7 +1,21 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie
-import org.scalatest.Spec
import org.scalatest.matchers.MustMatchers
+import org.scalatest.Spec
class FNV1ATest extends Spec with MustMatchers {
describe("the FNV1A hash function") {
View
14 cassie-core/src/test/scala/com/twitter/cassie/Mutations.scala
@@ -1,3 +1,17 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie
/**
View
14 cassie-core/src/test/scala/com/twitter/cassie/clocks/tests/MicrosecondEpochClockTest.scala
@@ -1,3 +1,17 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie.clocks.tests
import org.scalatest.Spec
View
14 cassie-core/src/test/scala/com/twitter/cassie/codecs/tests/ByteArrayCodecTest.scala
@@ -1,3 +1,17 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie.codecs.tests
import com.twitter.cassie.codecs.tests.ByteBufferLiteral._
View
14 cassie-core/src/test/scala/com/twitter/cassie/codecs/tests/ByteBufferLiteral.scala
@@ -1,3 +1,17 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie.codecs.tests
import java.nio.ByteBuffer
View
14 cassie-core/src/test/scala/com/twitter/cassie/codecs/tests/CodecTest.scala
@@ -1,3 +1,17 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie.codecs.tests
import com.twitter.cassie.codecs.tests.ByteBufferLiteral._
View
14 cassie-core/src/test/scala/com/twitter/cassie/codecs/tests/IntCodecTest.scala
@@ -1,3 +1,17 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie.codecs.tests
import com.twitter.cassie.codecs.tests.ByteBufferLiteral._
View
14 cassie-core/src/test/scala/com/twitter/cassie/codecs/tests/LexicalUUIDCodecTest.scala
@@ -1,3 +1,17 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie.codecs.tests
import com.twitter.cassie.codecs.tests.ByteBufferLiteral._
View
14 cassie-core/src/test/scala/com/twitter/cassie/codecs/tests/LongCodecTest.scala
@@ -1,3 +1,17 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie.codecs.tests
import com.twitter.cassie.codecs.tests.ByteBufferLiteral._
View
14 cassie-core/src/test/scala/com/twitter/cassie/codecs/tests/ThriftCodecTest.scala
@@ -1,3 +1,17 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie.codecs.tests
import com.twitter.cassie.codecs.tests.ByteBufferLiteral._
View
14 cassie-core/src/test/scala/com/twitter/cassie/codecs/tests/Utf8CodecTest.scala
@@ -1,3 +1,17 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie.codecs.tests
import com.twitter.cassie.codecs.tests.ByteBufferLiteral._
View
16 cassie-core/src/test/scala/com/twitter/cassie/examples/CassieRun.scala
@@ -1,8 +1,22 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie.tests.examples
import com.twitter.cassie._
import com.twitter.cassie.codecs.Utf8Codec
-import types.LexicalUUID
+import com.twitter.cassie.types.LexicalUUID
// TODO: unfortunate
import scala.collection.JavaConversions._
View
22 cassie-core/src/test/scala/com/twitter/cassie/tests/BatchMutationBuilderTest.scala
@@ -1,12 +1,26 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie.tests
-import scala.collection.JavaConversions._
import com.twitter.cassie.codecs.Utf8Codec
-import org.scalatest.Spec
+import com.twitter.cassie.util.ColumnFamilyTestHelper
+import com.twitter.cassie._
import org.scalatest.matchers.MustMatchers
import org.scalatest.mock.MockitoSugar
-import com.twitter.cassie._
-import com.twitter.cassie.util.ColumnFamilyTestHelper
+import org.scalatest.Spec
+import scala.collection.JavaConversions._
class BatchMutationBuilderTest extends Spec with MustMatchers with MockitoSugar with ColumnFamilyTestHelper {
View
27 cassie-core/src/test/scala/com/twitter/cassie/tests/ClusterRemapperTest.scala
@@ -1,15 +1,28 @@
-package com.twitter.cassie.tests
+// Copyright 2012 Twitter, Inc.
-import org.scalatest.matchers.MustMatchers
-import org.mockito.Mockito.when
-import org.scalatest.{ BeforeAndAfterAll, Spec }
-import java.net.{ SocketAddress, InetSocketAddress }
-import org.apache.cassandra.finagle.thrift
+// Licensed 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 com.twitter.cassie.tests
import com.twitter.cassie.ClusterRemapper
+import com.twitter.conversions.time._
import com.twitter.logging.Logger
+import java.net.{ SocketAddress, InetSocketAddress }
+import org.apache.cassandra.finagle.thrift
+import org.mockito.Mockito.when
+import org.scalatest.matchers.MustMatchers
+import org.scalatest.{ BeforeAndAfterAll, Spec }
import scala.collection.JavaConversions._
-import com.twitter.conversions.time._
class ClusterRemapperTest extends Spec with MustMatchers with BeforeAndAfterAll {
// val server = new MockCassandraServer(MockCassandraServer.choosePort())
View
20 cassie-core/src/test/scala/com/twitter/cassie/tests/ClusterTest.scala
@@ -1,10 +1,24 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie.tests
-import org.scalatest.matchers.MustMatchers
-import org.scalatest.Spec
import com.twitter.cassie.Cluster
-import org.scalatest.mock.MockitoSugar
import com.twitter.conversions.time._
+import org.scalatest.matchers.MustMatchers
+import org.scalatest.mock.MockitoSugar
+import org.scalatest.Spec
class ClusterTest extends Spec with MustMatchers with MockitoSugar {
describe("a cluster") {
View
36 cassie-core/src/test/scala/com/twitter/cassie/tests/ColumnFamilyTest.scala
@@ -1,20 +1,34 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie.tests
-import scala.collection.JavaConversions._
-import org.scalatest.Spec
-import org.scalatest.matchers.MustMatchers
-import org.scalatest.mock.MockitoSugar
import com.twitter.cassie.codecs.Utf8Codec
-import org.mockito.Mockito.{ when, verify }
-import org.mockito.Matchers.{ any, eq => matchEq, anyListOf }
-import org.apache.cassandra.finagle.thrift
-import org.mockito.ArgumentCaptor
-import java.nio.ByteBuffer
-import com.twitter.cassie._
-import scala.collection.mutable.ListBuffer
import com.twitter.cassie.util.ColumnFamilyTestHelper
+import com.twitter.cassie._
import com.twitter.util.Future
+import java.nio.ByteBuffer
import java.util.{ ArrayList => JArrayList }
+import org.apache.cassandra.finagle.thrift
+import org.mockito.ArgumentCaptor
+import org.mockito.Matchers.{ any, eq => matchEq, anyListOf }
+import org.mockito.Mockito.{ when, verify }
+import org.scalatest.matchers.MustMatchers
+import org.scalatest.mock.MockitoSugar
+import org.scalatest.Spec
+import scala.collection.JavaConversions._
+import scala.collection.mutable.ListBuffer
class ColumnFamilyTest extends Spec with MustMatchers with MockitoSugar with ColumnFamilyTestHelper {
View
18 cassie-core/src/test/scala/com/twitter/cassie/tests/ColumnTest.scala
@@ -1,9 +1,23 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie.tests
-import org.scalatest.Spec
-import org.scalatest.matchers.MustMatchers
import com.twitter.cassie.Column
import com.twitter.conversions.time._
+import org.scalatest.matchers.MustMatchers
+import org.scalatest.Spec
class ColumnTest extends Spec with MustMatchers {
describe("a column with an explicit ttl") {
View
26 cassie-core/src/test/scala/com/twitter/cassie/tests/ColumnsIterateeTest.scala
@@ -1,17 +1,31 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie.tests
+import com.twitter.cassie.util.ColumnFamilyTestHelper
+import com.twitter.cassie._
+import com.twitter.util.Future
import java.util.{ List => JList, HashSet => JHashSet, ArrayList => JArrayList }
+import org.apache.cassandra.finagle.thrift
+import org.mockito.Matchers.{ eq => matchEq }
+import org.mockito.Mockito.{ when, inOrder => inOrderVerify, verify, atMost }
import org.scalatest.matchers.MustMatchers
import org.scalatest.mock.MockitoSugar
import org.scalatest.{ OneInstancePerTest, Spec }
-import com.twitter.cassie._
-import org.mockito.Mockito.{ when, inOrder => inOrderVerify, verify, atMost }
-import org.mockito.Matchers.{ eq => matchEq }
-import org.apache.cassandra.finagle.thrift
import scala.collection.JavaConversions._
-import com.twitter.util.Future
import scala.collection.mutable.ListBuffer
-import com.twitter.cassie.util.ColumnFamilyTestHelper
class ColumnsIterateeTest extends Spec with MustMatchers with MockitoSugar with OneInstancePerTest with ColumnFamilyTestHelper {
View
14 cassie-core/src/test/scala/com/twitter/cassie/tests/CounterColumnFamilyTest.scala
@@ -1,3 +1,17 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie.tests
import com.twitter.cassie.codecs.Utf8Codec
View
14 cassie-core/src/test/scala/com/twitter/cassie/tests/CounterRowsIterateeTest.scala
@@ -1,3 +1,17 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie.tests
import com.twitter.cassie.util.ColumnFamilyTestHelper
View
36 cassie-core/src/test/scala/com/twitter/cassie/tests/KeyspaceTest.scala
@@ -1,21 +1,35 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie.tests
-import org.scalatest.{ Spec, BeforeAndAfterEach }
-import org.scalatest.matchers.MustMatchers
-import org.mockito.Matchers.{ anyObject }
-import org.mockito.Mockito._
-import org.scalatest.mock.MockitoSugar
+import com.twitter.cassie.clocks.Clock
import com.twitter.cassie.codecs.Utf8Codec
-import com.twitter.cassie.{ WriteConsistency, ReadConsistency, Keyspace }
-import com.twitter.cassie.connection.ClientProvider
import com.twitter.cassie.Column
-import com.twitter.cassie.clocks.Clock
-import org.apache.cassandra.finagle.thrift.Cassandra.ServiceToClient
+import com.twitter.cassie.connection.ClientProvider
+import com.twitter.cassie.{ WriteConsistency, ReadConsistency, Keyspace }
+import com.twitter.finagle.stats.NullStatsReceiver
import com.twitter.util.Future
-import java.util.{ HashMap, Map => JMap, List => JList, ArrayList => JArrayList }
import java.nio.ByteBuffer
+import java.util.{ HashMap, Map => JMap, List => JList, ArrayList => JArrayList }
import org.apache.cassandra.finagle.thrift
-import com.twitter.finagle.stats.NullStatsReceiver
+import org.apache.cassandra.finagle.thrift.Cassandra.ServiceToClient
+import org.mockito.Matchers.{ anyObject }
+import org.mockito.Mockito._
+import org.scalatest.matchers.MustMatchers
+import org.scalatest.mock.MockitoSugar
+import org.scalatest.{ Spec, BeforeAndAfterEach }
class KeyspaceTest extends Spec with MustMatchers with MockitoSugar with BeforeAndAfterEach {
View
18 cassie-core/src/test/scala/com/twitter/cassie/tests/ReadConsistencyTest.scala
@@ -1,9 +1,23 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie.tests
-import org.scalatest.Spec
-import org.scalatest.matchers.MustMatchers
import com.twitter.cassie.ReadConsistency
import org.apache.cassandra.finagle.thrift.ConsistencyLevel
+import org.scalatest.matchers.MustMatchers
+import org.scalatest.Spec
class ReadConsistencyTest extends Spec with MustMatchers {
describe("a read consistency of One") {
View
26 cassie-core/src/test/scala/com/twitter/cassie/tests/RowsIterateeTest.scala
@@ -1,17 +1,31 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie.tests
+import com.twitter.cassie.util.ColumnFamilyTestHelper
+import com.twitter.cassie._
+import com.twitter.util.Future
import java.util.{ List => JList, HashSet => JHashSet, ArrayList => JArrayList }
+import org.apache.cassandra.finagle.thrift
+import org.mockito.Matchers.{ eq => matchEq }
+import org.mockito.Mockito.{ when, inOrder => inOrderVerify }
import org.scalatest.matchers.MustMatchers
import org.scalatest.mock.MockitoSugar
import org.scalatest.{ OneInstancePerTest, Spec }
-import com.twitter.cassie._
-import org.mockito.Mockito.{ when, inOrder => inOrderVerify }
-import org.mockito.Matchers.{ eq => matchEq }
-import org.apache.cassandra.finagle.thrift
import scala.collection.JavaConversions._
-import com.twitter.util.Future
import scala.collection.mutable.ListBuffer
-import com.twitter.cassie.util.ColumnFamilyTestHelper
class RowsIterateeTest extends Spec with MustMatchers with MockitoSugar with OneInstancePerTest with ColumnFamilyTestHelper {
View
18 cassie-core/src/test/scala/com/twitter/cassie/tests/WriteConsistencyTest.scala
@@ -1,9 +1,23 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie.tests
-import org.scalatest.Spec
-import org.scalatest.matchers.MustMatchers
import com.twitter.cassie.WriteConsistency
import org.apache.cassandra.finagle.thrift.ConsistencyLevel
+import org.scalatest.matchers.MustMatchers
+import org.scalatest.Spec
class WriteConsistencyTest extends Spec with MustMatchers {
describe("a write consistency of Any") {
View
20 cassie-core/src/test/scala/com/twitter/cassie/types/tests/LexicalUUIDTest.scala
@@ -1,9 +1,23 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie.types.tests
-import org.scalatest.Spec
-import org.scalatest.matchers.MustMatchers
-import com.twitter.cassie.types.LexicalUUID
import com.twitter.cassie.clocks.Clock
+import com.twitter.cassie.types.LexicalUUID
+import org.scalatest.matchers.MustMatchers
+import org.scalatest.Spec
class LexicalUUIDTest extends Spec with MustMatchers {
describe("a lexical UUID") {
View
20 cassie-core/src/test/scala/com/twitter/cassie/util/ColumnFamilyTestHelper.scala
@@ -1,13 +1,27 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie.util
-import com.twitter.cassie.MockCassandraClient.SimpleProvider
import com.twitter.cassie.clocks.MicrosecondEpochClock
import com.twitter.cassie.codecs.Utf8Codec
-import org.apache.cassandra.finagle.thrift
+import com.twitter.cassie.MockCassandraClient.SimpleProvider
import com.twitter.cassie._
+import com.twitter.finagle.stats.NullStatsReceiver
import java.nio.ByteBuffer
+import org.apache.cassandra.finagle.thrift
import org.mockito.Matchers.any
-import com.twitter.finagle.stats.NullStatsReceiver
trait ColumnFamilyTestHelper {
type ColumnList = java.util.List[thrift.ColumnOrSuperColumn]
View
33 cassie-core/src/test/scala/com/twitter/cassie/util/FakeCassandraTest.scala
@@ -1,20 +1,33 @@
+// Copyright 2012 Twitter, Inc.
+
+// Licensed 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 com.twitter.cassie.tests.util
-import org.scalatest.matchers.MustMatchers
-import org.mockito.Mockito.when
-import org.scalatest._
+import com.twitter.cassie.codecs._