![JAR search and dependency download from the Maven repository](/logo.png)
org.dinky.shaded.paimon.table.system.SystemTableLoader Maven / Gradle / Ivy
The newest version!
/*
* 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.
*/
package org.dinky.shaded.paimon.table.system;
import org.dinky.shaded.paimon.fs.FileIO;
import org.dinky.shaded.paimon.fs.Path;
import org.dinky.shaded.paimon.lineage.LineageMetaFactory;
import org.dinky.shaded.paimon.options.Options;
import org.dinky.shaded.paimon.table.FileStoreTable;
import org.dinky.shaded.paimon.table.Table;
import javax.annotation.Nullable;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.function.Supplier;
import static org.dinky.shaded.paimon.options.CatalogOptions.LINEAGE_META;
import static org.dinky.shaded.paimon.table.system.AllTableOptionsTable.ALL_TABLE_OPTIONS;
import static org.dinky.shaded.paimon.table.system.AuditLogTable.AUDIT_LOG;
import static org.dinky.shaded.paimon.table.system.CatalogOptionsTable.CATALOG_OPTIONS;
import static org.dinky.shaded.paimon.table.system.ConsumersTable.CONSUMERS;
import static org.dinky.shaded.paimon.table.system.FilesTable.FILES;
import static org.dinky.shaded.paimon.table.system.ManifestsTable.MANIFESTS;
import static org.dinky.shaded.paimon.table.system.OptionsTable.OPTIONS;
import static org.dinky.shaded.paimon.table.system.PartitionsTable.PARTITIONS;
import static org.dinky.shaded.paimon.table.system.ReadOptimizedTable.READ_OPTIMIZED;
import static org.dinky.shaded.paimon.table.system.SchemasTable.SCHEMAS;
import static org.dinky.shaded.paimon.table.system.SinkTableLineageTable.SINK_TABLE_LINEAGE;
import static org.dinky.shaded.paimon.table.system.SnapshotsTable.SNAPSHOTS;
import static org.dinky.shaded.paimon.table.system.SourceTableLineageTable.SOURCE_TABLE_LINEAGE;
import static org.dinky.shaded.paimon.table.system.TagsTable.TAGS;
import static org.dinky.shaded.paimon.utils.Preconditions.checkNotNull;
/** Loader to load system {@link Table}s. */
public class SystemTableLoader {
@Nullable
public static Table load(String type, FileIO fileIO, FileStoreTable dataTable) {
Path location = dataTable.location();
switch (type.toLowerCase()) {
case MANIFESTS:
return new ManifestsTable(fileIO, location, dataTable);
case SNAPSHOTS:
return new SnapshotsTable(fileIO, location, dataTable);
case OPTIONS:
return new OptionsTable(fileIO, location);
case SCHEMAS:
return new SchemasTable(fileIO, location);
case PARTITIONS:
return new PartitionsTable(dataTable);
case AUDIT_LOG:
return new AuditLogTable(dataTable);
case FILES:
return new FilesTable(dataTable);
case TAGS:
return new TagsTable(fileIO, location);
case CONSUMERS:
return new ConsumersTable(fileIO, location);
case READ_OPTIMIZED:
return new ReadOptimizedTable(dataTable);
default:
return null;
}
}
@Nullable
public static Table loadGlobal(
String tableName,
FileIO fileIO,
Supplier
© 2015 - 2025 Weber Informatics LLC | Privacy Policy