spark-instrumented-optimizer/licenses
mcheah 270a9a3cac [SPARK-24248][K8S] Use level triggering and state reconciliation in scheduling and lifecycle
## What changes were proposed in this pull request?

Previously, the scheduler backend was maintaining state in many places, not only for reading state but also writing to it. For example, state had to be managed in both the watch and in the executor allocator runnable. Furthermore, one had to keep track of multiple hash tables.

We can do better here by:

1. Consolidating the places where we manage state. Here, we take inspiration from traditional Kubernetes controllers. These controllers tend to follow a level-triggered mechanism. This means that the controller will continuously monitor the API server via watches and polling, and on periodic passes, the controller will reconcile the current state of the cluster with the desired state. We implement this by introducing the concept of a pod snapshot, which is a given state of the executors in the Kubernetes cluster. We operate periodically on snapshots. To prevent overloading the API server with polling requests to get the state of the cluster (particularly for executor allocation where we want to be checking frequently to get executors to launch without unbearably bad latency), we use watches to populate snapshots by applying observed events to a previous snapshot to get a new snapshot. Whenever we do poll the cluster, the polled state replaces any existing snapshot - this ensures eventual consistency and mirroring of the cluster, as is desired in a level triggered architecture.

2. Storing less specialized in-memory state in general. Previously we were creating hash tables to represent the state of executors. Instead, it's easier to represent state solely by the snapshots.

## How was this patch tested?

Integration tests should test there's no regressions end to end. Unit tests to be updated, in particular focusing on different orderings of events, particularly accounting for when events come in unexpected ordering.

Author: mcheah <mcheah@palantir.com>

Closes #21366 from mccheah/event-queue-driven-scheduling.
2018-06-14 15:56:21 -07:00
..
LICENSE-AnchorJS.txt [SPARK-10833] [BUILD] Inline, organize BSD/MIT licenses in LICENSE 2015-09-28 22:56:43 -04:00
LICENSE-antlr.txt [SPARK-10833] [BUILD] Inline, organize BSD/MIT licenses in LICENSE 2015-09-28 22:56:43 -04:00
LICENSE-boto.txt [SPARK-10833] [BUILD] Inline, organize BSD/MIT licenses in LICENSE 2015-09-28 22:56:43 -04:00
LICENSE-cloudpickle.txt [SPARK-10833] [BUILD] Inline, organize BSD/MIT licenses in LICENSE 2015-09-28 22:56:43 -04:00
LICENSE-d3.min.js.txt [SPARK-10833] [BUILD] Inline, organize BSD/MIT licenses in LICENSE 2015-09-28 22:56:43 -04:00
LICENSE-dagre-d3.txt [SPARK-10833] [BUILD] Inline, organize BSD/MIT licenses in LICENSE 2015-09-28 22:56:43 -04:00
LICENSE-DPark.txt [SPARK-10833] [BUILD] Inline, organize BSD/MIT licenses in LICENSE 2015-09-28 22:56:43 -04:00
LICENSE-f2j.txt [SPARK-10833] [BUILD] Inline, organize BSD/MIT licenses in LICENSE 2015-09-28 22:56:43 -04:00
LICENSE-graphlib-dot.txt [SPARK-10833] [BUILD] Inline, organize BSD/MIT licenses in LICENSE 2015-09-28 22:56:43 -04:00
LICENSE-heapq.txt [SPARK-10833] [BUILD] Inline, organize BSD/MIT licenses in LICENSE 2015-09-28 22:56:43 -04:00
LICENSE-javolution.txt [SPARK-10833] [BUILD] Inline, organize BSD/MIT licenses in LICENSE 2015-09-28 22:56:43 -04:00
LICENSE-jbcrypt.txt [SPARK-10833] [BUILD] Inline, organize BSD/MIT licenses in LICENSE 2015-09-28 22:56:43 -04:00
LICENSE-jline.txt [SPARK-10833] [BUILD] Inline, organize BSD/MIT licenses in LICENSE 2015-09-28 22:56:43 -04:00
LICENSE-jmock.txt [SPARK-24248][K8S] Use level triggering and state reconciliation in scheduling and lifecycle 2018-06-14 15:56:21 -07:00
LICENSE-jpmml-model.txt [SPARK-10833] [BUILD] Inline, organize BSD/MIT licenses in LICENSE 2015-09-28 22:56:43 -04:00
LICENSE-jquery.txt [SPARK-10833] [BUILD] Inline, organize BSD/MIT licenses in LICENSE 2015-09-28 22:56:43 -04:00
LICENSE-junit-interface.txt [SPARK-10833] [BUILD] Inline, organize BSD/MIT licenses in LICENSE 2015-09-28 22:56:43 -04:00
LICENSE-kryo.txt [SPARK-10833] [BUILD] Inline, organize BSD/MIT licenses in LICENSE 2015-09-28 22:56:43 -04:00
LICENSE-minlog.txt [SPARK-10833] [BUILD] Inline, organize BSD/MIT licenses in LICENSE 2015-09-28 22:56:43 -04:00
LICENSE-Mockito.txt [SPARK-10833] [BUILD] Inline, organize BSD/MIT licenses in LICENSE 2015-09-28 22:56:43 -04:00
LICENSE-modernizr.txt [MINOR][BUILD] Add modernizr MIT license; specify "2014 and onwards" in license copyright 2016-06-04 21:41:27 +01:00
LICENSE-netlib.txt [SPARK-10833] [BUILD] Inline, organize BSD/MIT licenses in LICENSE 2015-09-28 22:56:43 -04:00
LICENSE-paranamer.txt [SPARK-10833] [BUILD] Inline, organize BSD/MIT licenses in LICENSE 2015-09-28 22:56:43 -04:00
LICENSE-postgresql.txt [SPARK-14050][ML] Add multiple languages support and additional methods for Stop Words Remover 2016-05-06 13:58:12 -07:00
LICENSE-protobuf.txt [SPARK-10833] [BUILD] Inline, organize BSD/MIT licenses in LICENSE 2015-09-28 22:56:43 -04:00
LICENSE-py4j.txt [SPARK-10833] [BUILD] Inline, organize BSD/MIT licenses in LICENSE 2015-09-28 22:56:43 -04:00
LICENSE-pyrolite.txt [SPARK-10833] [BUILD] Inline, organize BSD/MIT licenses in LICENSE 2015-09-28 22:56:43 -04:00
LICENSE-reflectasm.txt [SPARK-10833] [BUILD] Inline, organize BSD/MIT licenses in LICENSE 2015-09-28 22:56:43 -04:00
LICENSE-sbt-launch-lib.txt [SPARK-10833] [BUILD] Inline, organize BSD/MIT licenses in LICENSE 2015-09-28 22:56:43 -04:00
LICENSE-scala.txt [SPARK-10833] [BUILD] Inline, organize BSD/MIT licenses in LICENSE 2015-09-28 22:56:43 -04:00
LICENSE-scalacheck.txt [SPARK-10833] [BUILD] Inline, organize BSD/MIT licenses in LICENSE 2015-09-28 22:56:43 -04:00
LICENSE-scopt.txt [SPARK-10833] [BUILD] Inline, organize BSD/MIT licenses in LICENSE 2015-09-28 22:56:43 -04:00
LICENSE-slf4j.txt [SPARK-10833] [BUILD] Inline, organize BSD/MIT licenses in LICENSE 2015-09-28 22:56:43 -04:00
LICENSE-SnapTree.txt [SPARK-10833] [BUILD] Inline, organize BSD/MIT licenses in LICENSE 2015-09-28 22:56:43 -04:00
LICENSE-sorttable.js.txt [SPARK-10833] [BUILD] Inline, organize BSD/MIT licenses in LICENSE 2015-09-28 22:56:43 -04:00
LICENSE-spire.txt [SPARK-10833] [BUILD] Inline, organize BSD/MIT licenses in LICENSE 2015-09-28 22:56:43 -04:00
LICENSE-xmlenc.txt [SPARK-10833] [BUILD] Inline, organize BSD/MIT licenses in LICENSE 2015-09-28 22:56:43 -04:00
LICENSE-zstd-jni.txt [SPARK-19112][CORE] Support for ZStandard codec 2017-11-01 14:54:08 +01:00
LICENSE-zstd.txt [SPARK-19112][CORE] Support for ZStandard codec 2017-11-01 14:54:08 +01:00