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 | |
set -euo pipefail | |
# Init script to send host-level metrics from Databricks clusters to Prometheus/Grafana using Alloy agent. | |
# | |
# 1. Add the init script to your cluster(s). | |
# 2. Add required environment variables in your cluster configuration, e.g.: | |
# PROMETHEUS_HOST=10.0.0.1:9090 | |
# DB_CLUSTER_ID=cluster-or-job-name | |
# 3. Add more labels if needed (job name, etc) |
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
class Matrix<T>(val width: Int, val height: Int, init: () -> T) : Iterable<T> { | |
private val data = List(width) { MutableList(height) { init() } } | |
fun dimension() = width * height | |
fun get(x: Int, y: Int): T = data[x][y] | |
fun set(value: T, x: Int, y: Int) { | |
data[x][y] = value | |
} | |
override fun iterator(): Iterator<T> { |
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 class PostgreSQLIndexedSearchFunction implements SQLFunction { | |
@Override | |
public boolean hasArguments() { | |
return true; | |
} | |
@Override | |
public boolean hasParenthesesIfNoArguments() { | |
return true; | |
} |