Skip to content

Instantly share code, notes, and snippets.

Stargate Scanner Filter Examples

Introduction

So yeah... no documentation for the HBase REST API in regards to what should a filter look like...

So I installed Eclipse, got the library, and took some time to find some of the (seemingly) most useful filters you could use. I'm very green at anything regarding HBase, and I hope this will help anyone trying to get started with it.

What I discovered is that basically, attributes of the filter object follow the same naming than in the documentation. For this reason, I have made the link clickable and direct them to the HBase Class documentation attached to it; check for the instantiation argument names, and you will have your attribute list (more or less).

@bridiver
bridiver / gist:2c8db1dca34e706c5291
Last active August 29, 2015 14:05
S3 strong consistency
def write_with_strong_consistency(*args, &block)
result = write(*args, &block)
redis.set("s3:key:#{key}", result.etag, ex: 24*60*60)
result
end
def delete_with_strong_consistency(options = {})
result = delete(options)
redis.set("s3:key:#{key}", 'deleted', ex: 24*60*60) unless options[:version_id]
result
@bridiver
bridiver / emr_hbase_bootstrap.sh
Created February 12, 2014 18:57
EMR Map HBase Boostrap
apt-get install mapr-sqoop
hadoop fs -copyToLocal s3://korrelate/hadoop/lib/postgresql-9.2-1003.jdbc4.jar postgresql-9.2-1003.jdbc4.jar
sudo cp postgresql-9.2-1003.jdbc4.jar /opt/mapr/sqoop/sqoop-1.4.4/lib/
sudo cp postgresql-9.2-1003.jdbc4.jar /opt/mapr/pig/pig-0.12/lib/
/opt/mapr/hbase/hbase-0.94.13/bin/hbase-daemon.sh start rest
@bridiver
bridiver / .ruvy-env
Created December 1, 2013 15:59
Fix for java.lang.OutOfMemoryError: PermGen space in JRuby
JRUBY_OPTS=--1.9 -J-XX:+CMSClassUnloadingEnabled -J-XX:MaxPermSize=256m -J-Xmx1024m -J-Xms1024m
@bridiver
bridiver / storm.diff
Created December 1, 2013 15:43
Fix for https://github.com/nathanmarz/storm/issues/495 - Compiling Storm 0.9.0 results in java.lang.ClassNotFoundException: backtype.storm.LocalDRPC
diff --git a/src/clj/backtype/storm/testing4j.clj b/src/clj/backtype/storm/testing4j.clj
index 0e517f6..dd52573 100644
--- a/src/clj/backtype/storm/testing4j.clj
+++ b/src/clj/backtype/storm/testing4j.clj
@@ -1,5 +1,6 @@
(ns backtype.storm.testing4j
(:import [java.util Map List Collection ArrayList])
+ (:require [backtype.storm LocalCluster])
(:import [backtype.storm Config ILocalCluster LocalCluster])
(:import [backtype.storm.generated StormTopology])
@bridiver
bridiver / project.clj.diff
Last active December 29, 2015 22:19
Upgrade snakeyaml for JRuby 1.7.4 on Storm 0.9.3-wip16
diff --git a/project.clj b/project.clj
index 7f59387..8799476 100644
--- a/project.clj
+++ b/project.clj
@@ -18,7 +18,7 @@
[org.clojure/tools.logging "0.2.3"]
[org.clojure/math.numeric-tower "0.0.1"]
[storm/carbonite "1.5.0"]
- [org.yaml/snakeyaml "1.9"]
+ [org.yaml/snakeyaml "1.11"]
@bridiver
bridiver / JRUBY-6970-openssl.rb
Created December 1, 2013 15:28
Fix for various JRuby 1.7 jar loading issues
# @see JRUBY-6970.rb
# encoding: utf-8
# a 'require "openssl" has occurred.
class OpenSSL::SSL::SSLContext
alias_method :ca_path_JRUBY_6970=, :ca_path=
alias_method :ca_file_JRUBY_6970=, :ca_file=
def ca_file=(arg)
if arg =~ /^jar:file:\//
return ca_file_JRUBY_6970=(arg.gsub(/^jar:/, ""))
@bridiver
bridiver / topology_dependencies.xml
Created December 1, 2013 15:17
Topology dependencies file for storm with jruby 1.7.4
<?xml version="1.0"?>
<ivy-module version="2.0" xmlns:m="http://ant.apache.org/ivy/maven">
<info organisation="redstorm" module="topology-deps"/>
<dependencies>
<dependency org="org.jruby" name="jruby-core" rev="1.7.4" conf="default" transitive="true"/>
<!-- explicitely specify jffi to also fetch the native jar. make sure to update jffi version matching jruby-core version -->
<!-- this is the only way I found using Ivy to fetch the native jar -->
<dependency org="com.github.jnr" name="jffi" rev="1.2.5" conf="default" transitive="true">
<artifact name="jffi" type="jar" />
@bridiver
bridiver / storm_dependencies.xml
Last active December 29, 2015 22:18
Storm dependencies file for 0.9.0-wip16
<?xml version="1.0"?>
<ivy-module version="2.0">
<info organisation="redstorm" module="storm-deps"/>
<dependencies>
<dependency org="storm" name="storm" rev="0.9.0-wip16" conf="default" transitive="true" />
<!-- https://github.com/nathanmarz/storm/pull/567 -->
<override org="org.yaml" module="snakeyaml" rev="1.11"/>
</dependencies>
</ivy-module>
# This is an extension to ActiveMerchant to make the CIM gateway look a little more like the other gateways that
# support recurring billing. I wrote this code for the SaaS Rails Kit (http://railskits.com/saas), so if you are
# looking for a billing solution for your Rails application, feel free to check it out. :)
require 'digest/sha1'
module ActiveMerchant #:nodoc:
module Billing #:nodoc:
class AuthorizeNetCimGateway < Gateway