Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

when the uid of METRIC, TAGK, TAGV are the same,the document which send to es ealier will be overrided by the lastest. #10

Open
lynnyuan-arch opened this issue May 28, 2019 · 0 comments

Comments

@lynnyuan-arch
Copy link

As follows:
uidmeta:
doc1. {"uid":"1", type:"METRIC", name:"sys.cpu.usage"}
doc2. {"uid":"1", type:"TAGK", name:"host.name"}
the document "doc1" will be overrided by "doc2"
source codes:

https://github.com/OpenTSDB/opentsdb-elasticsearch/blob/master/src/main/java/net/opentsdb/search/schemas/uidmeta/UIDMetaSchema.java

final StringBuilder uri = new StringBuilder(es.host())
.append("/")
.append(es.index())
.append("/")
.append(doc_type)
.append("/")
.append(meta.getUID());

so, i just add uid type(metric, tagk, tagv) before uid value。
as follows:

final StringBuilder uri = new StringBuilder(es.host())
.append("/")
.append(es.index())
.append("/")
.append(doc_type)
.append("/")
.append(meta.getType().name().toLowerCase()+meta.getUID());

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

No branches or pull requests

1 participant