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
| create or replace function add_table_to_polaris(p_namespace_name text, p_table_name text, p_metadata_location text) | |
| returns void | |
| language plpgsql | |
| as $function$ | |
| declare | |
| v_catalog_id bigint; | |
| v_namespace_id bigint; | |
| v_table_id bigint; | |
| v_now bigint := (extract(epoch FROM clock_timestamp()) * 1000)::bigint; | |
| v_location text; |
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
| Producer | |
| Setup | |
| bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test-rep-one --partitions 6 --replication-factor 1 | |
| bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test --partitions 6 --replication-factor 3 | |
| Single thread, no replication | |
| bin/kafka-run-class.sh org.apache.kafka.clients.tools.ProducerPerformance test7 50000000 100 -1 acks=1 bootstrap.servers=esv4-hcl198.grid.linkedin.com:9092 buffer.memory=67108864 batch.size=8196 |
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
| #!/bin/bash | |
| # Check if required commands are installed | |
| for cmd in jq yq gh; do | |
| if ! command -v $cmd &> /dev/null; then | |
| echo "Error: $cmd is not installed. Please install $cmd to run this script." | |
| exit 1 | |
| fi | |
| done |
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
| /* | |
| To the extent possible under law, Konstantin Olkhovskiy has waived | |
| all copyright and related or neighboring rights to this snippet. | |
| CC0 license: http://creativecommons.org/publicdomain/zero/1.0/ | |
| */ | |
| package main | |
| import ( | |
| "crypto/x509" |
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
| #!/bin/bash | |
| # Builds protoc executable into target/<OS>/<ARCH>/protoc.exe; optionally builds | |
| # protoc plugins into target/<OS>/<ARCH>/protoc-gen-*.exe | |
| # | |
| # Usage: ./build-protoc.sh <OS> <ARCH> <TARGET> | |
| # | |
| # <TARGET> can be "protoc" or "protoc-gen-javalite". Supported <OS> <ARCH> | |
| # combinations: | |
| # HOST <OS> <ARCH> <COMMENT> |
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
| # https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html | |
| METADATA_TOKEN="$(curl -s -X PUT 'http://169.254.169.254/latest/api/token' -H 'X-aws-ec2-metadata-token-ttl-seconds: 21600')" | |
| AVAILABILITY_ZONE="$(curl -s -H "X-aws-ec2-metadata-token: $METADATA_TOKEN" http://169.254.169.254/latest/meta-data/placement/availability-zone)" | |
| export AWS_REGION="$(echo "$AVAILABILITY_ZONE" | rev | cut -c 2- | rev)" | |
| export AWS_DEFAULT_REGION="$AWS_REGION" | |
| export INSTANCE_ID="$(curl -s -H "X-aws-ec2-metadata-token: $METADATA_TOKEN" http://169.254.169.254/latest/meta-data/instance-id)" | |
| # Instance identity documents is another very useful interface with many key value pairs in json format | |
| # https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-identity-documents.html |
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
| # Allows copying of job files to local after execution. Example copy command: | |
| # | |
| # kubectl apply -f ./export-file-job.yaml | |
| # POD=$(kubectl get pod --selector=job-name=export-files -o jsonpath='{.items[0].metadata.name}') | |
| # kubectl wait pod/$POD --for=condition=ready | |
| # until kubectl logs $POD | grep 'Ready for download'; do sleep 2; done | |
| # kubectl cp $POD:files.zip ./job-files-$(date +"%Y%m%d%H%M").zip | |
| # | |
| # Another option would be for the `export-files` container to be a webserver to | |
| # serve of the artifact files to be downloaded with `kubectl port-forward ...`. |
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
| package com.guilherme.miguel; | |
| import io.vavr.control.Try; | |
| import lombok.extern.slf4j.Slf4j; | |
| import org.springframework.boot.CommandLineRunner; | |
| import org.springframework.boot.SpringApplication; | |
| import org.springframework.boot.autoconfigure.SpringBootApplication; | |
| import org.springframework.context.annotation.Bean; | |
| import org.springframework.core.task.AsyncTaskExecutor; | |
| import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; |
NewerOlder