Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
{ | |
"schedule": "R/2014-09-25T17:22:00Z/PT2M", | |
"name": "dockerjob", | |
"container": { | |
"type": "DOCKER", | |
"image": "ubuntu:latest", | |
"network": "HOST", | |
"volumes": [] | |
}, | |
"cpus": "0.5", |
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
{ | |
"schedule": "R10/2016-12-05T10:00:00Z/PT1M", | |
"name": "simple_echo", | |
"epsilon": "PT15M", | |
"command": "echo 'hello world'", | |
"owner": "[email protected]", | |
"async": false | |
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
/** | |
-- Datamodel | |
-- local keyspace | |
CREATE KEYSPACE example | |
WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 }; | |
-- table schema | |
CREATE TABLE example.words ( | |
word text PRIMARY KEY, | |
count int |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>org.acme</groupId> | |
<artifactId>spark-cassandra-assembly</artifactId> | |
<version>1.0.0-SNAPSHOT</version> | |
<packaging>jar</packaging> | |
<name>A uber jar to easily use the Cassandra-Spark driver with spark-shell </name> |
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
def saveToCassandra(sc:SparkContext, total:Int): Long = { | |
val cas = CasBuilder.cql3.withColumnFamily("keyspace", "raw").onHost(host).onPort(port) | |
.saveWithQuery("UPDATE keyspace.raw set metric=?, vals=?") | |
implicit def TsToCasKeys(src:Array[String]): Map[String, ByteBuffer] = src match { | |
case Array(device_id, aggregation_type, t0, metric, vals) => | |
Map("device_id" -> device_id, "aggregation_type" -> aggregation_type, "t0" -> t0) | |
} |