You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: state_store_tests.rs
    path of file: ./repos/risingwave/src/storage/hummock_test/src
    
    the code of the file until where you have to start completion: // Copyright 2024 RisingWave Labs
//
// Licensed 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.

use std::ops::Bound;
use std::sync::Arc;

use bytes::Bytes;
use expect_test::expect;
use futures::{pin_mut, StreamExt, TryStreamExt};
use risingwave_common::buffer::Bitmap;
use risingwave_common::cache::CachePriority;
use risingwave_common::catalog::{TableId, TableOption};
use risingwave_common::hash::VirtualNode;
use risingwave_common::util::epoch::{test_epoch, EpochExt};
use risingwave_hummock_sdk::key::prefixed_range_with_vnode;
use risingwave_hummock_sdk::{HummockReadEpoch, HummockSstableObjectId, LocalSstableInfo};
use risingwave_meta::hummock::test_utils::setup_compute_env;
use risingwave_meta::hummock::MockHummockMetaClient;
use risingwave_rpc_client::HummockMetaClient;
use risingwave_storage::hummock::iterator::test_utils::mock_sstable_store;
use risingwave_storage::hummock::test_utils::{count_stream, default_opts_for_test};
use risingwave_storage::hummock::{CachePolicy, HummockStorage};
use risingwave_storage::storage_value::StorageValue;
use risingwave_storage::store::*;

use crate::get_notification_client_for_test;
use crate::local_state_store_test_utils::LocalStateStoreTestExt;
use crate::test_utils::{
    gen_key_from_str, with_hummock_storage_v2, HummockStateStoreTestTrait, TestIngestBatch,
};

#[tokio::test]
async fn test_empty_read_v2() {
    let (hummock_storage, _meta_client) = with_hummock_storage_v2(Default::default()).await;
    a
    
async fn test_gc_watermark_and_clear_shared_buffer() {
    let (hummock_storage, meta_client) = with_hummock_storage_v2(Default::default()).await;

    assert_eq!(
        hummock_storage
            .sstable_object_id_manager()
            .global_watermark_object_id(),
        HummockSstableObjectId::MAX
    );

    let mut local_hummock_storage = hummock_storage
        .new_local(NewLocalOptions::for_test(Default::default()))
        .await;

    let initial_epoch = hummock_storage.get_pinned_version().max_committed_epoch();
    let epoch1 = initial_epoch.next_epoch();
    local_hummock_storage.init_for_test(epoch1).await.unwrap();
    local_hummock_storage
        .insert(
            gen_key_from_str(VirtualNode::ZERO, "aa"),
            Bytes::from("111"),
            None,
        )
        .unwrap();
    local_hummock_storage
        .insert(
            gen_key_from_str(VirtualNode::ZERO, "bb"),
            Bytes::from("222"),
            None,
        )
        .unwrap();
    local_hummock_storage.flush().await.unwrap();

    assert_eq!(
        hummock_storage
            .sstable_object_id_manager()
            .global_watermark_object_id(),
        HummockSstableObjectId::MAX
    );

    let epoch2 = epoch1.next_epoch();
    local_hummock_storage.seal_current_epoch(epoch2, SealCurrentEpochOptions::for_test());
    local_hummock_storage
        .delete(
            gen_key_from_str(VirtualNode::ZERO, "bb"),
            Bytes::from("222"),
        )
        .unwrap();
    local_hummock_storage.flush().await.unwrap();

    assert_eq!(
        hummock_storage
            .sstable_object_id_manager()
            .global_watermark_object_id(),
        HummockSstableObjectId::MAX
    );
    let min_object_id = |sync_result: &SyncResult| {
        sync_result
            .uncommitted_ssts
            .iter()
            .map(|LocalSstableInfo { sst_info, .. }| sst_info.get_object_id())
            .min()
            .unwrap()
    };
    local_hummock_storage.seal_current_epoch(u64::MAX, SealCurrentEpochOptions::for_test());
    let sync_result1 = hummock_storage.seal_and_sync_epoch(epoch1).await.unwrap();
    let min_object_id_epoch1 = min_object_id(&sync_result1);
    assert_eq!(
        hummock_storage
            .sstable_object_id_manager()
            .global_watermark_object_id(),
        min_object_id_epoch1,
    );
    let sync_result2 = hummock_storage.seal_and_sync_epoch(epoch2).await.unwrap();
    let min_object_id_epoch2 = min_object_id(&sync_result2);
    assert_eq!(
        hummock_storage
            .sstable_object_id_manager()
            .global_watermark_object_id(),
        min_object_id_epoch1,
    );
    meta_client
        .commit_epoch(epoch1, sync_result1.uncommitted_ssts)
        .await
        .unwrap();
    hummock_storage
        .try_wait_epoch(HummockReadEpoch::Committed(epoch1))
        .await
        .unwrap();

    assert_eq!(
        hummock_storage
            .sstable_object_id_manager()
            .global_watermark_object_id(),
        min_object_id_epoch2,
    );

    drop(local_hummock_storage);

    hummock_storage.clear_shared_buffer(epoch1).await;

    assert_eq!(
        hummock_storage
            .sstable_object_id_manager()
            .global_watermark_object_id(),
        HummockSstableObjectId::MAX
    );
}