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
| apiVersion: v1 | |
| kind: Pod | |
| metadata: | |
| name: user-service | |
| namespace: app | |
| spec: | |
| containers: | |
| - name: user-service |
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.ratingMovie.spark | |
| import org.apache.spark.SparkContext | |
| object SparkCountRating { | |
| def main(args: Array[String]): Unit = { | |
| val sparkContext = new SparkContext("local[*]", "SparkCountRating") | |
| var data = sparkContext.textFile("ratings.csv") |
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
| from pyspark import SparkContext, SparkConf | |
| config = SparkConf().setAppName("WordCount") | |
| sparkContext = SparkContext.getOrCreate() | |
| content = sc.textFile("words.txt") | |
| filter_empty_lines = content.filter(lambda x: len(x) > 0) | |
| words = filter_empty_lines.flatMap(lambda x: x.split(' ')) | |
| counts = words.map(lambda x:(x,1)).reduceByKey(lambda x, y: x + y).map(lambda x: (x[1], x[0])).sortByKey(False) |
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
| db.airbnb.find({"$and":[{"reviews.comments": | |
| {"$regex": '/best place tobe/'}}, | |
| {"name": {"$regex": 'Cobertura'}}, | |
| {"reviews.comments": {"$regex": 'Lugar muito aconchegante'}}, | |
| {"reviews.comments": {"$regex": 'Ótimo host'}}, | |
| {"host_location": {"$regex": 'São Paulo'}}, | |
| {"host_response_time": {"$regex": 'hour'}}, | |
| ]} | |
| ).pretty() |
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
| FROM node:10-alpine as buildContainer | |
| RUN ["mkdir", "/app"] | |
| WORKDIR /app | |
| COPY package.json /app | |
| RUN ["npm", "install"] |
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
| function run(value) { | |
| var message = ''; | |
| [].map.call(value, function (character) { | |
| message += cripty(character); | |
| }); | |
| return message; | |
| } |