Skip to content

Instantly share code, notes, and snippets.

View l15k4's full-sized avatar
🎯
Focusing

Jakub Liska l15k4

🎯
Focusing
View GitHub Profile
box: globalwebindex/busybox-sbt
services:
- globalwebindex/busybox-es-test
- globalwebindex/ftp-test
build:
steps:
- script:
name: sbt
FROM frolvlad/alpine-oraclejdk8
MAINTAINER Jakub Liska liska.jakub@gmail.com
ENV SCALA_VERSION 2.11.7
ENV SCALA_HOME=/opt/scala-$SCALA_VERSION
ENV PATH=$PATH:$SCALA_HOME/bin
RUN apk --update add bash curl
RUN mkdir /opt && curl -jLks http://downloads.typesafe.com/scala/$SCALA_VERSION/scala-$SCALA_VERSION.tgz | gunzip -c - | tar -xf - -C /opt
FROM gwiq/scala
MAINTAINER Jakub Liska liska.jakub@gmail.com
ENV SBT_VERSION 0.13.9
ENV PATH=$PATH:/opt/sbt
RUN apk --update add curl bash
RUN mkdir /opt/sbt
ADD sbt /opt/sbt/
[Unit]
Description=Log Entries
After=docker.service
[Service]
Restart=always
RestartSec=1m
TimeoutStartSec=0
KillMode=none
import akka.stream.scaladsl.FlexiMerge.{ReadAny, MergeLogic}
import akka.stream.{Attributes, FanInShape2}
import akka.stream.scaladsl.FlexiMerge
class BypassingMerge[A, B] extends FlexiMerge[A, FanInShape2[A, B, A]](new FanInShape2("BMerge"), Attributes.name("BMerge")) {
def createMergeLogic(p: PortT): MergeLogic[A] = new MergeLogic[A] {
override def initialState =
State[Any](ReadAny(p)) { (ctx, input, element) =>
if (input eq p.in0)
import akka.stream._
import akka.stream.scaladsl.FlexiMerge
import akka.stream.scaladsl.FlexiMerge.{Read, ReadAll, MergeLogic}
import scala.collection.{immutable, mutable}
class ParallelMergeLogic[A](remainingInlets: mutable.Set[Inlet[A]]) extends MergeLogic[immutable.Seq[A]] {
override def initialState = State(ReadAll(remainingInlets.toIndexedSeq)) {
import akka.stream.SourceShape
import akka.stream.scaladsl.{GraphDSL, Sink, Source}
import akka.stream.testkit.TestSubscriber
class BypassMergeTestSuite extends AkkaSuite {
import scala.language.implicitConversions
def assertBypassWorks[O, B](output: List[O], bypassed: List[B])(launch: TestSubscriber.ManualProbe[O] => Unit) = {
val source = Source.fromGraph(
GraphDSL.create() { implicit b =>
def generateTimeField(format: SimpleDateFormat)(i: Int) = do-stuff-with-thread-unsafe-format
val curriedF = generateTimeField(new SimpleDateFormat("foo"))_
List(1,2,3,4).par.map(curriedF)
2016-01-20 21:20:08,018 DEBG 'druid-indexing-service' stderr output:
com.google.inject.CreationException: Guice creation errors:
1) No implementation for java.util.concurrent.ScheduledExecutorService was bound.
while locating java.util.concurrent.ScheduledExecutorService
for parameter 9 at io.druid.indexing.overlord.RemoteTaskRunnerFactory.<init>(RemoteTaskRunnerFactory.java:72)
at io.druid.cli.CliOverlord$1.configureRunners(CliOverlord.java:201)
2) No implementation for java.util.concurrent.ScheduledExecutorService was bound.
while locating java.util.concurrent.ScheduledExecutorService
@l15k4
l15k4 / foo.json
Last active January 21, 2016 18:40
{
"type" : "index",
"spec" : {
"dataSchema" : {
"dataSource" : "foo",
"parser" : {
"type" : "string",
"parseSpec":{
"format" : "tsv",
"timestampSpec" : {