-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Feature/simplify iconnection #547
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
Conversation
…on a different branch)
…d signatures not reflected in the faked objectS
- No longer pass *QueryString to calls but *RequestParameters, more generic makes sense to also pass request specific settings as such timeout
|
@Mpdreamz while at it, maybe standardize the Ok / IsValid / etc response codes? I'd throw an ElasticClientException if encountered an error, and obviously document that so consumers know they should watch for it, instead of doing TryConnect and then requiring to check a property for request / connection status. Following that guideline, I'd also prefer to throw in case of errors instead of keeping the error in a property (old C-style dev) |
…tate objects, can now control request specific parameters beyond just querystring
…d super'ed connection overrides into IRequestConnectionConfiguration
|
Elasticsearch prior to 1.0 had several different response codes (ok, acknowledged) etcetera, these have been standardized and the master of NEST has also removed all the The I personally much prefer to not throw on http status codes other then 200-300 and possibly 404. The clients can be configured to always throw though: http://nest.azurewebsites.net/elasticsearch-net/errors.html Although an easier way to do it i.e |
|
The later commits also removed A single call can now override global settings i.e |
…it no matter what the iconnectionpool will say
…d different default return type, fixes failing _cat yaml tests
…tched test projects back to 4.0 because that is what the build uses and is a buggier (Uri wise) .net version
This is still a work in progress but resembles a second refactor pass on
IConnectionafter @icanhasjonas excellent feedback on #537 and earlier by @synhershko on #522IConnectionnow only returnsElasticsearchResponse<Stream>IConnectionno longer in charged of deserialization, this is pushed back toTransportwhich is the coordinator betweenIConnectionPoolandIConnectionand already did the serialization.<T>no longer leaks throughout all the components involved just to be able to deserialize in the deepest call in the stack.IConnectionno longer in charge of shortcircuiting for<string><byte[]>or ignoring the stream completely for<VoidResponse>. A connection is now only in charge of returning a response stream and settings connection status data on theElasticsearchResponse<Stream>, it should not know more of the internals.client.Call<Stream>()and do as you please with it, you're on your own (but please Dispose() it!)Streamreturn type Elasticsearch.Net still takes ownership of the Stream and disposes it properly.ElasticsearchResponse<T>had an.Errorproperty that hold some information and caught some exceptions. This is gone now. If a request succeeds to the point where we have a status code Elasticsearch.net will never throw.It will still expose the original exception (ie WebException) on.OriginalExceptionany other exception will be rethrown (possibly caught again when an IConnectionPool is in place which will rethrow in a wrapped MaxRetryException when all nodes are tried).Still todo:
Ping()andSniff()fromIConnectionElasticsearchResponse<T>can now also return very interesting metric data (start time, time to first byte, time to last byte, (de)serialization time), will wait to explore that post alpha release.