This method retrieves the requested shard or the most appropriate one if the requested shard index is invalid.
If the requested shard index is negative then this is an internal error and so an exception is thrown.
If the requested shard index is less than or equal to the last shard generated then the appropriate shard is returned.
If the requested shard index is greater than the last shard generated then the behaviour depends on whether the dissectable area is complete and whether a shard is currently being generated.
- If the dissectable area is complete, i.e. all the shards have been generated then the last shard is returned.
- If it is not complete but a shard is currently being selected then this method waits for the next shard to complete and returns that.
- If it is not complete and no shard is currently being selected then the next shard is selected.
@param requestedShard
@return the shard