Skip to content
This repository has been archived by the owner on May 6, 2022. It is now read-only.

Chronix v0.5-beta API and plugin-in documentation are not in sync #150

Closed
alexnavis opened this issue Jul 10, 2019 · 11 comments
Closed

Chronix v0.5-beta API and plugin-in documentation are not in sync #150

alexnavis opened this issue Jul 10, 2019 · 11 comments

Comments

@alexnavis
Copy link

alexnavis commented Jul 10, 2019

Hi,

I was trying to implement a custom function(bucketed avg to reduce data points) with the plugin-in framework (following the Noop example).

I created a metric-functions.jar to deploy with the ChronixDb. I found the following issues:

  1. Chronix v0.5-beta release - does not have the FunctionCtx in the current release version. I see the master is 66 commits ahead of the release which contains the FunctionCtx changes.
    Current Release(0.5-beta) has the below contract:
    ChronixFunction.execute(T timeSeries, FunctionValueMap functionValueMap).
  2. Also the API(ChronixFunction) doesn't have way to set arguments setArguments(String[] args) (like the one in the latest documentation). I couldn't inject the arguments with the Guice @Inject as well. I'm stuck here.

Questions:

  1. Is there a way to achieve the above to setArguments() for custom functions like (e.g., metric:{movavg:1,minutes} ) and make a workable plugin with the current Chronix v0.5-beta release ?
  2. If it is not possible to use v0.5-beta release, is it possible for you to just make release a new version for the plugin with the current master code changes ?. This will be helpful for people to be in sync with the readme document. I spent some time to understand why it didn't work.
  3. In the interim, is the master stable enough to use as the actual release ?. (I can do a local build to get the required jar).

Thanks,
Alex

@FlorianLautenschlager
Copy link
Member

Hi Alex,

thanks for reporting. I am currently working on migrating Chronix to the latest Apache Solr version.
As soon as I am done, i will also update the documentation (i know its a mess). I am currently on a business trip and will dig into your questions this evening (UTC).

Best Regards,
Florian

@alexnavis
Copy link
Author

alexnavis commented Jul 10, 2019

Sharing what I found so far to help you find things faster. Thank you for the quick reply @FlorianLautenschlager :).

Tag Chronix v0.5-beta: (below doesn't have the arguments passed to the plugin functions)

for (String queryFunction : queryFunctions) {
//function has an argument
if (queryFunction.contains(AGGREGATION_ARGUMENT_DELIMITER)) {
arguments = extractAggregationParameter(queryFunction);
queryFunction = queryFunction.substring(0, queryFunction.indexOf(AGGREGATION_ARGUMENT_DELIMITER));
}
ChronixFunction chronixFunction;
if (chronixType.supportsFunction(queryFunction)) {
chronixFunction = chronixType.getFunction(queryFunction, arguments);
} else {
//check the plugins for this type
LOGGER.debug("Try to find plugin for type {} and function {}", typeName, queryFunction);
chronixFunction = plugInFunctions.getFunctionForQueryName(typeName, queryFunction);
if (chronixFunction == null) {
LOGGER.debug("Could not find custom function {} for type {}", queryFunction, typeName);
continue;
}
}

@alexnavis
Copy link
Author

Hi @FlorianLautenschlager ,

Sorry to remind, I need to implement functions for a release soon. Any help on the questions for an interim solution would be great.

Thanks,
Alex

@FlorianLautenschlager
Copy link
Member

FlorianLautenschlager commented Jul 12, 2019

Hi @alexnavis ,

I need to fix a few things and will release a new version (hopefully) on Monday.
Is this something that is working for you?

A new release should solve the questions from above.

Cheers,
Florian

@alexnavis
Copy link
Author

Hi @FlorianLautenschlager ,

Thanks a lot, it would work definitely. Please do let me know if I can help in any way.

Thanks,
Alex

@alexnavis
Copy link
Author

FYI: I forgot to mention about the dependency jar "chronix-server-plugin-management-0.5-beta.jar" which is a dependency for the plugin is not in the mvn repo. Currently it is not a problem for me, since I have used a local copy of the jar from the release bundle.

@FlorianLautenschlager
Copy link
Member

@alexnavis I just pushed a 0.5 release with Apache Solr 8.1.1 under the hood. Thx for you comments. Will deploy the jars tomorrow into the maven repo. Time to get some sleep.

@alexnavis
Copy link
Author

@FlorianLautenschlager Thanks a lot. Really appreciate the extra effort to complete this. Have good rest. Am excited to test the new version. Thank you.

@alexnavis
Copy link
Author

Hi @FlorianLautenschlager,

The plugin functionality works great. Thanks for the help.

Just one question, the solarconfig.xml packaged in the chronix/conf directory in the 0.5 build has the 6.2.1.

Any specific reason we cannot upgrade this to latest Lucene version ?

Thanks,
Alex

@FlorianLautenschlager
Copy link
Member

Hi @alexnavis ,

The plugin functionality works great. Thanks for the help.

Thank you for the feedback.

Just one question, the solarconfig.xml packaged in the chronix/conf directory in the 0.5 build has the 6.2.1.

Any specific reason we cannot upgrade this to latest Lucene version ?

No. Missed to update the value.

Cheers,
Florian

@alexnavis
Copy link
Author

Thanks Florian. I will close this card.

Please do recommend if the defaults fields (e.g., start, end) should have docValues values enabled to take advantage of the latest changes.

Thanks.

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

No branches or pull requests

2 participants