This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.InputStreamReader; | |
import java.net.URL; | |
import java.nio.channels.Channels; | |
import java.time.Instant; | |
import java.util.stream.Collectors; | |
public class Blocking { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2015/12/14 22:18:49 [debug] 2356#0: *976 ssi include: "/breadcrumb/1001212364/De`Longhi Cappuccino Thermo-Gläser doppelwandig 2 Stück" | |
2015/12/14 22:18:49 [debug] 2356#0: *976 http subrequest "/breadcrumb/1001212364/De`Longhi Cappuccino Thermo-Gläser doppelwandig 2 Stück?" | |
2015/12/14 22:18:49 [debug] 2356#0: *976 http posted request: "/breadcrumb/1001212364/De`Longhi Cappuccino Thermo-Gläser doppelwandig 2 Stück?" | |
2015/12/14 22:18:49 [debug] 2356#0: *976 http proxy header: | |
"GET /breadcrumb/1001212364/De`Longhi%20Cappuccino%20Thermo-Gl%c3%a4ser%20%20doppelwandig%202%20St%c3%bcck HTTP/1.1 | |
2015/12/14 22:18:49 [debug] 2356#0: *976 http finalize request: -4, "/breadcrumb/1001212364/De`Longhi Cappuccino Thermo-Gläser doppelwandig 2 Stück?" a:0, c:7 | |
2015/12/14 22:18:49 [debug] 2356#0: *976 http proxy status 400 "400 Bad Request" | |
2015/12/14 22:18:49 [debug] 2356#0: *976 http proxy header: "X-Error: Illegal character in path at index 25: /breadcrumb/1001212364/De`Longhi%20Cappuccino%20Thermo-Gl%c3%a4ser%20%20doppe |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.concurrent.atomic.AtomicReference | |
import scala.reflect.ClassTag | |
import java.lang.reflect.{Proxy => JProxy, Method, InvocationHandler} | |
/** | |
* Creates a proxy for a lazy value, in a project moving to dependency injection this | |
* was meant to replace legacy stuff where at app start time dependencies were loaded | |
* too early. | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.ino.solrs | |
import java.util.Arrays._ | |
import java.util.concurrent.atomic.{AtomicBoolean, AtomicInteger} | |
import java.util.concurrent.{Executors, TimeUnit} | |
import io.ino.solrs.SolrUtils._ | |
import org.apache.curator.test.TestingServer | |
import org.apache.solr.client.solrj.SolrQuery | |
import org.apache.solr.client.solrj.impl.CloudSolrClient |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object CassandraTracing { | |
def traceSegment(res: Future[ResultSet]): Future[ResultSet] = { | |
TraceRecorder.withTraceContextAndSystem { (ctx, system) => | |
// Because we don't know the actual table that was queried for now we | |
// use a general name for the segment, it's renamed once we have the result | |
val segment = ctx.startSegment("db", "cassandra-client", "datastax") | |
res.onComplete { | |
case Success(rs) => | |
// Get the table name from the result so that we can give the segment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package wsmultipart | |
import org.scalatestplus.play.{PlaySpec, OneServerPerSuite} | |
import org.scalatest.EitherValues | |
import play.api.mvc.Action | |
import play.api.mvc.Results._ | |
import play.api.libs.iteratee.{Done, Input, Cont, Iteratee, Enumerator} | |
import play.api.test.Helpers._ | |
import scala.concurrent.ExecutionContext.Implicits.global | |
import scala.collection.mutable |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package wsmultipart | |
import play.api.libs.ws.WSResponseHeaders | |
import play.api.libs.iteratee._ | |
import play.api.libs.iteratee.Parsing.MatchInfo | |
import play.api.http.{MediaType, HeaderNames} | |
import scala.concurrent.ExecutionContext.Implicits.global | |
object WSMultipartHandler { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import play.api.libs.iteratee._ | |
def fromStream(stream: OutputStream): Iteratee[Array[Byte], Unit] = Cont { | |
case [email protected] => | |
stream.close() | |
Done((), e) | |
case Input.El(data) => | |
stream.write(data) | |
fromStream(stream) | |
case Input.Empty => |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def multipartParser[A](partHandler: Map[String, String] => Iteratee[Array[Byte], A]): | |
BodyParser[Seq[A]] = parse.using { request => | |
val maybeBoundary = for { | |
mt <- request.mediaType | |
(_, value) <- mt.parameters.find(_._1.equalsIgnoreCase("boundary")) | |
boundary <- value | |
} yield ("\r\n--" + boundary).getBytes("utf-8") | |
maybeBoundary.map { boundary => |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package de.javakaffee.web.msm.serializer.kryo; | |
import static org.testng.Assert.assertEquals; | |
import static org.testng.Assert.assertNotNull; | |
import java.util.HashMap; | |
import java.util.Map; | |
import java.util.concurrent.ConcurrentHashMap; | |
import org.testng.annotations.Test; |
NewerOlder