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

Enhancements for Listeners #882

Closed
sammefford opened this issue Jan 24, 2018 · 2 comments
Closed

Enhancements for Listeners #882

sammefford opened this issue Jan 24, 2018 · 2 comments

Comments

@sammefford
Copy link
Contributor

sammefford commented Jan 24, 2018

As we develop TableauDataExtractOutput and ExtractViaTemplateListener to feed it, we noticed some enhancements that could really help with Listener development (including #614):

// just add a couple convenience methods
QueryBatcher {
  ...
  // to give QueryBatchListeners access to the client in initializeListener method
  // in our case, it allows ExtractPathsListener to create its own RowManager and PlanBuilder
  DatabaseClient getPrimaryClient()

  // see https://github.com/marklogic/java-client-api/issues/614
  onCompletion(JobCompletionListener listener)
}

// add a static final DATATYPE field to all subinterfaces of XsAnyAtomicTypeExpr
// containing the string returned by RowRecord.getDatatype for any column of that type.
XsStringVal {
  String DATATYPE = "xs:string"
}
@vivekmuniyandi
Copy link
Contributor

Created #901 for the last part.

vivekmuniyandi added a commit that referenced this issue Mar 8, 2018
…y rows and handled multi threading issues
vivekmuniyandi added a commit that referenced this issue Mar 8, 2018
…y rows and handled multi threading issues
@vivekmuniyandi
Copy link
Contributor

QA and Docs

Added new listener capability to include listeners on completion. One may want to include listeners to run them after the job is completed. (Please note that this is implemented just in QueryBatcher and for WriteBatcher is targeted for next release). We have created generic QueryBatcherListener to add listeners which act at the Batcher level and we use that listener to register here with the onJobCompletion method of QueryBatcher to have them executed at the end of the job i.e. after all the URIs are retrieved from the server in batches and the associated listeners are finished executing for each batch. After the entire job is done, these listeners will execute. Added getQueryJobCompletionListeners and setQueryJobCompletionListeners just like we have for the other listeners. The default close() method has been handled via #891.

QA

Tests need to be added to check that it has been triggered after the job is completed and not half way through. And please add tests that would check for all possible conditions like when stopJob() is called half way through. The way it behaves now is, when stopJob() is called after the job is done, we wait for the listeners to complete. If the stopJob() is called when the job is half way, then we interrupt and come out of it logging a warning.

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

No branches or pull requests

3 participants