Skip to content
This repository has been archived by the owner on Sep 2, 2020. It is now read-only.

"Implement Cassandra index in terms of index interface" broke querying with cassandra index #209

Open
arodland opened this issue May 24, 2016 · 5 comments

Comments

@arodland
Copy link

fc85da5 changed prefixes to return something without a "path" key, which is inconsistent with other indexes, and causes a NPE like so: https://gist.github.com/arodland/2218ee4af35b2a38adb40263f86d54d4 .

Adding :path path to prefix-info fixes the NPE, but is probably far from the best fix.

Relatedly, there is brutasse/graphite-cyanite#21 which relates to graphite-api being broken by the same dropping of path at the API layer.

@arodland
Copy link
Author

(forgive any lack of precision, I don't speak Clojure so I'm stumbling around in the dark here a bit.)

@ifesdjeen
Copy link
Collaborator

ifesdjeen commented May 25, 2016

Thanks for reporting! The first implementation was a bit overtuned. We've already done some work on improving it and working on more improvements. Having that said, it should be fixed in latest master.

@arodland
Copy link
Author

Sorry if I wasn't clear. It's broken for me on current master . I get Internal Server Error / NPE for any render other than ones that return no data points.

@ifesdjeen ifesdjeen reopened this May 25, 2016
@ifesdjeen
Copy link
Collaborator

I'll take a closer look at it tonight. I've been testing against grafana proxy, which might be a bit different setting. I'll take a closer look at how graphite-cyanite integrates.

@pauzed
Copy link

pauzed commented May 31, 2016

Yes, I was getting similar problems using graphite-api, and this made everything happier:

diff --git a/src/io/cyanite/index/cassandra.clj b/src/io/cyanite/index/cassandra.clj
index e918fe9..74a1a27 100644
--- a/src/io/cyanite/index/cassandra.clj
+++ b/src/io/cyanite/index/cassandra.clj
@@ -52,7 +52,8 @@

(defn prefix-info
[pattern-length [path length leaf]]
- {:text (last (split path #"\."))
+ {:path path
+ :text (last (split path #"\."))
:id path
:allowChildren (not leaf)
:expandable (not leaf)`

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants