This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getRedshiftDBData(spark, bmReturns).withColumn("benchmark_vs_fund_returns", | |
from_json(col("benchmark_vs_fund_returns"), MapType(StringType, | |
ArrayType(DoubleType)))).coalesce(1) | |
.write | |
.option("es.nodes.wan.only", "true") | |
.option("es.mapping.id", "id") | |
.format("org.elasticsearch.spark.sql") | |
.option("es.write.operation", "upsert") | |
.mode(SaveMode.Append) | |
.save("fund-details") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
admin: | |
access_log_path: /tmp/admin_access.log | |
address: | |
socket_address: | |
protocol: TCP | |
address: 0.0.0.0 | |
port_value: 1936 | |
static_resources: | |
listeners: | |
- name: listener_0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM envoyproxy/envoy:v1.17.0 | |
COPY ./envoy.yaml /etc/envoy/envoy.yaml | |
RUN chmod go+r /etc/envoy/envoy.yaml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
admin: | |
access_log_path: /tmp/admin_access.log | |
address: | |
socket_address: | |
protocol: TCP | |
address: 0.0.0.0 | |
port_value: 1936 | |
static_resources: | |
listeners: | |
- name: listener_0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public String acquire(String entityId) { | |
String lock = UUID(); | |
for (int i = 0; i < attempts; i++) { | |
if ("OK".equals(poolManager.withRedis(j -> j.set(entityId, lock, "NX", "EX", timeToLive)))) { | |
//lock obtained if key entityId does not already exist with an expiry of timeToLive | |
return entityId; | |
} | |
// error obtaining lock | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import static spark.Spark.get; | |
import static spark.Spark.port; | |
public class App { | |
public static void main(String[] args) { | |
port(8080); | |
get("/ping", (req, res) -> "{\"message\":\"Pong\"}", Object::toString); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
admin: | |
access_log_path: /tmp/admin_access.log | |
address: | |
socket_address: { address: 0.0.0.0, port_value: 9901 } | |
static_resources: | |
listeners: | |
- name: listener_0 | |
address: | |
socket_address: { address: 0.0.0.0, port_value: 80 } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
consul: | |
image: 'consul' | |
ports: | |
- "8500:8500" | |
app: | |
environment: | |
- host=consul | |
build: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM openjdk:8-alpine | |
COPY pingPong-all.jar /usr/src/ | |
WORKDIR /usr/src/ | |
CMD ["java", "-jar", "pingPong-all.jar"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plugins { | |
id 'java' | |
id 'application' | |
id "com.github.johnrengelman.shadow" version "5.2.0" // For creating jars | |
} | |
mainClassName = 'App' | |
dependencies { | |
compile 'com.orbitz.consul:consul-client:1.4.0' // Java client for consul http api |
NewerOlder