[−][src]Struct stellr::ZkSolrClient
Access a solr node using live_node information store in a Zookeeper ensemble.
Live nodes are picked at random from the children of /<zk_chroot>/live_nodes, and rechosen on each new request.
This takes zookeeper details as the arguments to new()
use stellr::prelude::*; use stellr::ZkSolrClient; let my_client = ZkSolrClient::new("localhost:9983", "/")?; assert_eq!(my_client.live_node_url().unwrap(), "http://192.168.1.2:8983/solr");
Please see the SolrCoreMethods and SolrCloudMethods Traits for details on how to use these clients.
Also note that the zookeeper connection is stored within an Arc, so clone()'ed instances will share zookeeper connection instances, whereas new() will create new ZK clients each time.
Implementations
impl ZkSolrClient
[src]
pub fn new(zk_quorum: &str, zk_chroot: &str) -> SolrResult<ZkSolrClient>
[src]
Build a zookeeper based connection from zookeeper ensemble and chroot infomration
pub fn live_nodes(&self) -> ZkResult<Vec<String>>
[src]
Extract the list of all current live nodes from zookeeper
pub fn pick_one_live_node(&self) -> SolrResult<String>
[src]
Extract the details of just one node from live_nodes
pub fn reset_zookeeper(&self) -> ZkResult<()>
[src]
A basic method to reset dead zookeeper connections
Trait Implementations
impl Clone for ZkSolrClient
[src]
pub fn clone(&self) -> ZkSolrClient
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for ZkSolrClient
[src]
impl Default for ZkSolrClient
[src]
impl Display for ZkSolrClient
[src]
impl Eq for ZkSolrClient
[src]
impl Hash for ZkSolrClient
[src]
pub fn hash<H: Hasher>(&self, state: &mut H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<ZkSolrClient> for ZkSolrClient
[src]
pub fn eq(&self, other: &Self) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl SolrCloudMethods for ZkSolrClient
[src]
pub fn select(&self, collection: &str) -> SolrResult<RequestBuilder>
[src]
pub fn update(&self, collection: &str) -> SolrResult<RequestBuilder>
[src]
impl SolrCoreMethods for ZkSolrClient
[src]
pub fn live_node_url(&self) -> SolrResult<String>
[src]
pub fn request_config(&self) -> &SolrClientConfig
[src]
pub fn set_request_config(&mut self, request_config: SolrClientConfig)
[src]
pub fn build_request_url(&self, path: &str) -> SolrResult<String>
[src]
pub fn build_client(&self) -> SolrResult<Client>
[src]
pub fn create_get_request(&self, path: &str) -> SolrResult<RequestBuilder>
[src]
pub fn create_post_request(&self, path: &str) -> SolrResult<RequestBuilder>
[src]
Auto Trait Implementations
impl RefUnwindSafe for ZkSolrClient
[src]
impl Send for ZkSolrClient
[src]
impl Sync for ZkSolrClient
[src]
impl Unpin for ZkSolrClient
[src]
impl UnwindSafe for ZkSolrClient
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
pub fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,
pub fn vzip(self) -> V
impl<T> WithSubscriber for T
[src]
pub fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
[src]
S: Into<Dispatch>,