Skip to content

Commit

Permalink
Merge pull request #136 from frees-io/arf-Upgrade-Cats-1.0.1
Browse files Browse the repository at this point in the history
Upgrade to cats 1.0.1
  • Loading branch information
AdrianRaFo authored Jan 8, 2018
2 parents 747c784 + 290b5b5 commit 1f09153
Show file tree
Hide file tree
Showing 72 changed files with 133 additions and 107 deletions.
6 changes: 4 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ pgpPassphrase := Some(getEnvVar("PGP_PASSPHRASE").getOrElse("").toCharArray)
pgpPublicRing := file(s"$gpgFolder/pubring.gpg")
pgpSecretRing := file(s"$gpgFolder/secring.gpg")

lazy val freesV = "0.5.1"

lazy val commonDependencies: Seq[ModuleID] = Seq(
%%("frees-async", "0.5.0"),
%%("frees-async-guava", "0.5.0"),
%%("frees-async",freesV),
%%("frees-async-guava",freesV),
%%("shapeless"),
%%("classy-core"),
%%("classy-config-typesafe"),
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/api/ClusterAPI.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2017-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/api/QueryModule.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2017-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/api/ResultSetAPI.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2017-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/api/SessionAPI.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2017-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/api/StatementAPI.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2017-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/api/package.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2017-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
20 changes: 13 additions & 7 deletions core/src/main/scala/codecs/package.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2017-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -71,22 +71,26 @@ package object codecs {

implicit val booleanCodec: ByteBufferCodec[Boolean] =
PrimitiveByteBufferCodec[Boolean](DataType.smallint(), byteSize = 1, defaultValue = false) {
byteBuffer => byteBuffer.get(byteBuffer.position()) == 1
byteBuffer =>
byteBuffer.get(byteBuffer.position()) == 1
}

implicit val byteCodec: ByteBufferCodec[Byte] =
PrimitiveByteBufferCodec[Byte](DataType.smallint(), byteSize = 1, defaultValue = 0) {
byteBuffer => byteBuffer.get(byteBuffer.position())
byteBuffer =>
byteBuffer.get(byteBuffer.position())
}

implicit val doubleCodec: ByteBufferCodec[Double] =
PrimitiveByteBufferCodec[Double](DataType.cdouble(), byteSize = 8, defaultValue = 0) {
byteBuffer => byteBuffer.getDouble(byteBuffer.position())
byteBuffer =>
byteBuffer.getDouble(byteBuffer.position())
}

implicit val floatCodec: ByteBufferCodec[Float] =
PrimitiveByteBufferCodec[Float](DataType.cfloat(), byteSize = 4, defaultValue = 0) {
byteBuffer => byteBuffer.getFloat(byteBuffer.position())
byteBuffer =>
byteBuffer.getFloat(byteBuffer.position())
}

implicit val intCodec: ByteBufferCodec[Int] =
Expand All @@ -96,12 +100,14 @@ package object codecs {

implicit val longCodec: ByteBufferCodec[Long] =
PrimitiveByteBufferCodec[Long](DataType.bigint(), byteSize = 8, defaultValue = 0) {
byteBuffer => byteBuffer.getLong(byteBuffer.position())
byteBuffer =>
byteBuffer.getLong(byteBuffer.position())
}

implicit val shortCodec: ByteBufferCodec[Short] =
PrimitiveByteBufferCodec[Short](DataType.smallint(), byteSize = 2, defaultValue = 0) {
byteBuffer => byteBuffer.getShort(byteBuffer.position())
byteBuffer =>
byteBuffer.getShort(byteBuffer.position())
}

implicit def byteBufferCodec[T](
Expand Down
5 changes: 3 additions & 2 deletions core/src/main/scala/config/Decoders.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2017-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -178,7 +178,8 @@ class Decoders[Config] extends DatastaxReads[Config] {
case (b, ContactPointList(l)) => b.addContactPoints(l.asJava)
case (b, ContactPointWithPortList(l)) => b.addContactPointsWithPorts(l.asJava)
}(contactPointListRead),
customField[Credentials]("credentials") { (b, v) => b.withCredentials(v.username, v.password)
customField[Credentials]("credentials") { (b, v) =>
b.withCredentials(v.username, v.password)
}(credentialsDecoder),
flagField("allowBetaProtocolVersion", _.allowBetaProtocolVersion),
flagField("enableSSL", _.withSSL),
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/config/model.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2017-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/config/reads/datastax.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2017-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/handlers/handlers.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2017-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/implicits.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2017-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/query/FieldLister.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2017-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/query/StatementGenerator.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2017-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2017-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2017-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2017-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/query/interpolator/package.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2017-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/query/mapper/ByteBufferMapper.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2017-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/query/mapper/ByteBufferToField.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2017-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/query/mapper/FieldToByteBuffer.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2017-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/query/model.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2017-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/query/query.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2017-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/schema/package.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2017-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2017-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2017-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2017-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -61,7 +61,7 @@ trait SchemaConversions {
E.flatten {
catchNonFatalAsSchemaError {
val columnsM: M[List[Table.Column]] =
E.traverse(metadata.getColumns.asScala.toList)(toTableColumn[M](_)(E))
metadata.getColumns.asScala.toList.traverse(toTableColumn(_)(E))
val pKeyM: M[PrimaryKey] = toPrimaryKey(
metadata.getPartitionKey.asScala.toList,
metadata.getClusteringColumns.asScala.toList)
Expand Down Expand Up @@ -111,7 +111,8 @@ trait SchemaConversions {

val typeName = TypeName(Some(KeyspaceName(userType.getKeyspace)), userType.getTypeName)

E.map(fieldsM) { list => CreateType(ifNotExists = false, typeName = typeName, fields = list)
E.map(fieldsM) { list =>
CreateType(ifNotExists = false, typeName = typeName, fields = list)
}
}
}
Expand Down Expand Up @@ -168,10 +169,12 @@ trait SchemaConversions {

val maybeCol: Option[M[DataType]] = collectionType.getName match {
case Name.LIST =>
typeArgs.headOption map { typeArg => E.map(toDataTypeNative(typeArg))(DataType.List)
typeArgs.headOption map { typeArg =>
E.map(toDataTypeNative(typeArg))(DataType.List)
}
case Name.SET =>
typeArgs.headOption map { typeArg => E.map(toDataTypeNative(typeArg))(DataType.Set)
typeArgs.headOption map { typeArg =>
E.map(toDataTypeNative(typeArg))(DataType.Set)
}
case Name.MAP =>
for {
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/schema/provider/package.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2017-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2017-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/schema/validator/package.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2017-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion core/src/test/scala/ListenableFuture2AsyncMSpec.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2017-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion core/src/test/scala/TestData.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2017-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion core/src/test/scala/TestUtils.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2017-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion core/src/test/scala/api/ClusterAPISpec.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2017-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
5 changes: 3 additions & 2 deletions core/src/test/scala/api/PackageAPISpec.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2017-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -34,7 +34,8 @@ class PackageAPISpec extends WordSpec with MatchersUtil with Checkers {
"apply the Kleisli function for a valid dependency" in {

check {
forAll { s: String => kleisli(sample).run(s) isEqualTo Success(s.length)
forAll { s: String =>
kleisli(sample).run(s) isEqualTo Success(s.length)
}
}

Expand Down
2 changes: 1 addition & 1 deletion core/src/test/scala/api/ResultSetAPISpec.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2017-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion core/src/test/scala/api/SessionAPISpec.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2017-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion core/src/test/scala/api/StatementAPISpec.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2017-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion core/src/test/scala/codecs/CodecsSpec.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2017-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Loading

0 comments on commit 1f09153

Please sign in to comment.