[][src]Struct stellr::ZkSolrClient

pub struct ZkSolrClient { /* fields omitted */ }

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]

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]

impl PartialEq<ZkSolrClient> for ZkSolrClient[src]

impl SolrCloudMethods for ZkSolrClient[src]

impl SolrCoreMethods for ZkSolrClient[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WithSubscriber for T[src]