Skip to content

Conversation

rpmoore
Copy link
Contributor

@rpmoore rpmoore commented Aug 19, 2016

No description provided.

isTruncated = result.getTruncated();
marker = result.getNextMarker();
remainingKeys -= result.getObjects().size();
return new LazyObjectIterable(client, bucket, keyPrefix, nextMarker, maxKeys, 5);
Copy link
Contributor

Choose a reason for hiding this comment

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

5? dont you want this is be called DefaultRetries or something?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

private final int maxKeys;
private final int retryCount;

public LazyObjectIterable(final Ds3Client client, final String bucket, final String keyPrefix, final String nextMarker, final int maxKeys, final int retryCount) {
Copy link
Contributor

Choose a reason for hiding this comment

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

OR you can add a new constructor here that calls the other constructor with default retry value, this way this class contains all the behavior

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There was already the telescoping constructors in the helper functions, so I didn't want to move it over here as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

i just don't think that the helper class should hold the default for this calss

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The reason I think it should is that the helper function is currently where all that information exists. And rather than duplicating the telescoping constructors over into the iterator, it's all kept in one place.

return;
} catch (final IOException e) {
if (retryAttempt >= retryCount) {
throw new RuntimeException("Failed to get the next set of objects from the getBucket request", e);
Copy link
Contributor

Choose a reason for hiding this comment

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

we need to add to this message that we reached the max number of retries

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch

@shabtaisharon shabtaisharon merged commit d603a7b into SpectraLogic:master Aug 19, 2016
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