-
Notifications
You must be signed in to change notification settings - Fork 969
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[core] Improve object table for fileIO, Privileged and parent_path (#…
- Loading branch information
1 parent
5f9a8fb
commit 16a4058
Showing
8 changed files
with
252 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
92 changes: 92 additions & 0 deletions
92
paimon-core/src/main/java/org/apache/paimon/privilege/PrivilegedObjectTable.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
/* | ||
* 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.apache.paimon.privilege; | ||
|
||
import org.apache.paimon.catalog.Identifier; | ||
import org.apache.paimon.fs.FileIO; | ||
import org.apache.paimon.schema.TableSchema; | ||
import org.apache.paimon.table.FileStoreTable; | ||
import org.apache.paimon.table.object.ObjectTable; | ||
|
||
import java.util.Map; | ||
|
||
/** A {@link PrivilegedFileStoreTable} for {@link ObjectTable}. */ | ||
public class PrivilegedObjectTable extends PrivilegedFileStoreTable implements ObjectTable { | ||
|
||
private final ObjectTable objectTable; | ||
|
||
protected PrivilegedObjectTable( | ||
ObjectTable wrapped, PrivilegeChecker privilegeChecker, Identifier identifier) { | ||
super(wrapped, privilegeChecker, identifier); | ||
this.objectTable = wrapped; | ||
} | ||
|
||
@Override | ||
public String objectLocation() { | ||
return objectTable.objectLocation(); | ||
} | ||
|
||
@Override | ||
public FileStoreTable underlyingTable() { | ||
return objectTable.underlyingTable(); | ||
} | ||
|
||
@Override | ||
public FileIO objectFileIO() { | ||
return objectTable.objectFileIO(); | ||
} | ||
|
||
@Override | ||
public long refresh() { | ||
privilegeChecker.assertCanInsert(identifier); | ||
return objectTable.refresh(); | ||
} | ||
|
||
// ======================= copy ============================ | ||
|
||
@Override | ||
public PrivilegedObjectTable copy(Map<String, String> dynamicOptions) { | ||
return new PrivilegedObjectTable( | ||
objectTable.copy(dynamicOptions), privilegeChecker, identifier); | ||
} | ||
|
||
@Override | ||
public PrivilegedObjectTable copy(TableSchema newTableSchema) { | ||
return new PrivilegedObjectTable( | ||
objectTable.copy(newTableSchema), privilegeChecker, identifier); | ||
} | ||
|
||
@Override | ||
public PrivilegedObjectTable copyWithoutTimeTravel(Map<String, String> dynamicOptions) { | ||
return new PrivilegedObjectTable( | ||
objectTable.copyWithoutTimeTravel(dynamicOptions), privilegeChecker, identifier); | ||
} | ||
|
||
@Override | ||
public PrivilegedObjectTable copyWithLatestSchema() { | ||
return new PrivilegedObjectTable( | ||
objectTable.copyWithLatestSchema(), privilegeChecker, identifier); | ||
} | ||
|
||
@Override | ||
public PrivilegedObjectTable switchToBranch(String branchName) { | ||
return new PrivilegedObjectTable( | ||
objectTable.switchToBranch(branchName), privilegeChecker, identifier); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.