b- MindBaseClj edit** - wiki at8a.....

; ; ;{{{ (if (.equals (.getPathInfo request) "/") (str "

Timeline

" ((defn scanZ [zz] (let [log (.next zz)] (if log (let [logValue (.getValue (.get log "log:date")) logTs (.getTimestamp (.get log "log:date")) now (.getTime (new java.util.Date)) diffSec (long (/ (- now logTs) 1000)) diffH (long (/ diffSec 3600)) ] (str "" (scanZ zz))) ) ) ) (.getScanner (new org.apache.hadoop.hbase.client.HTable hConf "ChatLog") (into-array ["log:"])) ) "
" (if (< diffSec 60) (str diffSec " sec ago") (if (< diffSec 3600) (str (long (/ diffSec 60)) " min ago") (str diffH " h ago"))) "
" (.format (new java.text.SimpleDateFormat "yyyy-MM-dd hh:mm:ss") (new java.util.Date logTs)) "
" (if (.containsKey log "log:user") (new String (.getValue (.get log "log:user"))) "RainerWasserfuhr") "" (new String logValue) " #
" ) ) (if (.startsWith (.getPathInfo request) "/base") (if (.startsWith (.getPathInfo request) "/base/") (if (.startsWith (.getPathInfo request) "/base/new") (str "

New Table:

Name:
Family:
" ) (let [pageName (.substring (.getPathInfo request) (.length "/base/"))] (str "

Table: " pageName "

" ((defn scanZ [zz] (let [next (.next zz)] (if next (str "
  • " (.format (new java.text.SimpleDateFormat "yyyy.MM.dd hh:mm:ss") (new java.util.Date (.getTimestamp (.get next "log:date")))) ": " (new String (.getValue (.get next "log:date"))) "
  • " (scanZ zz)) ) ) ) (.getScanner (new org.apache.hadoop.hbase.client.HTable hConf pageName) (into-array ["log:"])) ) ) ) ) ) (str "

    Tables

    " (apply str (map (fn [x] (str "" (.getNameAsString x) " " )) (.listTables hBase)) ) ) ) ;}}}