Skip to content

Conversation

@GraciesPadre
Copy link
Contributor

This pull request is to address https://jira.spectralogic.com/browse/JSDK-165: Our ObjectCompleted Handler must run first

Basically, this moves firing events into the JobImpl base class, which uses a wrapper to create 2 JobPartTracker's: 1 used to fire events we register to close channels we open when Job.transfer is called; the other to fire events customers register for.

Most of this pull request is a set of integration tests. Because the nature of the problem we're solving is non-determinism in firing events, we can't rely solely of having event handlers fire in the expected order in the tests, because we don't know if firing in the right order is deterministic or not. So, we check that the JobPartTrackers have the correct number of event handlers, internal vs. client, then inject an interceptor to ensure that we're calling the event handlers in the right order.

…is closed before we fire customer onCompleted events.

This is specific to read jobs.  Needs implementing for both read ans write.
…d before we fire customer onCompleted events.
private final JobPartTracker internalJobPartTracker;

protected JobPartTrackerDecorator(final List<Objects> chunks, final EventRunner eventRunner) {
clientJobPartTracker = JobPartTrackerFactory.buildPartTracker(Iterables.concat(getAllBlobApiBeans(chunks)), eventRunner);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is Iterables.concat required here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't know. I just copied that from what was there already. I'll see.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would appear not

@rpmoore rpmoore merged commit 5a7cd43 into SpectraLogic:master Oct 14, 2016
@GraciesPadre GraciesPadre deleted the object_complete_handler branch October 14, 2016 22:15
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

Successfully merging this pull request may close these issues.

2 participants