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 openjdk:8-alpine | |
RUN apk --update add wget tar bash python | |
RUN wget http://apache.mirror.anlx.net/spark/spark-2.4.2/spark-2.4.2-bin-hadoop2.7.tgz | |
RUN tar -xzf spark-2.4.2-bin-hadoop2.7.tgz && mv spark-2.4.2-bin-hadoop2.7 spark && rm spark-2.4.2-bin-hadoop2.7.tgz | |
RUN printf "#!/bin/sh\n/spark/bin/spark-class org.apache.spark.deploy.master.Master --host \$SPARK_MASTER_HOST --port \$SPARK_MASTER_PORT --webui-port \$SPARK_MASTER_WEBUI_PORT" > /start-master.sh | |
RUN chmod +x /start-master.sh | |
RUN printf "#!/bin/sh\n/spark/bin/spark-class org.apache.spark.deploy.worker.Worker --webui-port \$SPARK_WORKER_WEBUI_PORT \$SPARK_MASTER_URL" > /start-worker.sh | |
RUN chmod +x /start-worker.sh | |
COPY cloudera-10k.txt /cloudera-10k.txt | |
COPY employee.txt /spark/examples/src/main/scala/org/apache/spark/examples/sql/employee.txt |
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
# Constant Values | |
DEFAULT_SHIFT = 1 | |
MAX_ALPHABET_COUNT = 26 | |
UPPERCASE_A_ASCII_CODE = 65 | |
LOWERCASE_A_ASCII_CODE = 97 | |
def encode(plaintext, shift=DEFAULT_SHIFT): | |
if not plaintext.isalpha(): | |
raise ValueError("Invalid 'plaintext' argument value %s; it is not all alpha." % plaintext) |
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 main | |
import ( | |
"encoding/json" | |
"fmt" | |
"io/ioutil" | |
"os" | |
"sort" | |
"strings" | |
) |
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 main | |
import ( | |
"fmt" | |
"sort" | |
"testing" | |
) | |
func TestNumberOfParticipants(t *testing.T) { | |
// Initialize our Participants array |
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
{ | |
"participants":[ | |
{ | |
"name": "Sam", | |
"speed": 5 | |
}, | |
{ | |
"name": "Mouna", | |
"speed": 1 | |
}, |
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 main | |
import ( | |
"encoding/json" | |
"fmt" | |
"io/ioutil" | |
"os" | |
"sort" | |
"strings" | |
) |
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
version: "3.7" | |
services: | |
spark-master: | |
image: $MYNAME/spark:latest | |
container_name: spark-master | |
hostname: spark-master | |
build: | |
context: . | |
dockerfile: Dockerfile | |
ports: |
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 openjdk:8-alpine | |
RUN apk --update add wget tar bash | |
RUN wget http://apache.mirror.anlx.net/spark/spark-2.4.2/spark-2.4.2-bin-hadoop2.7.tgz | |
RUN tar -xzf spark-2.4.2-bin-hadoop2.7.tgz && mv spark-2.4.2-bin-hadoop2.7 spark && rm spark-2.4.2-bin-hadoop2.7.tgz | |
RUN printf "#!/bin/sh\n/spark/bin/spark-class org.apache.spark.deploy.master.Master --host \$SPARK_MASTER_HOST --port \$SPARK_MASTER_PORT --webui-port \$SPARK_MASTER_WEBUI_PORT" > /start-master.sh | |
RUN chmod +x /start-master.sh | |
RUN printf "#!/bin/sh\n/spark/bin/spark-class org.apache.spark.deploy.worker.Worker --webui-port \$SPARK_WORKER_WEBUI_PORT \$SPARK_MASTER_URL" > /start-worker.sh | |
RUN chmod +x /start-worker.sh |