Skip to content

Instantly share code, notes, and snippets.

@yyuu
Created April 20, 2011 12:33
Show Gist options
  • Save yyuu/931210 to your computer and use it in GitHub Desktop.
Save yyuu/931210 to your computer and use it in GitHub Desktop.
Makefile to dump all Cassandra's SSTables to JSON (with LZO compression)
SRCDIR = /var/lib/cassandra/data
DSTDIR = .
SOURCES = $(wildcard $(SRCDIR)/*/*-Data.db)
ALL = $(foreach S,$(SOURCES),$(basename $(subst $(SRCDIR)/,,$(S))).json.lzo)
.SUFFIXES: .json.lzo
all: $(ALL)
%.json.lzo:
-mkdir -p $(dir $@)
sstable2json $(SRCDIR)/$(basename $(basename $@)).db | lzop -c > $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment