Skip to content

Commit

Permalink
Use correct naming
Browse files Browse the repository at this point in the history
  • Loading branch information
xgreenx committed Oct 13, 2024
1 parent 4237feb commit 142cd1d
Show file tree
Hide file tree
Showing 14 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion bin/fuel-core/src/cli/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ impl Command {
let config = Config {
graphql_config: GraphQLConfig {
addr,
database_butch_size: graphql.database_butch_size,
database_batch_size: graphql.database_batch_size,
max_queries_depth: graphql.graphql_max_depth,
max_queries_complexity: graphql.graphql_max_complexity,
max_queries_recursive_depth: graphql.graphql_max_recursive_depth,
Expand Down
6 changes: 3 additions & 3 deletions bin/fuel-core/src/cli/run/graphql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ pub struct GraphQLArgs {
#[clap(long = "port", default_value = "4000", env)]
pub port: u16,

/// The size of the butch fetched from the database by GraphQL service.
#[clap(long = "graphql-database-butch-size", default_value = "100", env)]
pub database_butch_size: usize,
/// The size of the batch fetched from the database by GraphQL service.
#[clap(long = "graphql-database-batch-size", default_value = "100", env)]
pub database_batch_size: usize,

/// The max depth of GraphQL queries.
#[clap(long = "graphql-max-depth", default_value = "16", env)]
Expand Down
2 changes: 1 addition & 1 deletion crates/fuel-core/src/graphql_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub mod worker_service;
#[derive(Clone, Debug)]
pub struct ServiceConfig {
pub addr: SocketAddr,
pub database_butch_size: usize,
pub database_batch_size: usize,
pub max_queries_depth: usize,
pub max_queries_complexity: usize,
pub max_queries_recursive_depth: usize,
Expand Down
2 changes: 1 addition & 1 deletion crates/fuel-core/src/graphql_api/api_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ where
{
let network_addr = config.config.addr;
let combined_read_database = ReadDatabase::new(
config.config.database_butch_size,
config.config.database_batch_size,
genesis_block_height,
on_database,
off_database,
Expand Down
16 changes: 8 additions & 8 deletions crates/fuel-core/src/graphql_api/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ pub type OffChainView = Arc<dyn OffChainDatabase>;
/// The container of the on-chain and off-chain database view provides.
/// It is used only by `ViewExtension` to create a [`ReadView`].
pub struct ReadDatabase {
/// The size of the butch during fetching from the database.
butch_size: usize,
/// The size of the batch during fetching from the database.
batch_size: usize,
/// The height of the genesis block.
genesis_height: BlockHeight,
/// The on-chain database view provider.
Expand All @@ -91,7 +91,7 @@ pub struct ReadDatabase {
impl ReadDatabase {
/// Creates a new [`ReadDatabase`] with the given on-chain and off-chain database view providers.
pub fn new<OnChain, OffChain>(
butch_size: usize,
batch_size: usize,
genesis_height: BlockHeight,
on_chain: OnChain,
off_chain: OffChain,
Expand All @@ -103,7 +103,7 @@ impl ReadDatabase {
OffChain::LatestView: OffChainDatabase,
{
Self {
butch_size,
batch_size,
genesis_height,
on_chain: Box::new(ArcWrapper::new(on_chain)),
off_chain: Box::new(ArcWrapper::new(off_chain)),
Expand All @@ -116,7 +116,7 @@ impl ReadDatabase {
// It is not possible to implement until `view_at` is implemented for the `AtomicView`.
// https://github.com/FuelLabs/fuel-core/issues/1582
Ok(ReadView {
butch_size: self.butch_size,
batch_size: self.batch_size,
genesis_height: self.genesis_height,
on_chain: self.on_chain.latest_view()?,
off_chain: self.off_chain.latest_view()?,
Expand All @@ -131,7 +131,7 @@ impl ReadDatabase {

#[derive(Clone)]
pub struct ReadView {
pub(crate) butch_size: usize,
pub(crate) batch_size: usize,
pub(crate) genesis_height: BlockHeight,
pub(crate) on_chain: OnChainView,
pub(crate) off_chain: OffChainView,
Expand Down Expand Up @@ -273,7 +273,7 @@ impl ReadView {
direction: IterDirection,
) -> impl Stream<Item = StorageResult<Message>> + '_ {
futures::stream::iter(self.on_chain.all_messages(start_message_id, direction))
.chunks(self.butch_size)
.chunks(self.batch_size)
.filter_map(|chunk| async move {
// Give a chance to other tasks to run.
tokio::task::yield_now().await;
Expand Down Expand Up @@ -304,7 +304,7 @@ impl ReadView {
start_asset,
direction,
))
.chunks(self.butch_size)
.chunks(self.batch_size)
.filter_map(|chunk| async move {
// Give a chance to other tasks to run.
tokio::task::yield_now().await;
Expand Down
2 changes: 1 addition & 1 deletion crates/fuel-core/src/query/balance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ impl ReadView {
})
.map_ok(|stream| stream.map(Ok))
.try_flatten()
.chunks(self.butch_size)
.chunks(self.batch_size)
.filter_map(|chunk| async move {
// Give a chance to other tasks to run.
tokio::task::yield_now().await;
Expand Down
4 changes: 2 additions & 2 deletions crates/fuel-core/src/query/balance/asset_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ impl<'a> AssetsQuery<'a> {
})
});

futures::stream::StreamExt::chunks(stream, database.butch_size)
futures::stream::StreamExt::chunks(stream, database.batch_size)
.map(|chunk| {
use itertools::Itertools;

Expand Down Expand Up @@ -159,7 +159,7 @@ impl<'a> AssetsQuery<'a> {
})
});

futures::stream::StreamExt::chunks(stream, database.butch_size)
futures::stream::StreamExt::chunks(stream, database.batch_size)
.map(|chunk| {
use itertools::Itertools;

Expand Down
2 changes: 1 addition & 1 deletion crates/fuel-core/src/query/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ impl ReadView {
direction: IterDirection,
) -> impl Stream<Item = StorageResult<CompressedBlock>> + '_ {
futures::stream::iter(self.blocks(height, direction))
.chunks(self.butch_size)
.chunks(self.batch_size)
.filter_map(|chunk| async move {
// Give a chance to other tasks to run.
tokio::task::yield_now().await;
Expand Down
2 changes: 1 addition & 1 deletion crates/fuel-core/src/query/coin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ impl ReadView {
direction: IterDirection,
) -> impl Stream<Item = StorageResult<Coin>> + '_ {
self.owned_coins_ids(owner, start_coin, direction)
.chunks(self.butch_size)
.chunks(self.batch_size)
.map(|chunk| {
use itertools::Itertools;

Expand Down
2 changes: 1 addition & 1 deletion crates/fuel-core/src/query/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ impl ReadView {
direction: IterDirection,
) -> impl Stream<Item = StorageResult<Message>> + 'a {
self.owned_message_ids(owner, start_message_id, direction)
.chunks(self.butch_size)
.chunks(self.batch_size)
.map(|chunk| {
let chunk = chunk.into_iter().try_collect::<_, Vec<_>, _>()?;
Ok(chunk)
Expand Down
2 changes: 1 addition & 1 deletion crates/fuel-core/src/query/tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ impl ReadView {
direction: IterDirection,
) -> impl Stream<Item = StorageResult<(TxPointer, Transaction)>> + '_ {
self.owned_transactions_ids(owner, start, direction)
.chunks(self.butch_size)
.chunks(self.batch_size)
.map(|chunk| {
use itertools::Itertools;

Expand Down
2 changes: 1 addition & 1 deletion crates/fuel-core/src/schema/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ impl Block {
let tx_ids = futures::stream::iter(self.0.transactions().iter().copied());

let result = tx_ids
.chunks(query.butch_size)
.chunks(query.batch_size)
.filter_map(move |tx_ids: Vec<TxId>| {
let async_query = query.as_ref().clone();
async move {
Expand Down
2 changes: 1 addition & 1 deletion crates/fuel-core/src/schema/tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ impl TxQuery {

async move { Ok(skip) }
})
.chunks(query_ref.butch_size)
.chunks(query_ref.batch_size)
.filter_map(move |chunk: Vec<StorageResult<SortedTxCursor>>| {
let async_query = query_ref.clone();
async move {
Expand Down
2 changes: 1 addition & 1 deletion crates/fuel-core/src/service/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ impl Config {
std::net::Ipv4Addr::new(127, 0, 0, 1).into(),
0,
),
database_butch_size: 100,
database_batch_size: 100,
max_queries_depth: 16,
max_queries_complexity: 80000,
max_queries_recursive_depth: 16,
Expand Down

0 comments on commit 142cd1d

Please sign in to comment.