This file contains 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 aws_cdk import ( | |
aws_ec2 as ec2, | |
aws_ecs as ecs, | |
aws_iam as iam, | |
aws_logs as logs, | |
aws_elasticloadbalancingv2 as elbv2, | |
core, | |
) | |
This file contains 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
apiVersion: druid.apache.org/v1alpha1 | |
kind: Druid | |
metadata: | |
name: cluster | |
spec: | |
commonConfigMountPath: /opt/druid/conf/druid/cluster/_common | |
rollingDeploy: true | |
image: "apache/druid:0.19.0" | |
startScript: /druid.sh | |
log4j.config: |- |
This file contains 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 boto3 | |
s3 = boto3.resource('s3') | |
def download(bucket_name, key, filePath): | |
try: | |
s3.meta.client.download_file(bucket_name, key, filePath) | |
except ValueError as err: | |
print('Error:', err) |
This file contains 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
package wrappers | |
import play.api._ | |
import play.api.mvc._ | |
import scala.concurrent._ | |
import scala.concurrent.Future | |
import play.mvc.Http.Status | |
import ExecutionContext.Implicits.global | |
import play.libs.Akka | |
import akka.actor.{Actor, Props} |
This file contains 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 java.io._ | |
import com.amazonaws.ClientConfiguration | |
import com.amazonaws.auth.DefaultAWSCredentialsProviderChain | |
import com.amazonaws.services.s3.AmazonS3Client | |
import com.amazonaws.services.s3.model._ | |
object S3Api { | |
private val config = new ClientConfiguration() //in milliseconds |
This file contains 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
# confluent kafka(.8.2) producer | |
import json | |
from confluent_kafka import Producer | |
class KafkaProducer: | |
def __init__(self, hosts): | |
self.hosts = hosts | |
self.producer = Producer( |
This file contains 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
# confluent Kafka(.8.2) consumer | |
from confluent_kafka import Consumer | |
from confluent_kafka import TopicPartition | |
class KafkaConsumer: | |
def __init__(self,topic, hosts, partitions): |
This file contains 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 akka.event.LoggingAdapter | |
import akka.http.scaladsl.Http | |
import akka.http.scaladsl.model.HttpRequest | |
import akka.http.scaladsl.server.Directives._ | |
import akka.http.scaladsl.server.Route | |
import akka.http.scaladsl.server.RouteResult.{Complete, Rejected} | |
import akka.http.scaladsl.server.directives.{DebuggingDirectives, LoggingMagnet} | |
import akka.stream.ActorMaterializer |
This file contains 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 java.util.concurrent.{Executors, ForkJoinPool} | |
import scala.concurrent.ExecutionContext | |
//For IO intensive applications | |
object MyExecutionContext { | |
private val concurrency = Runtime.getRuntime.availableProcessors() | |
implicit val commonThreadPool: ExecutionContext = ExecutionContext.fromExecutor(Executors.newCachedThreadPool()) |
This file contains 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 org.apache.http.annotation.NotThreadSafe | |
import org.apache.poi.ss.usermodel._ | |
import scala.collection.JavaConversions._ | |
import scala.util.control.NonFatal | |
object IXLS2CSV { | |
private val df = new DataFormatter(true) |
NewerOlder