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

Order of monstache golang functions execution #709

Open
Joey0538 opened this issue Jan 14, 2024 · 0 comments
Open

Order of monstache golang functions execution #709

Joey0538 opened this issue Jan 14, 2024 · 0 comments

Comments

@Joey0538
Copy link

Joey0538 commented Jan 14, 2024

Hi @rwynn I'm new to Monstache, its a great tool....
Could you please clarify the order of execution regarding these golang functions for building monstache plugins:

func Map(input *monstachemap.MapperPluginInput) (output *monstachemap.MapperPluginOutput, err error)

func Filter(input *monstachemap.MapperPluginInput) (keep bool, err error)

func Pipeline(ns string, changeStream bool) (stages []interface, err error)

func Process(input*monstachemap.ProcessPluginInput) error

My guess for the call order is : Pipeline (called once for each collection & finding documents based on some criteria) -> Filter (whether to continue processing further for indexing or drop based on doc field criteria) -> Map (transform doc before indexing) -> Process (Maybe log or modify existing doc for processing)

Please let me know if I'm right about this, I plan on writing a go plugin for resuming direct-read-namespaces from a given timestamp (got this idea from you while I was scrolling through the open and closed issues)

And another doubt, if I'm using the same go.mod file from the repo, to be precise same go version 1.19, why can't I directly mount the plugin.so built locally and supply it to the docker image via volume mounts? when I attempt to do this I'm unable to run the plugin with some _vprintf error but, if I build the plugin through the dockerfile, I'm able to run the plugin? Its like for each change in the plugin code, I have rebuild the entire docker image for monstache to be able to run the plugin, is there no other way to directly mount the plugin file to the docker image?

@Joey0538 Joey0538 changed the title Order of monstache golang plugin functions execute Order of monstache golang functions execution Jan 14, 2024
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