Add BigTableUploadService

This commit is contained in:
Michael Vines
2020-09-03 19:39:05 -07:00
committed by mergify[bot]
parent 82d9624736
commit e3753186af
5 changed files with 116 additions and 12 deletions

View File

@@ -53,6 +53,7 @@ tar = "0.4.28"
thiserror = "1.0"
tempfile = "3.1.0"
lazy_static = "1.4.0"
tokio = { version = "0.2.22", features = ["full"] }
trees = "0.2.1"
[dependencies.rocksdb]

View File

@@ -20,7 +20,7 @@ pub async fn upload_confirmed_blocks(
) -> Result<(), Box<dyn std::error::Error>> {
let mut measure = Measure::start("entire upload");
info!("Loading ledger slots...");
info!("Loading ledger slots starting at {}...", starting_slot);
let blockstore_slots: Vec<_> = blockstore
.slot_meta_iterator(starting_slot)
.map_err(|err| {
@@ -40,8 +40,11 @@ pub async fn upload_confirmed_blocks(
.collect();
if blockstore_slots.is_empty() {
info!("Ledger has no slots in the specified range");
return Ok(());
return Err(format!(
"Ledger has no slots from {} to {:?}",
starting_slot, ending_slot
)
.into());
}
info!(
@@ -136,7 +139,7 @@ pub async fn upload_confirmed_blocks(
}
};
if i % NUM_BLOCKS_TO_UPLOAD_IN_PARALLEL == 0 {
if i > 0 && i % NUM_BLOCKS_TO_UPLOAD_IN_PARALLEL == 0 {
info!(
"{}% of blocks processed ({}/{})",
i * 100 / blocks_to_upload.len(),