Skip to content

Instantly share code, notes, and snippets.

View shameekagarwal's full-sized avatar
😴
sleeping

Shameek Agarwal shameekagarwal

😴
sleeping
View GitHub Profile
@shameekagarwal
shameekagarwal / JVMThreadCommunication.scala
Created September 26, 2023 12:05
Producer Consumer Scala
object JVMThreadCommunication {
def main(args: Array[String]): Unit = {
ProdConsV3.start(2, 2, 5)
}
}
object ProdConsV3 {
case class Producer(id: Int, buffer: mutable.Queue[Int], capacity: Int) extends Thread {
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<hadoop.version>3.3.5</hadoop.version>
<maven-shade-plugin.version>3.5.0</maven-shade-plugin.version>
</properties>
<dependencies>
<dependency>
@shameekagarwal
shameekagarwal / pom.xml
Last active August 12, 2023 05:20
Spark Setup
<!-- ... -->
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<scala.version>2.13</scala.version>
<spark.version>3.4.1</spark.version>
<hadoop-core.version>1.2.1</hadoop-core.version>
<hadoop-hdfs.version>3.3.6</hadoop-hdfs.version>
@Component
public class AddressUpdateCsvRowToPojo {
public Customer process(List<String> addressUpdate) {
Customer customer = new Customer();
customer.setId(Integer.parseInt(addressUpdate.get(0)));
customer.setAddressLine1(addressUpdate.get(1));
customer.setAddressLine2(addressUpdate.get(2));
@shameekagarwal
shameekagarwal / db-policy.yaml
Last active July 20, 2022 02:14
Network Policy
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: db
spec:
podSelector:
matchLabels:
@shameekagarwal
shameekagarwal / persistent-volume-claim-for-dynamic-persistent-volume.yml
Last active July 3, 2022 06:56
Persistent Volume Claim for Dynamic Persistent Volume
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: jenkins-storage
spec:
accessModes:
- ReadWriteOnce
@shameekagarwal
shameekagarwal / persistent-volume-claim-for-static-persistent-volume.yml
Last active July 3, 2022 06:23
Persistent Volume Claim for Static Persistent Volume
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: jenkins-storage
spec:
storageClassName: ebs
apiVersion: v2
kind: PersistentVolume
metadata:
name: ebs
labels:
name: ebs
spec:
apiVersion: v1
kind: ResourceQuota
metadata:
name: dev
namespace: dev
spec:
hard:
apiVersion: v1
kind: LimitRange
spec:
limits:
- type: Container
default:
cpu: "0.5"
memory: 80Mi