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
# start GremlinServer | |
# bin/gremlin-server.sh -i org.apache.tinkerpop gremlin-python 3.2.2-SNAPSHOT | |
# bin/gremlin-server.sh conf/gremlin-server-modern-py.yaml | |
from gremlin_python.process.graph_traversal import GraphTraversal | |
from gremlin_python.process.graph_traversal import GraphTraversalSource | |
from gremlin_python.process.graph_traversal import __ | |
from gremlin_python.process.traversal import Operator | |
from gremlin_python.structure.io.graphson import GraphSONReader |
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
Producer | |
Setup | |
bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test-rep-one --partitions 6 --replication-factor 1 | |
bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test --partitions 6 --replication-factor 3 | |
Single thread, no replication | |
bin/kafka-run-class.sh org.apache.kafka.clients.tools.ProducerPerformance test7 50000000 100 -1 acks=1 bootstrap.servers=esv4-hcl198.grid.linkedin.com:9092 buffer.memory=67108864 batch.size=8196 |
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
object CassandraWrapper { | |
import scala.language.implicitConversions | |
import scala.language.postfixOps | |
/** | |
* Converts a `ResultSetFuture` into a Scala `Future[ResultSet]` | |
* @param f ResultSetFuture to convert | |
* @return Converted Future | |
*/ | |
implicit def resultSetFutureToScala(f: ResultSetFuture): Future[ResultSet] = { | |
val p = Promise[ResultSet]() |
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
// I was reading through these examples: http://apocalisp.wordpress.com/2010/06/08/type-level-programming-in-scala/ | |
// and I thought it would be nice to more quickly get to something useful, to show the power of the techniques. | |
object SizedListExample { | |
// Type of all Non-negative integers | |
sealed trait Nat | |
// This is zero. | |
sealed trait _0 extends Nat | |
// Successor to some non-negative number | |
sealed trait Succ[N <: Nat] extends Nat |
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
import java.net.InetSocketAddress | |
import scala.xml.{Elem, XML} | |
import org.jboss.netty.buffer.ChannelBuffers | |
import org.jboss.netty.util.CharsetUtil.UTF_8 | |
import com.twitter.finagle.Service; | |
import com.twitter.finagle.builder.ClientBuilder; | |
import com.twitter.finagle.http.{Http, RequestBuilder}; | |
import org.jboss.netty.handler.codec.http._ | |
import org.jboss.netty.buffer.ChannelBuffers.wrappedBuffer | |
import java.net.URL |