Skip to content

Instantly share code, notes, and snippets.

View azagniotov's full-sized avatar
🎯
Ranking ..

Alexander Zagniotov azagniotov

🎯
Ranking ..
View GitHub Profile
@azagniotov
azagniotov / SparkConfig.scala
Last active May 5, 2025 21:56
This Spark / PySpark on YARN configuration is optimized for large-scale workloads with high executor memory (64g), efficient Kryo serialization, and aggressive adaptive query execution to handle skewed data and optimize partitioning, while also tuning shuffle and network settings for stability under load.
/**
* The configuration parameters outlined below are specifically optimized for execution across
* four (4) distributed workers, each provisioned with the n2d-highmem-48 machine type—offering
* 48 virtual CPUs and 384 GB of RAM per node. These settings have been carefully fine-tuned to
* support Spark workloads that process data on a monthly cadence, where each job ingests and
* computes over an entire month's worth of data in a single run on DataProc.
*
* The cluster total resources:
* - 4 workers * 48 vCPUs/worker = 192 total vCPUs
* - 4 workers * 384 GB RAM/worker = 1,536 GB total RAM
@azagniotov
azagniotov / JettySolrRunnerExampleTest.java
Created December 8, 2024 16:44
Solr unit test example shows how to index documents using JettySolrRunner and SolrTestCaseJ4
/*
* Copyright (c) 2023-2024 Alexander Zagniotov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
/*
alexPrintPrep($("textarea#phrase").val(), null, 210);
alexPrintPrep(address, privkey, 100);
<div id="printable-view-for-alex" class="alex-qr-container"></div>
@media print
{
{
"reservation" : "p5e20A9hSi2IsV0soVpafQ==",
"name" : "Leanne Graham",
"phone" : "1-770-736-8031 x56442",
"basePrice" : "USD10.00",
"taxes" : "EUR19.62"
}
@azagniotov
azagniotov / include-reservation-service-stubs.yaml
Created May 2, 2021 23:51
include-reservation-service-stubs.yaml
- request:
method: GET
url: /api/v1/reservations/1
# When sequenced responses is configured, on each incoming request to the same URI,
# a subsequent response in the list will be sent to the client. The sequenced
# responses play in a cycle (loop). In other words: after the response sequence plays
# through, the cycle restarts on the next incoming request
#
# https://github.com/azagniotov/stubby4j#response-object-properties
@azagniotov
azagniotov / include-account-service-stubs.yaml
Created May 2, 2021 23:48
include-account-service-stubs.yaml
- request:
method: GET
url: /api/v1/accounts/1
response:
status: 200
headers:
content-type: application/json
file: json/account.service.expected.success.response.json
@azagniotov
azagniotov / stubs.yaml
Created May 2, 2021 23:38
stubby4j config
includes:
- include-account-service-stubs.yaml
- include-reservation-service-stubs.yaml
@azagniotov
azagniotov / docker-compose.yaml
Created May 2, 2021 23:32
Using stubby4j in docker-compose.yaml
# This section builds flight-booking application image to the stack
version: '3.8'
services:
flight-booking-service:
build: .
container_name: flight-booking-service
ports:
- 8080:8080
environment:
Use-case # Account service Reservation service
1 200 OK 200 OK
2 200 OK 400 Bad Request
3 200 OK 403 Forbidden
4 200 OK 500 Internal Server Error
5 200 OK 200 OK (after 1500 millis to cause a read timeout) *
@azagniotov
azagniotov / beautiful.rest.api.docs.in.markdown.md
Last active June 23, 2025 17:35
Example to create beautiful REST API docs in Markdown, inspired by Swagger API docs.