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
| cd /tmp | |
| wget http://downloads.sourceforge.net/cyclops-group/jmxterm-1.0-alpha-4-uber.jar | |
| java -jar jmxterm-1.0-alpha-4-uber.jar | |
| >open localhost:7199 | |
| >bean org.apache.cassandra.db:type=Caches | |
| >info | |
| >get KeyCacheSize | |
| >get RowCacheSize | |
| >get KeyCacheCapacityInMB | |
| >get RowCacheCapacityInMB |
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
| if [ -f ${HOME}/.ssh-agent ]; then | |
| . ${HOME}/.ssh-agent > /dev/null | |
| fi | |
| if [ -z "$SSH_AGENT_PID" -o -z "`/usr/bin/ps -a|/usr/bin/egrep \"^[ ]+$SSH_AGENT_PID\"`" ]; then | |
| /usr/bin/ssh-agent > ${HOME}/.ssh-agent | |
| . ${HOME}/.ssh-agent > /dev/null | |
| fi | |
| ssh-add ~/.ssh/id_rsa |
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
| nodetool cfstats | grep 'Memtable Data Size' | awk '{sum+=$4}END{print sum}' |
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
| #coding: UTF-8 | |
| import shutil | |
| import socket | |
| import subprocess | |
| from time import sleep | |
| import uuid | |
| import os, tempfile | |
| from logging import getLogger | |
| CASSANDRA_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '../../resources/cassandra')) # change me |
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
| #coding: UTF-8 | |
| import logging | |
| import unittest | |
| import sys | |
| from javasplitter.embedded_cassandra import EmbeddedCassandra | |
| class EmbeddedCassandraTestCase(unittest.TestCase): | |
| def __init__(self, methodName='runTest', port=None): | |
| super(EmbeddedCassandraTestCase, self).__init__(methodName) |
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
| #coding: UTF-8 | |
| import random | |
| import string | |
| from pycassa import ConnectionPool, SystemManager, ColumnFamily, SIMPLE_STRATEGY, UTF8_TYPE, INT_TYPE | |
| from javasplitter.embedded_cassandra_test import EmbeddedCassandraTestCase | |
| class RandomWordTest(EmbeddedCassandraTestCase): | |
| def setUp(self): |
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
| mvn clean package |
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
| object ExampleRestApp { | |
| class RestController(statsReceiver: StatsReceiver = NullStatsReceiver) extends Controller(statsReceiver) { | |
| get("/user/:userId") { request => | |
| val userId: Long = request.routeParams.getOrElse("userId", "0").toLong | |
| val user = someService.lookupUser(userId) | |
| if (user == null) { | |
| render.notFound.plain("").toFuture | |
| } else { | |
| render.body(user).header("Content-Type", "application/json").toFuture |
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
| object ExampleRestApp { | |
| @Api(value = "/", description = "Docs for our example controller") | |
| @Path("/") | |
| class RestController(statsReceiver: StatsReceiver = NullStatsReceiver) extends Controller(statsReceiver) { | |
| get_user_id() | |
| @ApiOperation(value = "Returns a user in json format.", notes = "Will only return a subset of the attributes.", responseClass = "java.lang.String", httpMethod = "GET") | |
| @Path("user/{userId}") | |
| @ApiErrors(Array(new ApiError(code = 404, reason = "No such user"))) | |
| def get_user_id(@ApiParam(name = "UserId", value = "A valid user id", required = true) env: Long = 0L) { |
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> | |
| <dependencies> | |
| // not all shown |