SlideShare uma empresa Scribd logo
1 de 46
Baixar para ler offline
© 2020 SPLUNK INC.
Pulsar Functions
A Deep Dive | Pulsar Summit 2020
Sanjeev Kulkarni
sanjeevk@splunk.com
© 2020 SPLUNK INC.
Pulsar Functions:- A Deep Dive
Brief introduction to Pulsar Functions
Deep Dive into internals
• Submission workflow
• Scheduling workflow
• Execution workflow
• Java Instance concepts
Current/Future Work
Agenda
© 2020 SPLUNK INC.
Pulsar Functions:- A Deep Dive
Brief introduction to Pulsar Functions
Deep Dive into internals
• Submission workflow
• Scheduling workflow
• Execution workflow
• Java Instance concepts
Current/Future Work
Agenda
© 2020 SPLUNK INC.
Pulsar Functions:- A Brief Introduction
Bringing Serverless concepts to the
streaming world.
Execute processing logic per
message on input topic
Function output goes to an output
topic
• Optional
Abstract View
Core Concept
© 2020 SPLUNK INC.
Pulsar Functions:- A Brief Introduction
Emphasis on simplicity
Great for 90% use-cases on streams
• Filtering
• Routing
• Enrichment
Not meant to replace Spark/Flink
SDK-less API
import java.util.function.Function;
public class ExclamationFunction implements Function<String, String> {
@Override
public String apply(String input) {
return input + "!";
}
}
Simple API
© 2020 SPLUNK INC.
Pulsar Functions:- A Brief Introduction
Flexible execution environments
• Pulsar managed
– Thread
– Process
• Externally managed
– Kubernetes
CRUD based Rest API
Function lifecycle
© 2020 SPLUNK INC.
Pulsar Functions:- A Deep Dive
Brief introduction to Pulsar Functions
Deep Dive into internals
• Submission workflow
• Scheduling workflow
• Execution workflow
• Java Instance concepts
Current/Future Work
Agenda
© 2020 SPLUNK INC.
Pulsar Functions:- Submission Workflow
Submit to any worker
Json repr of FunctionConfig
• tenant/namespace/name
• Input/Output
• configs
• lot more knobs ….
Function Code
• jars/.py/zip/etc
FunctionConfig
public class FunctionConfig {
private String tenant;
private String namespace;
private String name;
private String className;
private Collection<String> inputs;
private String output;
private ProcessingGuarantees processingGuarantees;
private Map<String, Object> userConfig;
private Map<String, Object> secrets;
private Integer parallelism;
private Resources resources;
...
}
Function Representation
© 2020 SPLUNK INC.
Pulsar Functions:- Submission Workflow
AuthN/AuthZ checks
FunctionConfig validation
• missing parameters
• Incorrect parameters
• Local Configs
Function Code Validation
• class presence, etc
Copy Code to Bookeeper
FunctionMetaData
message FunctionMetaData {
FunctionDetails functionDetails;
PackageLocationMetaData packageLocation;
uint64 version;
uint64 createTime;
map<int32, FunctionState> instanceStates;
FunctionAuthenticationSpec functionAuthSpec;
}
Submission Checks
© 2020 SPLUNK INC.
Pulsar Functions:- Submission Workflow
System of record
Stores all Functions
• map from <FQFN, FunctionMetaData>
FQFN:- Fully Qualified Function
Name
Backed by Pulsar Topic
• Function MetaData Topic
Contains a MetaData Topic Tailer
Function MetaData Manager
Function MetaData Manager
MetaData Topic Tailer
MetaData Topic
foo -> {functionDetails : {...},
version: 2,
…}
© 2020 SPLUNK INC.
Pulsar Functions:- Submission Workflow
Just before Function
creation/update/delete
Function MetaData Manager:- Update State Machine
MetaData Topic Tailer
MetaData Topic
foo -> {functionDetails : {...},
version: 2,
…}
© 2020 SPLUNK INC.
Pulsar Functions:- Submission Workflow
Make a copy of the current state
Function MetaData Manager:- Update State Machine
MetaData Topic Tailer
MetaData Topic
foo -> {functionDetails : {...},
version: 2,
…}
foo -> {functionDetails : {...},
version: 2,
…}
© 2020 SPLUNK INC.
Pulsar Functions:- Submission Workflow
Make a copy of the current state
Merge the updates
Function MetaData Manager:- Update State Machine
MetaData Topic Tailer
MetaData Topic
foo -> {functionDetails : {...},
version: 2,
…}
foo -> {functionDetails : {......},
version: 2,
…}
© 2020 SPLUNK INC.
Pulsar Functions:- Submission Workflow
Make a copy of the current state
Merge the updates
Increment the version
Function MetaData Manager:- Update State Machine
MetaData Topic Tailer
MetaData Topic
foo -> {functionDetails : {...},
version: 2,
…}
foo -> {functionDetails : {......},
version: 3,
…}
© 2020 SPLUNK INC.
Pulsar Functions:- Submission Workflow
Make a copy of the current state
Merge the updates
Increment the version
Write to MetaData Topic
Function MetaData Manager:- Update State Machine
MetaData Topic Tailer
MetaData Topic
foo -> {functionDetails : {...},
version: 2,
…}
© 2020 SPLUNK INC.
Pulsar Functions:- Submission Workflow
Make a copy of the current state
Merge the updates
Increment the version
Write to MetaData Topic
Tailer reads and verifies
Function MetaData Manager:- Update State Machine
MetaData Topic Tailer
MetaData Topic
foo -> {functionDetails : {...},
version: 2,
…}
© 2020 SPLUNK INC.
Pulsar Functions:- Submission Workflow
Make a copy of the current state
Merge the updates
Increment the version
Write to MetaData Topic
Tailer reads and verifies
Upon no conflict, tailer updates
Function MetaData Manager:- Update State Machine
MetaData Topic Tailer
MetaData Topic
foo -> {functionDetails : {.....},
version: 3,
…}
© 2020 SPLUNK INC.
Pulsar Functions:- Submission Workflow
Multiple Workers
Function MetaData Manager:- When do conflicts occur?
MetaData Topic Tailer
MetaData Topic
foo -> {functionDetails : {...},
version: 2,
…}
Worker 1
MetaData Topic Tailer
foo -> {functionDetails : {...},
version: 2,
…}
Worker 2
© 2020 SPLUNK INC.
Pulsar Functions:- Submission Workflow
Multiple Workers
Concurrent updates to same function
Function MetaData Manager:- When do conflicts occur?
MetaData Topic Tailer
MetaData Topic
foo -> {functionDetails : {...},
version: 2,
…}
Worker 1
MetaData Topic Tailer
foo -> {functionDetails : {...},
version: 2,
…}
Worker 2
© 2020 SPLUNK INC.
Pulsar Functions:- Submission Workflow
Multiple Workers
Concurrent updates to same function
First Writer Wins
Function MetaData Manager:- When do conflicts occur?
MetaData Topic Tailer
MetaData Topic
foo -> {functionDetails : {...},
version: 3,
…}
Worker 1
MetaData Topic Tailer
foo -> {functionDetails : {...},
version: 3,
…}
Worker 2
© 2020 SPLUNK INC.
Pulsar Functions:- Submission Workflow
Multiple Workers
Concurrent updates to same function
First Writer Wins
Others are rejected
Function MetaData Manager:- When do conflicts occur?
MetaData Topic Tailer
MetaData Topic
foo -> {functionDetails : {...},
version: 3,
…}
Worker 1
MetaData Topic Tailer
foo -> {functionDetails : {...},
version: 3,
…}
Worker 2
© 2020 SPLUNK INC.
Pulsar Functions:- Submission Workflow
Submit to any worker
Validation load scales linearly
Deterministic State Machine
MetaData Topic is audit log
Advantages
MetaData Topic Tailer
MetaData Topic
foo -> {functionDetails : {...},
version: 3,
…}
Worker 1
MetaData Topic Tailer
foo -> {functionDetails : {...},
version: 3,
…}
Worker 2
© 2020 SPLUNK INC.
Pulsar Functions:- Submission Workflow
MetaData topic topic growth
MetaData Topic compaction
non-trivial
Worker Start time
All Workers know everything
Pitfalls
MetaData Topic Tailer
MetaData Topic
foo -> {functionDetails : {...},
version: 3,
…}
Worker 1
MetaData Topic Tailer
foo -> {functionDetails : {...},
version: 3,
…}
Worker 2
© 2020 SPLUNK INC.
Pulsar Functions:- A Deep Dive
Brief introduction to Pulsar Functions
Deep Dive into internals
• Submission workflow
• Scheduling workflow
• Execution workflow
• Java Instance concepts
Current/Future Work
Agenda
© 2020 SPLUNK INC.
Pulsar Functions:- Scheduling Workflow
Abstracts out Scheduler
Executed only on a Leader
Invoked when
• Function CRUD operations
– create/update
– delete
• Worker Changes
– Unresponsive/dead workers
– New workers
– Periodic
– Leadership changes
IScheduler Interface
public interface IScheduler {
List<Assignment> schedule(<List<Instance> unassigned,
List<Instance> current,
Set<String> workers);
}
Pluggable Scheduler
© 2020 SPLUNK INC.
Pulsar Functions:- Scheduling Workflow
Empty Coordination Topic
Failover Subscription
Active Consumer is the Leader
Leader Election
Leader Election
Coordination Topic
Worker 1Worker 2Worker 3
© 2020 SPLUNK INC.
Pulsar Functions:- Scheduling Workflow
Assignment Topic
Written by the Leader
Compacted based on key(FQFN +
Instance Id)
All workers know about all
assignments
Function Assignments
Assignment Topic
Worker 1Worker 2Worker 3
{foo, 1} : worker-1,
...
{foo, 1} : worker-1,
...
{foo, 1} : worker-1,
...
Assignment Tailer Assignment Tailer Assignment Tailer
© 2020 SPLUNK INC.
Pulsar Functions:- Scheduling Workflow
Stores Assignment
Compacted
Key -> (FQFN + InstanceId)
Assignment
message Instance {
FunctionMetaData functionMetaData = 1;
int32 instanceId = 2;
}
message Assignment {
Instance instance = 1;
string workerId = 2;
}
Assignment Topic
© 2020 SPLUNK INC.
Pulsar Functions:- A Deep Dive
Brief introduction to Pulsar Functions
Deep Dive into internals
• Submission workflow
• Scheduling workflow
• Execution workflow
• Java Instance concepts
Current/Future Work
Agenda
© 2020 SPLUNK INC.
Pulsar Functions:- Execution Workflow
Triggered by Changes to
Assignment Table
Takes care of the worker’s specific
assignments
Function lifecycle management via
Spawner
Function RunTime Manager
Assignment Topic
Worker
{foo, 1} : worker-1,
...
Assignment Tailer
RunTime Manager
Spawner Spawner
© 2020 SPLUNK INC.
Pulsar Functions:- Execution Workflow
Abstracts out execution
environments using Runtime Factory
Manages Function lifecycle
Maintains grpc connection with
Function instance
Spawner
GRPC Channel
Spawner
Function
© 2020 SPLUNK INC.
Pulsar Functions:- Execution Workflow
Short-circuit MetaData Manager and
Runtime Manager
Directly use Spawner
Local Runner
GRPC Channel
Spawner
Function
Local Runner
© 2020 SPLUNK INC.
Pulsar Functions:- Execution Workflow
Simple interface for creating
execution environments
Creates Runtimes
Runtime Factory
public interface RuntimeFactory {
void initialize(WorkerConfig workerConfig);
Runtime createContainer(InstanceConfig instanceConfig,
String codeFile);
void close();
}
Runtime Factory
© 2020 SPLUNK INC.
Pulsar Functions:- A Deep Dive
Brief introduction to Pulsar Functions
Deep Dive into internals
• Submission workflow
• Scheduling workflow
• Execution workflow
• Java Instance concepts
Current/Future Work
Agenda
© 2020 SPLUNK INC.
Pulsar Functions:- Java Instance
Java Instance is (source, function,
sink) ensemble.
Source abstracts reading from input
topics
Sink abstracts writing to output topic
Java Instance
Source -> Process -> Sink
Source Sink
f
© 2020 SPLUNK INC.
Pulsar Functions:- Java Instance
Pulsar Source implements the
Source interface to read from Pulsar
topics
Pulsar Sink implements Sink
interface to write to Pulsar topic
Java Instance
Regular Pulsar Functions
Pulsar
Source
Pulsar
Sink
f
© 2020 SPLUNK INC.
Pulsar Functions:- Java Instance
Java Instance
What if we have non-Pulsar Source?
Non
Pulsar
Source
Pulsar
Sink
f
© 2020 SPLUNK INC.
Pulsar Functions:- Java Instance
Java Instance
Pulsar IO
Non
Pulsar
Source
Pulsar
Sink
f
© 2020 SPLUNK INC.
Pulsar Functions:- Java Instance
Non Pulsar Source reads from
external system
Identity Function lets the data pass
thru
Pulsar Sink writes to Pulsar
Java Instance
Pulsar IO Source
Non
Pulsar
Source
SinkIdentity
© 2020 SPLUNK INC.
Pulsar Functions:- Java Instance
Pulsar Source reads from Pulsar
topics
Identity Function lets the data pass
thru
Non Pulsar Sink writes to an external
system
Java Instance
Pulsar IO Sink
Pulsar
Source
Non
Pulsar
Sink
Identity
© 2020 SPLUNK INC.
Pulsar Functions:- A Deep Dive
Brief introduction to Pulsar Functions
Deep Dive into internals
• Submission workflow
• Scheduling workflow
• Execution workflow
• Java Instance concepts
Current/Future Work
Agenda
© 2020 SPLUNK INC.
Pulsar Functions:- Future Work
Each setup only supports a static
Runtime(Process/Thread/Pods)
Change it to be dynamically
specified during submission
Function RunTime Manager
Changes
Dynamic Runtime Selection
Assignment Topic
Worker
{foo, 1} : worker-1,
...
Assignment Tailer
RunTime Manager
Spawner
Function-1
Spawner
Function-2
Thread
Process
© 2020 SPLUNK INC.
Pulsar Functions:- Future Work
MetaData Topic not compacted
Stores all function change requests
Worker needs to read from
beginning upon startup
Function MetaData Topic Compaction
MetaData Topic Tailer
MetaData Topic
foo -> {functionDetails : {...},
version: 2,
…}
© 2020 SPLUNK INC.
Pulsar Functions:- Future Work
Chaining Functions
Output of one going as input of
others
A simple workflow API
Function Mesh
f1
f2
f3
f4
© 2020 SPLUNK INC.
Pulsar Functions:- Future Work
Discover/Collect Cycle
Repeating Cycle
Don’t drop discovered tasks on
failures
BatchSource
public interface BatchSource<T> {
void open(final Map<String, Object> config,
SourceContext context);
void discover(Consumer<byte[]> taskEater);
void prepare(byte[] task);
Record<T> readNext();
}
Batch Sources
Thank You
© 2020 SPLUNK INC.

Mais conteúdo relacionado

Mais procurados

Writing Continuous Applications with Structured Streaming PySpark API
Writing Continuous Applications with Structured Streaming PySpark APIWriting Continuous Applications with Structured Streaming PySpark API
Writing Continuous Applications with Structured Streaming PySpark API
Databricks
 

Mais procurados (20)

PySpark dataframe
PySpark dataframePySpark dataframe
PySpark dataframe
 
Introduction to KSQL: Streaming SQL for Apache Kafka®
Introduction to KSQL: Streaming SQL for Apache Kafka®Introduction to KSQL: Streaming SQL for Apache Kafka®
Introduction to KSQL: Streaming SQL for Apache Kafka®
 
[OpenStack Days Korea 2016] Track1 - Monasca를 이용한 Cloud 모니터링
[OpenStack Days Korea 2016] Track1 - Monasca를 이용한 Cloud 모니터링[OpenStack Days Korea 2016] Track1 - Monasca를 이용한 Cloud 모니터링
[OpenStack Days Korea 2016] Track1 - Monasca를 이용한 Cloud 모니터링
 
JupyterHub - A "Thing Explainer" Overview
JupyterHub - A "Thing Explainer" OverviewJupyterHub - A "Thing Explainer" Overview
JupyterHub - A "Thing Explainer" Overview
 
Writing Continuous Applications with Structured Streaming PySpark API
Writing Continuous Applications with Structured Streaming PySpark APIWriting Continuous Applications with Structured Streaming PySpark API
Writing Continuous Applications with Structured Streaming PySpark API
 
Hadoop Query Performance Smackdown
Hadoop Query Performance SmackdownHadoop Query Performance Smackdown
Hadoop Query Performance Smackdown
 
Lessons from the Field: Applying Best Practices to Your Apache Spark Applicat...
Lessons from the Field: Applying Best Practices to Your Apache Spark Applicat...Lessons from the Field: Applying Best Practices to Your Apache Spark Applicat...
Lessons from the Field: Applying Best Practices to Your Apache Spark Applicat...
 
톰캣 운영 노하우
톰캣 운영 노하우톰캣 운영 노하우
톰캣 운영 노하우
 
Introduction to Apache Kafka
Introduction to Apache KafkaIntroduction to Apache Kafka
Introduction to Apache Kafka
 
DoK Talks #91- Leveraging Druid Operator to manage Apache Druid on Kubernetes
DoK Talks #91- Leveraging Druid Operator to manage Apache Druid on KubernetesDoK Talks #91- Leveraging Druid Operator to manage Apache Druid on Kubernetes
DoK Talks #91- Leveraging Druid Operator to manage Apache Druid on Kubernetes
 
kafka
kafkakafka
kafka
 
Performance Tuning RocksDB for Kafka Streams' State Stores (Dhruba Borthakur,...
Performance Tuning RocksDB for Kafka Streams' State Stores (Dhruba Borthakur,...Performance Tuning RocksDB for Kafka Streams' State Stores (Dhruba Borthakur,...
Performance Tuning RocksDB for Kafka Streams' State Stores (Dhruba Borthakur,...
 
Developing custom transformation in the Kafka connect to minimize data redund...
Developing custom transformation in the Kafka connect to minimize data redund...Developing custom transformation in the Kafka connect to minimize data redund...
Developing custom transformation in the Kafka connect to minimize data redund...
 
State transfer With Galera
State transfer With GaleraState transfer With Galera
State transfer With Galera
 
Big Data Security in Apache Projects by Gidon Gershinsky
Big Data Security in Apache Projects by Gidon GershinskyBig Data Security in Apache Projects by Gidon Gershinsky
Big Data Security in Apache Projects by Gidon Gershinsky
 
Looking towards an official cassandra sidecar netflix
Looking towards an official cassandra sidecar   netflixLooking towards an official cassandra sidecar   netflix
Looking towards an official cassandra sidecar netflix
 
Sources와 Sinks를 Confluent Cloud에 원활하게 연결
Sources와 Sinks를 Confluent Cloud에 원활하게 연결Sources와 Sinks를 Confluent Cloud에 원활하게 연결
Sources와 Sinks를 Confluent Cloud에 원활하게 연결
 
Stream processing using Kafka
Stream processing using KafkaStream processing using Kafka
Stream processing using Kafka
 
Real-time Stream Processing with Apache Flink
Real-time Stream Processing with Apache FlinkReal-time Stream Processing with Apache Flink
Real-time Stream Processing with Apache Flink
 
Getting Started with Apache Spark on Kubernetes
Getting Started with Apache Spark on KubernetesGetting Started with Apache Spark on Kubernetes
Getting Started with Apache Spark on Kubernetes
 

Semelhante a Pulsar Functions Deep Dive_Sanjeev kulkarni

Semelhante a Pulsar Functions Deep Dive_Sanjeev kulkarni (20)

How Splunk Is Using Pulsar IO
How Splunk Is Using Pulsar IOHow Splunk Is Using Pulsar IO
How Splunk Is Using Pulsar IO
 
Project Reactor Now and Tomorrow
Project Reactor Now and TomorrowProject Reactor Now and Tomorrow
Project Reactor Now and Tomorrow
 
Spring_Boot_Microservices-5_Day_Session.pptx
Spring_Boot_Microservices-5_Day_Session.pptxSpring_Boot_Microservices-5_Day_Session.pptx
Spring_Boot_Microservices-5_Day_Session.pptx
 
How eBay does Automatic Outage Planning
How eBay does Automatic Outage PlanningHow eBay does Automatic Outage Planning
How eBay does Automatic Outage Planning
 
Von neumann workers
Von neumann workersVon neumann workers
Von neumann workers
 
Tosca v1.2 and v1.3 enhancements 2019 05-06
Tosca v1.2 and v1.3 enhancements 2019 05-06Tosca v1.2 and v1.3 enhancements 2019 05-06
Tosca v1.2 and v1.3 enhancements 2019 05-06
 
Spinning your Drones with Cadence Workflows and Apache Kafka
Spinning your Drones with Cadence Workflows and Apache KafkaSpinning your Drones with Cadence Workflows and Apache Kafka
Spinning your Drones with Cadence Workflows and Apache Kafka
 
What's new for Apache Flink's Table & SQL APIs?
What's new for Apache Flink's Table & SQL APIs?What's new for Apache Flink's Table & SQL APIs?
What's new for Apache Flink's Table & SQL APIs?
 
Integration-Monday-Stateful-Programming-Models-Serverless-Functions
Integration-Monday-Stateful-Programming-Models-Serverless-FunctionsIntegration-Monday-Stateful-Programming-Models-Serverless-Functions
Integration-Monday-Stateful-Programming-Models-Serverless-Functions
 
Apache Cassandra and Apche Spark
Apache Cassandra and Apche SparkApache Cassandra and Apche Spark
Apache Cassandra and Apche Spark
 
Spring Cloud Data Flow Overview
Spring Cloud Data Flow OverviewSpring Cloud Data Flow Overview
Spring Cloud Data Flow Overview
 
Data Microservices In The Cloud + 日本語コメント
Data Microservices In The Cloud + 日本語コメントData Microservices In The Cloud + 日本語コメント
Data Microservices In The Cloud + 日本語コメント
 
Spring Performance Gains
Spring Performance GainsSpring Performance Gains
Spring Performance Gains
 
OpenStack at NTT Resonant: Lessons Learned in Web Infrastructure
OpenStack at NTT Resonant: Lessons Learned in Web InfrastructureOpenStack at NTT Resonant: Lessons Learned in Web Infrastructure
OpenStack at NTT Resonant: Lessons Learned in Web Infrastructure
 
Using redux and angular 2 with meteor
Using redux and angular 2 with meteorUsing redux and angular 2 with meteor
Using redux and angular 2 with meteor
 
Using redux and angular 2 with meteor
Using redux and angular 2 with meteorUsing redux and angular 2 with meteor
Using redux and angular 2 with meteor
 
How to Configure the CA Workload Automation System Agent agentparm.txt File
How to Configure the CA Workload Automation System Agent agentparm.txt FileHow to Configure the CA Workload Automation System Agent agentparm.txt File
How to Configure the CA Workload Automation System Agent agentparm.txt File
 
Angular 2 Migration - JHipster Meetup 6
Angular 2 Migration - JHipster Meetup 6Angular 2 Migration - JHipster Meetup 6
Angular 2 Migration - JHipster Meetup 6
 
Apache Zeppelin on Kubernetes with Spark and Kafka - meetup @twitter
Apache Zeppelin on Kubernetes with Spark and Kafka - meetup @twitterApache Zeppelin on Kubernetes with Spark and Kafka - meetup @twitter
Apache Zeppelin on Kubernetes with Spark and Kafka - meetup @twitter
 
Iron.io Technical Overview
Iron.io Technical OverviewIron.io Technical Overview
Iron.io Technical Overview
 

Mais de StreamNative

Pulsar's Journey in Yahoo!: On-prem, Cloud and Hybrid - Pulsar Summit SF 2022
Pulsar's Journey in Yahoo!: On-prem, Cloud and Hybrid - Pulsar Summit SF 2022Pulsar's Journey in Yahoo!: On-prem, Cloud and Hybrid - Pulsar Summit SF 2022
Pulsar's Journey in Yahoo!: On-prem, Cloud and Hybrid - Pulsar Summit SF 2022
StreamNative
 

Mais de StreamNative (20)

Is Using KoP (Kafka-on-Pulsar) a Good Idea? - Pulsar Summit SF 2022
Is Using KoP (Kafka-on-Pulsar) a Good Idea? - Pulsar Summit SF 2022Is Using KoP (Kafka-on-Pulsar) a Good Idea? - Pulsar Summit SF 2022
Is Using KoP (Kafka-on-Pulsar) a Good Idea? - Pulsar Summit SF 2022
 
Building an Asynchronous Application Framework with Python and Pulsar - Pulsa...
Building an Asynchronous Application Framework with Python and Pulsar - Pulsa...Building an Asynchronous Application Framework with Python and Pulsar - Pulsa...
Building an Asynchronous Application Framework with Python and Pulsar - Pulsa...
 
Blue-green deploys with Pulsar & Envoy in an event-driven microservice ecosys...
Blue-green deploys with Pulsar & Envoy in an event-driven microservice ecosys...Blue-green deploys with Pulsar & Envoy in an event-driven microservice ecosys...
Blue-green deploys with Pulsar & Envoy in an event-driven microservice ecosys...
 
Distributed Database Design Decisions to Support High Performance Event Strea...
Distributed Database Design Decisions to Support High Performance Event Strea...Distributed Database Design Decisions to Support High Performance Event Strea...
Distributed Database Design Decisions to Support High Performance Event Strea...
 
Simplify Pulsar Functions Development with SQL - Pulsar Summit SF 2022
Simplify Pulsar Functions Development with SQL - Pulsar Summit SF 2022Simplify Pulsar Functions Development with SQL - Pulsar Summit SF 2022
Simplify Pulsar Functions Development with SQL - Pulsar Summit SF 2022
 
Towards a ZooKeeper-less Pulsar, etcd, etcd, etcd. - Pulsar Summit SF 2022
Towards a ZooKeeper-less Pulsar, etcd, etcd, etcd. - Pulsar Summit SF 2022Towards a ZooKeeper-less Pulsar, etcd, etcd, etcd. - Pulsar Summit SF 2022
Towards a ZooKeeper-less Pulsar, etcd, etcd, etcd. - Pulsar Summit SF 2022
 
Validating Apache Pulsar’s Behavior under Failure Conditions - Pulsar Summit ...
Validating Apache Pulsar’s Behavior under Failure Conditions - Pulsar Summit ...Validating Apache Pulsar’s Behavior under Failure Conditions - Pulsar Summit ...
Validating Apache Pulsar’s Behavior under Failure Conditions - Pulsar Summit ...
 
Cross the Streams! Creating Streaming Data Pipelines with Apache Flink + Apac...
Cross the Streams! Creating Streaming Data Pipelines with Apache Flink + Apac...Cross the Streams! Creating Streaming Data Pipelines with Apache Flink + Apac...
Cross the Streams! Creating Streaming Data Pipelines with Apache Flink + Apac...
 
Message Redelivery: An Unexpected Journey - Pulsar Summit SF 2022
Message Redelivery: An Unexpected Journey - Pulsar Summit SF 2022Message Redelivery: An Unexpected Journey - Pulsar Summit SF 2022
Message Redelivery: An Unexpected Journey - Pulsar Summit SF 2022
 
Unlocking the Power of Lakehouse Architectures with Apache Pulsar and Apache ...
Unlocking the Power of Lakehouse Architectures with Apache Pulsar and Apache ...Unlocking the Power of Lakehouse Architectures with Apache Pulsar and Apache ...
Unlocking the Power of Lakehouse Architectures with Apache Pulsar and Apache ...
 
Understanding Broker Load Balancing - Pulsar Summit SF 2022
Understanding Broker Load Balancing - Pulsar Summit SF 2022Understanding Broker Load Balancing - Pulsar Summit SF 2022
Understanding Broker Load Balancing - Pulsar Summit SF 2022
 
Building an Asynchronous Application Framework with Python and Pulsar - Pulsa...
Building an Asynchronous Application Framework with Python and Pulsar - Pulsa...Building an Asynchronous Application Framework with Python and Pulsar - Pulsa...
Building an Asynchronous Application Framework with Python and Pulsar - Pulsa...
 
Pulsar's Journey in Yahoo!: On-prem, Cloud and Hybrid - Pulsar Summit SF 2022
Pulsar's Journey in Yahoo!: On-prem, Cloud and Hybrid - Pulsar Summit SF 2022Pulsar's Journey in Yahoo!: On-prem, Cloud and Hybrid - Pulsar Summit SF 2022
Pulsar's Journey in Yahoo!: On-prem, Cloud and Hybrid - Pulsar Summit SF 2022
 
Event-Driven Applications Done Right - Pulsar Summit SF 2022
Event-Driven Applications Done Right - Pulsar Summit SF 2022Event-Driven Applications Done Right - Pulsar Summit SF 2022
Event-Driven Applications Done Right - Pulsar Summit SF 2022
 
Pulsar @ Scale. 200M RPM and 1K instances - Pulsar Summit SF 2022
Pulsar @ Scale. 200M RPM and 1K instances - Pulsar Summit SF 2022Pulsar @ Scale. 200M RPM and 1K instances - Pulsar Summit SF 2022
Pulsar @ Scale. 200M RPM and 1K instances - Pulsar Summit SF 2022
 
Data Democracy: Journey to User-Facing Analytics - Pulsar Summit SF 2022
Data Democracy: Journey to User-Facing Analytics - Pulsar Summit SF 2022Data Democracy: Journey to User-Facing Analytics - Pulsar Summit SF 2022
Data Democracy: Journey to User-Facing Analytics - Pulsar Summit SF 2022
 
Beam + Pulsar: Powerful Stream Processing at Scale - Pulsar Summit SF 2022
Beam + Pulsar: Powerful Stream Processing at Scale - Pulsar Summit SF 2022Beam + Pulsar: Powerful Stream Processing at Scale - Pulsar Summit SF 2022
Beam + Pulsar: Powerful Stream Processing at Scale - Pulsar Summit SF 2022
 
Welcome and Opening Remarks - Pulsar Summit SF 2022
Welcome and Opening Remarks - Pulsar Summit SF 2022Welcome and Opening Remarks - Pulsar Summit SF 2022
Welcome and Opening Remarks - Pulsar Summit SF 2022
 
Log System As Backbone – How We Built the World’s Most Advanced Vector Databa...
Log System As Backbone – How We Built the World’s Most Advanced Vector Databa...Log System As Backbone – How We Built the World’s Most Advanced Vector Databa...
Log System As Backbone – How We Built the World’s Most Advanced Vector Databa...
 
MoP(MQTT on Pulsar) - a Powerful Tool for Apache Pulsar in IoT - Pulsar Summi...
MoP(MQTT on Pulsar) - a Powerful Tool for Apache Pulsar in IoT - Pulsar Summi...MoP(MQTT on Pulsar) - a Powerful Tool for Apache Pulsar in IoT - Pulsar Summi...
MoP(MQTT on Pulsar) - a Powerful Tool for Apache Pulsar in IoT - Pulsar Summi...
 

Último

Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night StandCall Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
amitlee9823
 
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
CHEAP Call Girls in Rabindra Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Rabindra Nagar  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Rabindra Nagar  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Rabindra Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
amitlee9823
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
amitlee9823
 
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
only4webmaster01
 
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get CytotecAbortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Riyadh +966572737505 get cytotec
 
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
amitlee9823
 
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
amitlee9823
 
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night StandCall Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
amitlee9823
 
Probability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter LessonsProbability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter Lessons
JoseMangaJr1
 
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
amitlee9823
 

Último (20)

Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night StandCall Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
 
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
 
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
 
CHEAP Call Girls in Rabindra Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Rabindra Nagar  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Rabindra Nagar  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Rabindra Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
 
Anomaly detection and data imputation within time series
Anomaly detection and data imputation within time seriesAnomaly detection and data imputation within time series
Anomaly detection and data imputation within time series
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
 
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
 
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get CytotecAbortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get Cytotec
 
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
 
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
 
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night StandCall Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
 
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24  Building Real-Time Pipelines With FLaNKDATA SUMMIT 24  Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
 
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
 
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFx
 
Thane Call Girls 7091864438 Call Girls in Thane Escort service book now -
Thane Call Girls 7091864438 Call Girls in Thane Escort service book now -Thane Call Girls 7091864438 Call Girls in Thane Escort service book now -
Thane Call Girls 7091864438 Call Girls in Thane Escort service book now -
 
Probability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter LessonsProbability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter Lessons
 
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
 

Pulsar Functions Deep Dive_Sanjeev kulkarni

  • 1. © 2020 SPLUNK INC. Pulsar Functions A Deep Dive | Pulsar Summit 2020 Sanjeev Kulkarni sanjeevk@splunk.com
  • 2. © 2020 SPLUNK INC. Pulsar Functions:- A Deep Dive Brief introduction to Pulsar Functions Deep Dive into internals • Submission workflow • Scheduling workflow • Execution workflow • Java Instance concepts Current/Future Work Agenda
  • 3. © 2020 SPLUNK INC. Pulsar Functions:- A Deep Dive Brief introduction to Pulsar Functions Deep Dive into internals • Submission workflow • Scheduling workflow • Execution workflow • Java Instance concepts Current/Future Work Agenda
  • 4. © 2020 SPLUNK INC. Pulsar Functions:- A Brief Introduction Bringing Serverless concepts to the streaming world. Execute processing logic per message on input topic Function output goes to an output topic • Optional Abstract View Core Concept
  • 5. © 2020 SPLUNK INC. Pulsar Functions:- A Brief Introduction Emphasis on simplicity Great for 90% use-cases on streams • Filtering • Routing • Enrichment Not meant to replace Spark/Flink SDK-less API import java.util.function.Function; public class ExclamationFunction implements Function<String, String> { @Override public String apply(String input) { return input + "!"; } } Simple API
  • 6. © 2020 SPLUNK INC. Pulsar Functions:- A Brief Introduction Flexible execution environments • Pulsar managed – Thread – Process • Externally managed – Kubernetes CRUD based Rest API Function lifecycle
  • 7. © 2020 SPLUNK INC. Pulsar Functions:- A Deep Dive Brief introduction to Pulsar Functions Deep Dive into internals • Submission workflow • Scheduling workflow • Execution workflow • Java Instance concepts Current/Future Work Agenda
  • 8. © 2020 SPLUNK INC. Pulsar Functions:- Submission Workflow Submit to any worker Json repr of FunctionConfig • tenant/namespace/name • Input/Output • configs • lot more knobs …. Function Code • jars/.py/zip/etc FunctionConfig public class FunctionConfig { private String tenant; private String namespace; private String name; private String className; private Collection<String> inputs; private String output; private ProcessingGuarantees processingGuarantees; private Map<String, Object> userConfig; private Map<String, Object> secrets; private Integer parallelism; private Resources resources; ... } Function Representation
  • 9. © 2020 SPLUNK INC. Pulsar Functions:- Submission Workflow AuthN/AuthZ checks FunctionConfig validation • missing parameters • Incorrect parameters • Local Configs Function Code Validation • class presence, etc Copy Code to Bookeeper FunctionMetaData message FunctionMetaData { FunctionDetails functionDetails; PackageLocationMetaData packageLocation; uint64 version; uint64 createTime; map<int32, FunctionState> instanceStates; FunctionAuthenticationSpec functionAuthSpec; } Submission Checks
  • 10. © 2020 SPLUNK INC. Pulsar Functions:- Submission Workflow System of record Stores all Functions • map from <FQFN, FunctionMetaData> FQFN:- Fully Qualified Function Name Backed by Pulsar Topic • Function MetaData Topic Contains a MetaData Topic Tailer Function MetaData Manager Function MetaData Manager MetaData Topic Tailer MetaData Topic foo -> {functionDetails : {...}, version: 2, …}
  • 11. © 2020 SPLUNK INC. Pulsar Functions:- Submission Workflow Just before Function creation/update/delete Function MetaData Manager:- Update State Machine MetaData Topic Tailer MetaData Topic foo -> {functionDetails : {...}, version: 2, …}
  • 12. © 2020 SPLUNK INC. Pulsar Functions:- Submission Workflow Make a copy of the current state Function MetaData Manager:- Update State Machine MetaData Topic Tailer MetaData Topic foo -> {functionDetails : {...}, version: 2, …} foo -> {functionDetails : {...}, version: 2, …}
  • 13. © 2020 SPLUNK INC. Pulsar Functions:- Submission Workflow Make a copy of the current state Merge the updates Function MetaData Manager:- Update State Machine MetaData Topic Tailer MetaData Topic foo -> {functionDetails : {...}, version: 2, …} foo -> {functionDetails : {......}, version: 2, …}
  • 14. © 2020 SPLUNK INC. Pulsar Functions:- Submission Workflow Make a copy of the current state Merge the updates Increment the version Function MetaData Manager:- Update State Machine MetaData Topic Tailer MetaData Topic foo -> {functionDetails : {...}, version: 2, …} foo -> {functionDetails : {......}, version: 3, …}
  • 15. © 2020 SPLUNK INC. Pulsar Functions:- Submission Workflow Make a copy of the current state Merge the updates Increment the version Write to MetaData Topic Function MetaData Manager:- Update State Machine MetaData Topic Tailer MetaData Topic foo -> {functionDetails : {...}, version: 2, …}
  • 16. © 2020 SPLUNK INC. Pulsar Functions:- Submission Workflow Make a copy of the current state Merge the updates Increment the version Write to MetaData Topic Tailer reads and verifies Function MetaData Manager:- Update State Machine MetaData Topic Tailer MetaData Topic foo -> {functionDetails : {...}, version: 2, …}
  • 17. © 2020 SPLUNK INC. Pulsar Functions:- Submission Workflow Make a copy of the current state Merge the updates Increment the version Write to MetaData Topic Tailer reads and verifies Upon no conflict, tailer updates Function MetaData Manager:- Update State Machine MetaData Topic Tailer MetaData Topic foo -> {functionDetails : {.....}, version: 3, …}
  • 18. © 2020 SPLUNK INC. Pulsar Functions:- Submission Workflow Multiple Workers Function MetaData Manager:- When do conflicts occur? MetaData Topic Tailer MetaData Topic foo -> {functionDetails : {...}, version: 2, …} Worker 1 MetaData Topic Tailer foo -> {functionDetails : {...}, version: 2, …} Worker 2
  • 19. © 2020 SPLUNK INC. Pulsar Functions:- Submission Workflow Multiple Workers Concurrent updates to same function Function MetaData Manager:- When do conflicts occur? MetaData Topic Tailer MetaData Topic foo -> {functionDetails : {...}, version: 2, …} Worker 1 MetaData Topic Tailer foo -> {functionDetails : {...}, version: 2, …} Worker 2
  • 20. © 2020 SPLUNK INC. Pulsar Functions:- Submission Workflow Multiple Workers Concurrent updates to same function First Writer Wins Function MetaData Manager:- When do conflicts occur? MetaData Topic Tailer MetaData Topic foo -> {functionDetails : {...}, version: 3, …} Worker 1 MetaData Topic Tailer foo -> {functionDetails : {...}, version: 3, …} Worker 2
  • 21. © 2020 SPLUNK INC. Pulsar Functions:- Submission Workflow Multiple Workers Concurrent updates to same function First Writer Wins Others are rejected Function MetaData Manager:- When do conflicts occur? MetaData Topic Tailer MetaData Topic foo -> {functionDetails : {...}, version: 3, …} Worker 1 MetaData Topic Tailer foo -> {functionDetails : {...}, version: 3, …} Worker 2
  • 22. © 2020 SPLUNK INC. Pulsar Functions:- Submission Workflow Submit to any worker Validation load scales linearly Deterministic State Machine MetaData Topic is audit log Advantages MetaData Topic Tailer MetaData Topic foo -> {functionDetails : {...}, version: 3, …} Worker 1 MetaData Topic Tailer foo -> {functionDetails : {...}, version: 3, …} Worker 2
  • 23. © 2020 SPLUNK INC. Pulsar Functions:- Submission Workflow MetaData topic topic growth MetaData Topic compaction non-trivial Worker Start time All Workers know everything Pitfalls MetaData Topic Tailer MetaData Topic foo -> {functionDetails : {...}, version: 3, …} Worker 1 MetaData Topic Tailer foo -> {functionDetails : {...}, version: 3, …} Worker 2
  • 24. © 2020 SPLUNK INC. Pulsar Functions:- A Deep Dive Brief introduction to Pulsar Functions Deep Dive into internals • Submission workflow • Scheduling workflow • Execution workflow • Java Instance concepts Current/Future Work Agenda
  • 25. © 2020 SPLUNK INC. Pulsar Functions:- Scheduling Workflow Abstracts out Scheduler Executed only on a Leader Invoked when • Function CRUD operations – create/update – delete • Worker Changes – Unresponsive/dead workers – New workers – Periodic – Leadership changes IScheduler Interface public interface IScheduler { List<Assignment> schedule(<List<Instance> unassigned, List<Instance> current, Set<String> workers); } Pluggable Scheduler
  • 26. © 2020 SPLUNK INC. Pulsar Functions:- Scheduling Workflow Empty Coordination Topic Failover Subscription Active Consumer is the Leader Leader Election Leader Election Coordination Topic Worker 1Worker 2Worker 3
  • 27. © 2020 SPLUNK INC. Pulsar Functions:- Scheduling Workflow Assignment Topic Written by the Leader Compacted based on key(FQFN + Instance Id) All workers know about all assignments Function Assignments Assignment Topic Worker 1Worker 2Worker 3 {foo, 1} : worker-1, ... {foo, 1} : worker-1, ... {foo, 1} : worker-1, ... Assignment Tailer Assignment Tailer Assignment Tailer
  • 28. © 2020 SPLUNK INC. Pulsar Functions:- Scheduling Workflow Stores Assignment Compacted Key -> (FQFN + InstanceId) Assignment message Instance { FunctionMetaData functionMetaData = 1; int32 instanceId = 2; } message Assignment { Instance instance = 1; string workerId = 2; } Assignment Topic
  • 29. © 2020 SPLUNK INC. Pulsar Functions:- A Deep Dive Brief introduction to Pulsar Functions Deep Dive into internals • Submission workflow • Scheduling workflow • Execution workflow • Java Instance concepts Current/Future Work Agenda
  • 30. © 2020 SPLUNK INC. Pulsar Functions:- Execution Workflow Triggered by Changes to Assignment Table Takes care of the worker’s specific assignments Function lifecycle management via Spawner Function RunTime Manager Assignment Topic Worker {foo, 1} : worker-1, ... Assignment Tailer RunTime Manager Spawner Spawner
  • 31. © 2020 SPLUNK INC. Pulsar Functions:- Execution Workflow Abstracts out execution environments using Runtime Factory Manages Function lifecycle Maintains grpc connection with Function instance Spawner GRPC Channel Spawner Function
  • 32. © 2020 SPLUNK INC. Pulsar Functions:- Execution Workflow Short-circuit MetaData Manager and Runtime Manager Directly use Spawner Local Runner GRPC Channel Spawner Function Local Runner
  • 33. © 2020 SPLUNK INC. Pulsar Functions:- Execution Workflow Simple interface for creating execution environments Creates Runtimes Runtime Factory public interface RuntimeFactory { void initialize(WorkerConfig workerConfig); Runtime createContainer(InstanceConfig instanceConfig, String codeFile); void close(); } Runtime Factory
  • 34. © 2020 SPLUNK INC. Pulsar Functions:- A Deep Dive Brief introduction to Pulsar Functions Deep Dive into internals • Submission workflow • Scheduling workflow • Execution workflow • Java Instance concepts Current/Future Work Agenda
  • 35. © 2020 SPLUNK INC. Pulsar Functions:- Java Instance Java Instance is (source, function, sink) ensemble. Source abstracts reading from input topics Sink abstracts writing to output topic Java Instance Source -> Process -> Sink Source Sink f
  • 36. © 2020 SPLUNK INC. Pulsar Functions:- Java Instance Pulsar Source implements the Source interface to read from Pulsar topics Pulsar Sink implements Sink interface to write to Pulsar topic Java Instance Regular Pulsar Functions Pulsar Source Pulsar Sink f
  • 37. © 2020 SPLUNK INC. Pulsar Functions:- Java Instance Java Instance What if we have non-Pulsar Source? Non Pulsar Source Pulsar Sink f
  • 38. © 2020 SPLUNK INC. Pulsar Functions:- Java Instance Java Instance Pulsar IO Non Pulsar Source Pulsar Sink f
  • 39. © 2020 SPLUNK INC. Pulsar Functions:- Java Instance Non Pulsar Source reads from external system Identity Function lets the data pass thru Pulsar Sink writes to Pulsar Java Instance Pulsar IO Source Non Pulsar Source SinkIdentity
  • 40. © 2020 SPLUNK INC. Pulsar Functions:- Java Instance Pulsar Source reads from Pulsar topics Identity Function lets the data pass thru Non Pulsar Sink writes to an external system Java Instance Pulsar IO Sink Pulsar Source Non Pulsar Sink Identity
  • 41. © 2020 SPLUNK INC. Pulsar Functions:- A Deep Dive Brief introduction to Pulsar Functions Deep Dive into internals • Submission workflow • Scheduling workflow • Execution workflow • Java Instance concepts Current/Future Work Agenda
  • 42. © 2020 SPLUNK INC. Pulsar Functions:- Future Work Each setup only supports a static Runtime(Process/Thread/Pods) Change it to be dynamically specified during submission Function RunTime Manager Changes Dynamic Runtime Selection Assignment Topic Worker {foo, 1} : worker-1, ... Assignment Tailer RunTime Manager Spawner Function-1 Spawner Function-2 Thread Process
  • 43. © 2020 SPLUNK INC. Pulsar Functions:- Future Work MetaData Topic not compacted Stores all function change requests Worker needs to read from beginning upon startup Function MetaData Topic Compaction MetaData Topic Tailer MetaData Topic foo -> {functionDetails : {...}, version: 2, …}
  • 44. © 2020 SPLUNK INC. Pulsar Functions:- Future Work Chaining Functions Output of one going as input of others A simple workflow API Function Mesh f1 f2 f3 f4
  • 45. © 2020 SPLUNK INC. Pulsar Functions:- Future Work Discover/Collect Cycle Repeating Cycle Don’t drop discovered tasks on failures BatchSource public interface BatchSource<T> { void open(final Map<String, Object> config, SourceContext context); void discover(Consumer<byte[]> taskEater); void prepare(byte[] task); Record<T> readNext(); } Batch Sources
  • 46. Thank You © 2020 SPLUNK INC.