∴ cat cabal.project
packages: tools/work-common/
tools/work-project/
I did the expected thing, and tried to build everything:
∴ cabal new-build
// Based on this answer https://stackoverflow.com/a/36945256/784804 | |
/* | |
* Copyright (c) 2018 Ian Kirk | |
* | |
* 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 |
{-# LANGUAGE ConstraintKinds, DataKinds, DeriveGeneric, DerivingVia #-} | |
{-# LANGUAGE ExplicitNamespaces, FlexibleContexts, FlexibleInstances #-} | |
{-# LANGUAGE GADTs, GeneralizedNewtypeDeriving, MultiParamTypeClasses #-} | |
{-# LANGUAGE PolyKinds, ScopedTypeVariables, StandaloneDeriving #-} | |
{-# LANGUAGE TypeApplications, TypeFamilies, TypeInType, TypeOperators #-} | |
{-# LANGUAGE UndecidableInstances #-} | |
{-# OPTIONS_GHC -Wall #-} | |
module Data.Aeson.Generic.DerivingVia | |
( StrFun(..), Setting(..), SumEncoding'(..), DefaultOptions, WithOptions(..) | |
, -- Utility type synonyms to save ticks (') before promoted data constructors |
import cats._ | |
import cats.implicits._ | |
trait MonadRandom[F[_]] { | |
def getRandom: F[Int] | |
} | |
final case class DummyRandom[A](a: A) | |
final case class RealRandom[A](a: A) |
kubectl get pods --all-namespaces | grep Evicted | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod |
∴ cat cabal.project
packages: tools/work-common/
tools/work-project/
I did the expected thing, and tried to build everything:
∴ cabal new-build
import io.prometheus.client.CollectorRegistry | |
import io.prometheus.client.dropwizard.DropwizardExports | |
import io.prometheus.client.hotspot.DefaultExports | |
import nl.grons.metrics.scala.DefaultInstrumented | |
import akka.actor.ActorSystem | |
import akka.stream.ActorMaterializer | |
import akka.http.scaladsl.Http | |
object App extends App with DefaultInstrumented { | |
# Base settings and GC logging | |
-server -XX:+AlwaysPreTouch # First should be default, but we make it explicit, second pre-zeroes memory mapped pages on JVM startup -- improves runtime performance | |
# -Xloggc:gc-%t.log # CUSTOMIZE LOCATION HERE - $path/gc-%t.log -- the %t in the gc log file path is so we get a new file with each JVM restart | |
-XX:NumberOfGCLogFiles=5 -XX:+UseGCLogFileRotation -XX:GCLogFileSize=20m # Limits the number of files, logs to folder | |
-XX:+PrintGC -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:+PrintHeapAtGC -XX:+PrintGCCause | |
-XX:+PrintTenuringDistribution -XX:+PrintReferenceGC -XX:+PrintAdaptiveSizePolicy # gather info on object age & reference GC time for further tuning if needed. | |
# G1 specific settings -- probably should be default for multi-core systems with >2 GB of heap (below that, default is probably fine) | |
-XX:+UseG1GC | |
-XX:+UseStringDeduplication |
Several Apache Spark APIs rely on the ability to serialize Scala closures. Closures may reference non-Serializable objects, preventing them from being serialized. In some cases (SI-1419 and others), however, these references are unnecessary and can be nulled out, allowing otherwise-unserializable closures to be serialized (in Spark, this nulling is performed by the ClosureCleaner
).
Scala 2.12's use of Java 8 lambdas for implementing closures appears to have broken our ability to serialize closures which contain local def
s. If we cannot resolve this problem, Spark will be unable to support Scala 2.12 and will be stuck on 2.10 and 2.11 forever.
As an example which illustrates this problem, the following closure
has a nested localDef
and is defined inside of a non-serializable class:
``
sealed abstract class Power | |
final abstract class On extends Power | |
final abstract class Off extends Power | |
class LightSwitch[State <: Power] private { | |
def on(implicit ev: State =:= Off) = LightSwitch.on | |
def off(implicit ev: State =:= On) = LightSwitch.off | |
def toggleP[S<:Power](implicit t: ToggleP[State,S]): LightSwitch[S] = new LightSwitch[S] | |
def toggleM[S<:Power](implicit t: ToggleM.Aux[State,S]): LightSwitch[S] = | |
new LightSwitch[S] |