alamb commented on code in PR #4918: URL: https://github.com/apache/arrow-rs/pull/4918#discussion_r1362816581
########## object_store/src/aws/dynamo.rs: ########## @@ -0,0 +1,333 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +//! A DynamoDB based lock system + +use crate::aws::client::S3Client; +use crate::aws::credential::CredentialExt; +use crate::client::get::GetClientExt; +use crate::client::retry::Error as RetryError; +use crate::client::retry::RetryExt; +use crate::path::Path; +use crate::{Error, Result}; +use chrono::Utc; +use reqwest::StatusCode; +use serde::ser::SerializeMap; +use serde::{Deserialize, Serialize, Serializer}; +use std::collections::HashMap; +use std::time::{Duration, Instant}; + +/// The timeout for a lease operation +const LEASE_TIMEOUT: Duration = Duration::from_secs(20); + +/// The length of time a lease is valid for +/// +/// This should be a multiple of [`LEASE_TIMEOUT`] where the multiple determines the maximum +/// clock skew rate tolerated by the system +const LEASE_EXPIRY: Duration = Duration::from_secs(60); + +/// The TTL offset to encode in DynamoDB +/// +/// This should be significantly larger than [`LEASE_EXPIRY`] to allow for clock skew +const LEASE_TTL: Duration = Duration::from_secs(60 * 60); Review Comment: Thank you for the clarification -- perhaps this could be encoded in comments. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
