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: jni_catalog.rs
    path of file: ./repos/risingwave/src/connector/src/sink/iceberg
    
    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.

//! This module provide jni catalog.

use std::collections::HashMap;
use std::sync::Arc;

use anyhow::Context;
use async_trait::async_trait;
use icelake::catalog::models::{CommitTableRequest, CommitTableResponse, LoadTableResult};
use icelake::catalog::{
    BaseCatalogConfig, Catalog, CatalogRef, IcebergTableIoArgs, OperatorCreator, UpdateTable,
};
use icelake::{ErrorKind, Table, TableIdentifier};
use jni::objects::{GlobalRef, JObject};
use jni::JavaVM;
use risingwave_jni_core::call_method;
use risingwave_jni
    
    async fn load_table(self: Arc<Self>, table_name: &TableIdentifier) -> icelake::Result<Table> {
        execute_with_jni_env(self.jvm, |env| {
            let table_name_str = table_name.to_string();

            let table_name_jstr = env.new_string(&table_name_str).unwrap();

            let result_json =
                call_method!(env, self.java_catalog.as_obj(), {String loadTable(String)},
                &table_name_jstr)
                .with_context(|| format!("Failed to load iceberg table: {table_name_str}"))?;

            let rust_json_str = jobj_to_str(env, result_json)?;

            let resp: LoadTableResult = serde_json::from_str(&rust_json_str)?;

            let metadata_location = resp.metadata_location.clone().ok_or_else(|| {
                icelake::Error::new(
                    ErrorKind::IcebergFeatureUnsupported,
                    "Loading uncommitted table is not supported!",
                )
            })?;

            tracing::info!("Table metadata location of {table_name} is {metadata_location}");

            let table_metadata = resp.table_metadata()?;

            let iceberg_io_args = IcebergTableIoArgs::builder_from_path(&table_metadata.location)?
                .with_args(self.config.table_io_configs.iter())
                .build()?;
            let table_op = iceberg_io_args.create()?;

            Ok(Table::builder_from_catalog(
                table_op,
                self.clone(),
                table_metadata,
                table_name.clone(),
            )
            .build()?)
        })
        .map_err(|e| {
            icelake::Error::new(ErrorKind::Unexpected, "Failed to load iceberg table.")
                .set_source(e)
        })
    }