df = sqlContext.createDataFrame([("test", 1)])
df.show()
import com.datastax.spark.connector._ | |
import com.datastax.spark.connector.cql._ | |
import org.apache.spark.SparkContext | |
def twoClusterExample ( sc: SparkContext) = { | |
val connectorToClusterOne = CassandraConnector(sc.getConf.set("spark.cassandra.connection.host", "127.0.0.1")) | |
val connectorToClusterTwo = CassandraConnector(sc.getConf.set("spark.cassandra.connection.host", "127.0.0.2")) |
# Licensed to the Apache Software Foundation (ASF) under one | |
# or more contributor license agreements. See the NOTICE file | |
# distributed with this work for additional information | |
# regarding copyright ownership. The ASF licenses this file | |
# to you under the Apache License, Version 2.0 (the | |
# "License"); you may not use this file except in compliance | |
# with the License. You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# |
if [ "$JVM_VERSION" \< "1.8.0" ] ; then | |
### Start CMS GC Settings | |
# Used if Java version is not 1.8+, G1GC is used for Java 1.8+. | |
# some JVMs will fill up their heap when accessed via JMX, see CASSANDRA-6541 | |
JVM_OPTS="$JVM_OPTS -XX:+CMSClassUnloadingEnabled" | |
# CMS GC tuning options | |
JVM_OPTS="$JVM_OPTS -Xmn${HEAP_NEWSIZE}" | |
JVM_OPTS="$JVM_OPTS -XX:+UseParNewGC" | |
JVM_OPTS="$JVM_OPTS -XX:+UseConcMarkSweepGC" |
{ | |
"cluster_name": "blades", | |
"private_key_path": "/Users/russellspitzer/.ssh/blade", | |
"ssh_user": "root", | |
"hosts": [ | |
{ | |
"host_name": "blade-8-3a", | |
"ip_address": "blade-8-3a", | |
"private_host_name": "blade-8-3a", | |
"private_ip_address": "blade-8-3a" |
if(! (!this.collisionDetection || !this.collisionMap || !this.collisionMap.loaded)) { | |
//Breaking is for losers | |
this.key.forward = true | |
var x = Math.round(this.collisionMap.pixels.width / 2 + this.dummy.position.x * this.collisionPixelRatio); | |
var z = Math.round(this.collisionMap.pixels.height / 2 + this.dummy.position.z * this.collisionPixelRatio); | |
var pos = new THREE.Vector3(x, 0, z); | |
//console.log(x, z, this.collisionMap.pixels.width, this.collisionMap.pixels.height, this.dummy.position.x, this.dummy.position.z) |
df = sqlContext.createDataFrame([("test", 1)])
df.show()
```python | |
df = sqlContext.createDataFrame([("test", 1)]) | |
``` | |
```python | |
df.show() | |
``` |
```python | |
df = sqlContext.createDataFrame([("test", 1)]) | |
``` | |
```python | |
df.show() | |
``` |
if(! (!this.collisionDetection || !this.collisionMap || !this.collisionMap.loaded)) { | |
if (this.speed < 7) { | |
this.key.forward = true | |
} else { | |
this.key.forward = false | |
} | |
var x = Math.round(this.collisionMap.pixels.width / 2 + this.dummy.position.x * this.collisionPixelRatio); | |
var z = Math.round(this.collisionMap.pixels.height / 2 + this.dummy.position.z * this.collisionPixelRatio); | |
var pos = new THREE.Vector3(x, 0, z); |
./bin/sparkR --packages com.datastax.spark:spark-cassandra-connector_2.10:1.4.0-M3 --conf spark.cassandra.connection.host 127.0.0.1 | |
myframe <-read.df(sqlContext, source = "org.apache.spark.sql.cassandra", keyspace = "important", table = "letters") | |
head(myframe) | |
mailbox touser fromuser | |
1 1 doc marty | |
2 1 lorraine marty | |
3 2 marty doc | |
body |