Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Switch to swank-clojure-project structure, but tests are still failing

  • Loading branch information...
commit c03ff2437d596c52abeebf67813f00cfe3d31f5a 1 parent 4c01d96
@mudphone authored
View
2  .gitignore
@@ -4,4 +4,4 @@
.project
logs/*
output/*
-lib/java/hbase-site.xml
+lib/hbase-site.xml
View
4 hbase-repl.sh
@@ -7,8 +7,8 @@ if [ -z "${HBASE_RUNNER_HOME}" ]; then
fi
# You can probably leave the rest alone:
-CLOJURE_DIR="${HBASE_RUNNER_HOME}/lib/java"
-CP_JARS="${CLOJURE_DIR}/*"
+LIB_DIR="${HBASE_RUNNER_HOME}/lib"
+CP_JARS="${LIB_DIR}/*"
CP="${CP_JARS}:${HBASE_RUNNER_HOME}/src"
# Add extra classpath, if any -- for example the location of hbase-site.xml.
View
2  init.clj
@@ -1,2 +1,2 @@
-(use 'mudphone.hbase-runner.hbase-repl)
+(use 'hbase-runner.hbase-repl)
(use 'clojure.contrib.pprint)
View
0  lib/java/clojure-contrib.jar → lib/clojure-contrib.jar
File renamed without changes
View
0  lib/java/clojure.jar → lib/clojure.jar
File renamed without changes
View
0  lib/java/commons-io-1.4.jar → lib/commons-io-1.4.jar
File renamed without changes
View
0  lib/java/commons-logging-1.0.4.jar → lib/commons-logging-1.0.4.jar
File renamed without changes
View
0  lib/java/hadoop-0.20.1-hdfs127-core.jar → lib/hadoop-0.20.1-hdfs127-core.jar
File renamed without changes
View
0  lib/java/hbase-0.20.2.jar → lib/hbase-0.20.2.jar
File renamed without changes
View
0  lib/java/jline-0.9.94.jar → lib/jline-0.9.94.jar
File renamed without changes
View
0  lib/java/log4j-1.2.15.jar → lib/log4j-1.2.15.jar
File renamed without changes
View
0  lib/java/zookeeper-3.2.1.jar → lib/zookeeper-3.2.1.jar
File renamed without changes
View
4 src/mudphone/hbase_runner/config/hbase_runner.clj → src/hbase_runner/config/hbase_runner.clj
@@ -1,5 +1,5 @@
-(ns mudphone.hbase-runner.config.hbase-runner
- (:use mudphone.hbase-runner.utils.file))
+(ns hbase-runner.config.hbase-runner
+ (:use hbase-runner.utils.file))
(def *hbase-runner-config*
(let [hbase-runner-home (or (System/getenv "HBASE_RUNNER_HOME")
View
42 src/mudphone/hbase_runner/hbase_repl.clj → src/hbase_runner/hbase_repl.clj
@@ -1,14 +1,14 @@
-(ns mudphone.hbase-runner.hbase-repl
+(ns hbase-runner.hbase-repl
(:import [java.io File])
(:import [org.apache.hadoop.hbase HBaseConfiguration HConstants])
(:import [org.apache.hadoop.hbase.client HBaseAdmin HTable Scan])
(:require [clojure.contrib [str-utils :as str-utils]])
- (:use mudphone.hbase-runner.config.hbase-runner)
- (:use mudphone.hbase-runner.utils.clojure)
- (:use mudphone.hbase-runner.utils.file)
- (:use mudphone.hbase-runner.utils.find)
- (:use mudphone.hbase-runner.utils.create)
- (:use mudphone.hbase-runner.utils.truncate)
+ (:use hbase-runner.config.hbase-runner)
+ (:use hbase-runner.utils.clojure)
+ (:use hbase-runner.utils.file)
+ (:use hbase-runner.utils.find)
+ (:use hbase-runner.utils.create)
+ (:use hbase-runner.utils.truncate)
(:use clojure.contrib.pprint))
(defn set-current-table-ns [current-ns]
@@ -20,7 +20,7 @@
current-ns
(hbr*default-table-ns))))
-(defn- read-conn-config []
+(defn read-conn-config []
(let [config-file (str (hbr*config-dir) "/connections.clj")]
(try
(load-file config-file)
@@ -30,7 +30,7 @@
config-file)
(System/exit 1)))))
-(defn- hbase-configuration
+(defn hbase-configuration
([]
(hbase-configuration :default))
([system]
@@ -43,6 +43,7 @@
(throw (Exception. "No matching system config.")))
(let [merged-config (merge
(:default user-configs) (system user-configs))
+ _ (pprint merged-config)
hbase-config (HBaseConfiguration.)]
(doto hbase-config
(.setInt "hbase.client.retries.number"
@@ -53,15 +54,22 @@
(:hbase.master merged-config))
(.set "hbase.zookeeper.quorum"
(:hbase.zookeeper.quorum merged-config))
- (.setBoolean "hbase.cluster.distributed"
- (:hbase.cluster.distributed merged-config))
- (.set "hbase.rootdir"
- (:hbase.rootdir merged-config))
- ))))))
+ )
+ (if (:hbase.cluster.distribued merged-config)
+ (doto hbase-config
+ (.setBoolean "hbase.cluster.distributed"
+ (:hbase.cluster.distributed merged-config))
+ (.set "hbase.rootdir"
+ (:hbase.rootdir merged-config)))
+ )
+ hbase-config)))))
(declare *HBaseConfiguration*)
-(defn- hbase-admin []
- (HBaseAdmin. *HBaseConfiguration*))
+(defn hbase-admin []
+ (println "Before hbase-admin")
+ (pprint *HBaseConfiguration*)
+ (HBaseAdmin. *HBaseConfiguration*)
+ (println "After hbase-admin"))
(defn print-current-settings []
(println "HBase Runner Home is:" (hbr*hbase-runner-home))
@@ -89,7 +97,9 @@
([system table-ns]
(set-current-table-ns table-ns)
(def *HBaseConfiguration* (hbase-configuration system))
+ (println "After HBaseConfig")
(def *HBaseAdmin* (hbase-admin))
+ (println "After HBaseAdmin")
(dosync
(alter *hbase-runner-config* assoc :system system))
(print-current-settings)))
View
4 src/mudphone/hbase_runner/spec_helper.clj → src/hbase_runner/spec_helper.clj
@@ -1,7 +1,7 @@
-(ns mudphone.hbase-runner.spec-helper
+(ns hbase-runner.spec-helper
(:require [clojure.contrib.java-utils :as java-utils])
(:import [org.apache.hadoop.hbase HTableDescriptor])
- (:use mudphone.hbase-runner.hbase-repl))
+ (:use hbase-runner.hbase-repl))
(defn create-table-if-does-not-exist [table-name]
(if-not (table-exists? table-name)
View
2  src/mudphone/hbase_runner/utils/clojure.clj → src/hbase_runner/utils/clojure.clj
@@ -1,4 +1,4 @@
-(ns mudphone.hbase-runner.utils.clojure
+(ns hbase-runner.utils.clojure
(:import (java.io PushbackReader StringReader)))
(defn read-clojure-str [object-str]
View
6 src/mudphone/hbase_runner/utils/create.clj → src/hbase_runner/utils/create.clj
@@ -1,8 +1,8 @@
-(ns mudphone.hbase-runner.utils.create
+(ns hbase-runner.utils.create
(:import [org.apache.hadoop.hbase HColumnDescriptor HTableDescriptor])
(:import [org.apache.hadoop.hbase.client HTable])
- (:use mudphone.hbase-runner.utils.clojure)
- (:use mudphone.hbase-runner.utils.file))
+ (:use hbase-runner.utils.clojure)
+ (:use hbase-runner.utils.file))
(defn- compression-name-for [hcolumn-descriptor]
(.getName (.getCompression hcolumn-descriptor)))
View
4 src/mudphone/hbase_runner/utils/file.clj → src/hbase_runner/utils/file.clj
@@ -1,7 +1,7 @@
-(ns mudphone.hbase-runner.utils.file
+(ns hbase-runner.utils.file
(:import (java.io BufferedReader BufferedWriter File FileInputStream FileWriter InputStreamReader)
(org.apache.commons.io FileUtils))
- (:use mudphone.hbase-runner.utils.clojure)
+ (:use hbase-runner.utils.clojure)
(:use clojure.contrib.pprint)
(:require [clojure.contrib.str-utils2 :as su2]))
View
2  src/mudphone/hbase_runner/utils/find.clj → src/hbase_runner/utils/find.clj
@@ -1,4 +1,4 @@
-(ns mudphone.hbase-runner.utils.find)
+(ns hbase-runner.utils.find)
(defn is-in-table-ns [table-ns table-name]
(not (nil? (re-find (re-pattern (str "^" table-ns)) table-name))))
View
2  src/mudphone/hbase_runner/utils/truncate.clj → src/hbase_runner/utils/truncate.clj
@@ -1,4 +1,4 @@
-(ns mudphone.hbase-runner.utils.truncate
+(ns hbase-runner.utils.truncate
(:use clojure.contrib.pprint))
(defn filter-truncated [results]
View
8 spec/mudphone/hbase_runner/hbase_repl_spec.clj → test/hbase_runner/hbase_repl_spec.clj
@@ -1,9 +1,9 @@
-(ns mudphone.hbase-runner-spec
+(ns hbase-runner.hbase-repl-spec
(:require [clojure.contrib.java-utils :as java-utils])
(:use [clojure.test :only [run-tests deftest is]])
- (:use mudphone.hbase-runner.config.hbase-runner)
- (:use mudphone.hbase-runner.spec-helper)
- (:use mudphone.hbase-runner.hbase-repl))
+ (:use hbase-runner.config.hbase-runner)
+ (:use hbase-runner.spec-helper)
+ (:use hbase-runner.hbase-repl))
(deftest current-table-ns-test
(is (= "hbr_spec" (current-table-ns))))
View
3  utils/completions.clj
@@ -1,7 +1,6 @@
-;; (use 'mudphone.hbase-runner.hbase-repl)
(def completions
(reduce concat (map (fn [p] (keys (ns-publics (find-ns p))))
- '(clojure.core clojure.set clojure.xml clojure.zip mudphone.hbase-runner.hbase-repl))))
+ '(clojure.core clojure.set clojure.xml clojure.zip hbase-runner.hbase-repl))))
(with-open [f (java.io.BufferedWriter. (java.io.FileWriter. (str (System/getenv "HOME") "/.clj_completions")))]
(.write f (apply str (interleave completions (repeat "\n")))))
View
8 utils/spec_suite.clj
@@ -1,9 +1,9 @@
-(ns mudphone.hbase-runner-spec
- (:use mudphone.hbase-runner.hbase-repl))
+(ns hbase-runner.hbase-repl-spec
+ (:use hbase-runner.hbase-repl))
(start-hbase-repl :test "hbr_spec")
-(load-file "src/mudphone/hbase_runner/spec_helper.clj")
-(load-file "spec/mudphone/hbase_runner/hbase_repl_spec.clj")
+(load-file "src/hbase_runner/spec_helper.clj")
+(load-file "test/hbase_runner/hbase_repl_spec.clj")
(run-tests)
Please sign in to comment.
Something went wrong with that request. Please try again.