Skip to content

Instantly share code, notes, and snippets.

View beobal's full-sized avatar

Sam Tunnicliffe beobal

View GitHub Profile
@beobal
beobal / CassandraAuthorizer.diff
Created October 31, 2016 11:21
Make CassandraAuthorizer more testable
diff --git a/src/java/org/apache/cassandra/auth/CassandraAuthorizer.java b/src/java/org/apache/cassandra/auth/CassandraAuthorizer.java
index 8c3485d..87bbf70 100644
--- a/src/java/org/apache/cassandra/auth/CassandraAuthorizer.java
+++ b/src/java/org/apache/cassandra/auth/CassandraAuthorizer.java
@@ -200,11 +200,7 @@ public class CassandraAuthorizer implements IAuthorizer
BatchStatement.Type.LOGGED,
Lists.newArrayList(Iterables.filter(statements, ModificationStatement.class)),
Attributes.none());
- QueryProcessor.instance.processBatch(batch,
- QueryState.forInternalCalls(),
/*
* 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
import org.apache.tools.ant.Target
ant.importBuild("build.xml")
task modifyAntBuild << {
modifyDummyTarget()
}
void modifyDummyTarget() {
println "Modifying dummy target"
@beobal
beobal / ConnectionTest.java
Last active October 13, 2015 07:47
Dumb tester for Cassandra JDBC Connections
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
public class ConnectionTest
{
@beobal
beobal / aws_usage.py
Created November 28, 2011 11:34 — forked from harperreed/aws_usage.py
A script to query the Amazon Web Services (S3/EC2/etc) usage reports programmatically.
#!/usr/bin/env python
"""
A script to query the Amazon Web Services usage reports programmatically.
Ideally this wouldn't exist, and Amazon would provide an API we can use
instead, but hey - that's life.
Basically takes your AWS account username and password, logs into the
website as you, and grabs the data out. Always gets the 'All Usage Types'