@ThreadSafe public class SchemaManager extends Object implements Serializable
Constructor and Description |
---|
SchemaManager(FileIO fileIO,
Path tableRoot) |
SchemaManager(FileIO fileIO,
Path tableRoot,
String branch)
Specify the default branch for data writing.
|
Modifier and Type | Method and Description |
---|---|
void |
applyMove(List<DataField> newFields,
SchemaChange.Move move) |
static void |
checkAlterTableOption(String key,
String oldValue,
String newValue,
boolean fromDynamicOptions) |
static void |
checkAlterTablePath(String key) |
static void |
checkResetTableOption(String key) |
TableSchema |
commitChanges(List<SchemaChange> changes)
Update
SchemaChange s. |
TableSchema |
commitChanges(SchemaChange... changes)
Update
SchemaChange s. |
SchemaManager |
copyWithBranch(String branchName) |
TableSchema |
createTable(Schema schema) |
TableSchema |
createTable(Schema schema,
boolean ignoreIfExistsSame) |
void |
deleteSchema(long schemaId)
Delete schema with specific id.
|
static TableSchema |
fromPath(FileIO fileIO,
Path path) |
static Identifier |
identifierFromPath(String tablePath,
boolean ignoreIfUnknownDatabase) |
static Identifier |
identifierFromPath(String tablePath,
boolean ignoreIfUnknownDatabase,
String branchName) |
Optional<TableSchema> |
latest() |
List<TableSchema> |
listAll() |
List<Long> |
listAllIds()
List all schema IDs.
|
List<TableSchema> |
listWithRange(Optional<Long> optionalMaxSchemaId,
Optional<Long> optionalMinSchemaId) |
boolean |
mergeSchema(RowType rowType,
boolean allowExplicitCast) |
TableSchema |
schema(long id)
Read schema for schema id.
|
Path |
schemaDirectory() |
boolean |
schemaExists(long id)
Check if a schema exists.
|
Path |
toSchemaPath(long schemaId) |
SchemaManager |
withLock(Lock lock) |
public SchemaManager copyWithBranch(String branchName)
public SchemaManager withLock(@Nullable Lock lock)
public Optional<TableSchema> latest()
public List<TableSchema> listAll()
public List<TableSchema> listWithRange(Optional<Long> optionalMaxSchemaId, Optional<Long> optionalMinSchemaId)
public TableSchema createTable(Schema schema) throws Exception
Exception
public TableSchema createTable(Schema schema, boolean ignoreIfExistsSame) throws Exception
Exception
public TableSchema commitChanges(SchemaChange... changes) throws Exception
SchemaChange
s.Exception
public TableSchema commitChanges(List<SchemaChange> changes) throws Catalog.TableNotExistException, Catalog.ColumnAlreadyExistException, Catalog.ColumnNotExistException
SchemaChange
s.public void applyMove(List<DataField> newFields, SchemaChange.Move move)
public boolean mergeSchema(RowType rowType, boolean allowExplicitCast)
public TableSchema schema(long id)
public boolean schemaExists(long id)
public static TableSchema fromPath(FileIO fileIO, Path path)
public Path schemaDirectory()
@VisibleForTesting public Path toSchemaPath(long schemaId)
public void deleteSchema(long schemaId)
schemaId
- the schema id to delete.public static void checkAlterTableOption(String key, @Nullable String oldValue, String newValue, boolean fromDynamicOptions)
public static void checkResetTableOption(String key)
public static void checkAlterTablePath(String key)
public static Identifier identifierFromPath(String tablePath, boolean ignoreIfUnknownDatabase)
public static Identifier identifierFromPath(String tablePath, boolean ignoreIfUnknownDatabase, @Nullable String branchName)
Copyright © 2023–2024 The Apache Software Foundation. All rights reserved.