Skip to content
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

fix: typos #20

Merged
merged 1 commit into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ZooKeeper client writes in async rust.
## Features
* No callbacks.
* No catch-all watcher.
* `StateWatcher` trackes session state updates.
* `StateWatcher` tracks session state updates.
* `OneshotWatcher` tracks oneshot ZooKeeper node event.
* `PersistentWatcher` tracks persistent and recursive persistent ZooKeeper node events.
* No event type `XyzWatchRemoved` as there is no way to receive such event after watchers dropped.
Expand Down
6 changes: 3 additions & 3 deletions src/acl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,18 +209,18 @@ impl<'a> Acls<'a> {
Self { inner: AclsInner::Acls { acls } }
}

/// Returns acls that expresse anyone can have full permissions over nodes created by this
/// Returns acls that expresses anyone can have full permissions over nodes created by this
/// session.
pub const fn anyone_all() -> Acls<'static> {
Acls { inner: AclsInner::AnyoneAll }
}

/// Returns acls that expresse anyone can read nodes created by this session.
/// Returns acls that expresses anyone can read nodes created by this session.
pub const fn anyone_read() -> Acls<'static> {
Acls { inner: AclsInner::AnyoneRead }
}

/// Returns acls that expresse anyone who has same auth as creator can have full permisssions
/// Returns acls that expresses anyone who has same auth as creator can have full permissions
/// over nodes created by this session.
pub const fn creator_all() -> Acls<'static> {
Acls { inner: AclsInner::CreatorAll }
Expand Down
14 changes: 7 additions & 7 deletions src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ pub struct CreateOptions<'a> {
ttl: Option<Duration>,
}

// Five bytes are avaiable for milliseconds. See javadoc of EphemeralType in ZooKeeper for reference.
// Five bytes are available for milliseconds. See javadoc of EphemeralType in ZooKeeper for reference.
//
// https://github.com/apache/zookeeper/blob/ebcf18e52fa095773429348ce495d59c896f4a26/zookeeper-server/src/main/java/org/apache/zookeeper/server/EphemeralType.java#L46
const TTL_MAX_MILLIS: u128 = 0x00FFFFFFFFFF;
Expand Down Expand Up @@ -849,7 +849,7 @@ impl Client {
/// * Holds returned watcher without polling events may result in memory burst.
/// * At the time of written, ZooKeeper [ZOOKEEPER-4466][] does not support oneshot and
/// persistent watch on same path.
/// * Persistent watch could loss events during reconnection due to [ZOOKEEPER-4698][].
/// * Persistent watch could lose events during reconnection due to [ZOOKEEPER-4698][].
///
/// [ZOOKEEPER-4466]: https://issues.apache.org/jira/browse/ZOOKEEPER-4466
/// [ZOOKEEPER-4698]: https://issues.apache.org/jira/browse/ZOOKEEPER-4698
Expand Down Expand Up @@ -898,7 +898,7 @@ impl Client {
})
}

/// Authenticates session using given scheme and auth identication. This affects only
/// Authenticates session using given scheme and auth identification. This affects only
/// subsequent operations.
///
/// # Errors
Expand All @@ -907,7 +907,7 @@ impl Client {
///
/// # Notable behaviors
/// * Same auth will be resubmitted for authentication after session reestablished.
/// * This method is resistent to temporary session unavailability, that means
/// * This method is resistant to temporary session unavailability, that means
/// [SessionState::Disconnected] will not end authentication.
/// * It is ok to ignore resulting future of this method as request is sending synchronously
/// and auth failure will fail ZooKeeper session with [SessionState::AuthFailed].
Expand Down Expand Up @@ -1122,7 +1122,7 @@ impl Client {
///
/// # Asynchronous ordering
/// Comparing to other data operations, e.g. [Client::create], this operation is pure
/// asynchronous, so there is no data order guaranttee.
/// asynchronous, so there is no data order guarantee.
///
/// # Error handling on [Error::ConnectionLoss]
/// * If connection loss during lock path creation, this method will find out the created lock
Expand Down Expand Up @@ -1219,7 +1219,7 @@ enum LockPrefixInner<'a> {
Shared { prefix: &'a str },
}

// It is intentional for this to not `Clone` as it is non sense for [LockPrefix::new_custom], and I
// It is intentional for this to not `Clone` as it is nonsense for [LockPrefix::new_custom], and I
// don't want to complicate this anymore, e.g. `LockPatternPrefix` and `LockCustomPrefix`. The side
// effect is that it is not easy to share `LockPrefix`. But, let the caller/tester to bore about that.
//
Expand Down Expand Up @@ -1731,7 +1731,7 @@ impl<'a> MultiReader<'a> {
/// Commits multiple operations in one request to reach consistent read.
///
/// # Notable behaviors
/// Individual errors(eg. [Error::NoNode]) are reported individually through [MultiReadResult::Error].
/// Individual errors(e.g. [Error::NoNode]) are reported individually through [MultiReadResult::Error].
pub fn commit(&mut self) -> impl Future<Output = Result<Vec<MultiReadResult>>> + Send + 'a {
let request = self.build_request();
Client::resolve(self.commit_internally(request))
Expand Down
4 changes: 2 additions & 2 deletions src/client/watcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ impl StateWatcher {
/// This method will block indefinitely after one of terminal states consumed.
pub async fn changed(&mut self) -> SessionState {
if self.receiver.changed().await.is_err() {
// Terminal state must be deliveried.
// Terminal state must be delivered.
std::future::pending().await
}
self.state()
Expand Down Expand Up @@ -106,7 +106,7 @@ impl PersistentWatcher {
/// Removes this watcher.
///
/// # Cautions
/// It is a best effect as ZooKeper ([ZOOKEEPER-4472][]) does not support persistent watch
/// It is a best effect as ZooKeeper ([ZOOKEEPER-4472][]) does not support persistent watch
/// removing individually.
///
/// [ZOOKEEPER-4472]: https://issues.apache.org/jira/browse/ZOOKEEPER-4472
Expand Down
2 changes: 1 addition & 1 deletion src/proto/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub enum PredefinedXid {
Ping = -2,

/// Fortunately, ZooKeeper server [use xid from header](auth-xid) to reply auth request, so we can have
/// multiple auth requets in network.
/// multiple auth requests in network.
///
/// auth-xid: https://github.com/apache/zookeeper/blob/de7c5869d372e46af43979134d0e30b49d2319b1/zookeeper-server/src/main/java/org/apache/zookeeper/server/ZooKeeperServer.java#L1621
Auth = -4,
Expand Down
2 changes: 1 addition & 1 deletion src/session/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ impl Session {
Err(Error::ConnectionLoss)
},
Ok(sock) => {
log::debug!("ZooKeeper succeeds in connectiong to {}:{}", addr.0, addr.1);
log::debug!("ZooKeeper succeeds in connecting to {}:{}", addr.0, addr.1);
Ok((sock, addr))
},
}
Expand Down
2 changes: 1 addition & 1 deletion src/session/watch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ impl WatchManager {
}
}
if !has_watch {
// Probably a dangling peristent watcher.
// Probably a dangling persistent watcher.
depot.push_remove_watch(event.path, WatchMode::Any, StateResponser::none());
}
}
Expand Down
Loading