Skip to content

Instantly share code, notes, and snippets.

View vicety's full-sized avatar
🎯
Focusing

Chengyang Huang vicety

🎯
Focusing
  • Stockholm, Sweden
View GitHub Profile
@vicety
vicety / xx.txt
Last active March 28, 2020 04:09
xx
7B76313B70726F3BE5BDAC20E585B33B313B73796E313333323040676D61696C2E636F6D3B3B3B7D
import co.elastic.clients.elasticsearch.ElasticsearchClient;
import co.elastic.clients.elasticsearch._types.Result;
import co.elastic.clients.elasticsearch.core.*;
import co.elastic.clients.elasticsearch.core.search.Hit;
import co.elastic.clients.elasticsearch.indices.GetIndexRequest;
import co.elastic.clients.elasticsearch.indices.GetIndexResponse;
import co.elastic.clients.json.jackson.JacksonJsonpMapper;
import co.elastic.clients.transport.ElasticsearchTransport;
import co.elastic.clients.transport.rest_client.RestClientTransport;
import org.apache.http.HttpHost;
@vicety
vicety / 📊 Weekly development breakdown
Last active March 30, 2023 00:39
Weekly Development Statistics
Markdown 3 hrs 18 mins ██████████████▎░░░░░░ 68.0%
Python 1 hr 14 mins █████▍░░░░░░░░░░░░░░░ 25.7%
YAML 11 mins ▊░░░░░░░░░░░░░░░░░░░░ 3.8%
Other 7 mins ▌░░░░░░░░░░░░░░░░░░░░ 2.4%
JSON 0 secs ░░░░░░░░░░░░░░░░░░░░░ 0.1%
package io.github.vicety;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Flow;
import java.util.concurrent.SubmissionPublisher;
import java.util.function.Function;
public class Main {
package pods.workflows.examples
/** Multiple Producer Multiple Subscriber Event Count
*
* This example counts the event number from multiple upstream producers, which
* concurrently emit events to multiple downstream subscribers. This example
* can also be used as a test to show event handling for each processor is
* serial in our runtime.
*/
@main def MultiProducerExample() =
  1. I think we can get rid of filling the path field when declaring application and workflow, since we have a hierarchy of Application -> Workflow -> Tasks, Application -> Generators, the path can just be concatenated from names, e.g. {app.name}/{wf.name}/{task.name}, we can fill this field automatically when calling system.launch(app). With same reason, I think we don't need to fill the name field when creating AtomicStream, since it can be infered by path.split('/')[-1]
  2. What is the Application.streams used for? To me, this field stores duplicated information stored at Application.workflows[i].consumes and Application.workflows[i].stream
  3. Tell me if my understanding is correct, in ApplicationTest we have only one source (with no AtomicStream passed to it) and one generator, I can implicitly bind them when system.launch. If we have multiple sources, workflow.consumes will be like AtomicStreamRef[(T1, T2)], and a splitter will exist to tranform it to AtomicStreamRef[T1] and `AtomicS
import requests
import os
import json
import socket
import sys
# To set your enviornment variables in your terminal run the following line:
# export 'BEARER_TOKEN'='<your_bearer_token>'
bearer_token = os.environ.get("BEARER_TOKEN")
package portals.examples
import java.util.concurrent.LinkedBlockingQueue
import scala.annotation.experimental
import portals.api.builder.ApplicationBuilder
import portals.api.builder.TaskBuilder
import portals.application.task.PerKeyState
import portals.application.task.PerTaskState
import example.udf.UDF;
import org.apache.calcite.DataContext;
import org.apache.calcite.adapter.enumerable.EnumerableConvention;
import org.apache.calcite.adapter.enumerable.EnumerableInterpretable;
import org.apache.calcite.adapter.enumerable.EnumerableRel;
import org.apache.calcite.adapter.enumerable.EnumerableRules;
import org.apache.calcite.adapter.java.JavaTypeFactory;
import org.apache.calcite.config.CalciteConnectionConfig;
import org.apache.calcite.config.CalciteConnectionConfigImpl;