Skip to content

Commit

Permalink
format code
Browse files Browse the repository at this point in the history
  • Loading branch information
sunxiaojian committed May 17, 2024
1 parent 719fb96 commit d677968
Show file tree
Hide file tree
Showing 18 changed files with 50 additions and 203 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@
import java.util.Comparator;
import java.util.List;

import static org.apache.paimon.utils.BranchManager.DEFAULT_MAIN_BRANCH;

/**
* Base {@link FileStore} implementation.
*
Expand Down Expand Up @@ -175,10 +173,6 @@ public boolean mergeSchema(RowType rowType, boolean allowExplicitCast) {

@Override
public FileStoreCommitImpl newCommit(String commitUser) {
return newCommit(commitUser, DEFAULT_MAIN_BRANCH);
}

public FileStoreCommitImpl newCommit(String commitUser, String branchName) {
return new FileStoreCommitImpl(
fileIO,
schemaManager,
Expand All @@ -196,7 +190,7 @@ public FileStoreCommitImpl newCommit(String commitUser, String branchName) {
options.manifestMergeMinCount(),
partitionType.getFieldCount() > 0 && options.dynamicPartitionOverwrite(),
newKeyComparator(),
branchName,
options.branch(),
newStatsFileHandler());
}

Expand Down
2 changes: 0 additions & 2 deletions paimon-core/src/main/java/org/apache/paimon/FileStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ public interface FileStore<T> extends Serializable {

FileStoreCommit newCommit(String commitUser);

FileStoreCommit newCommit(String commitUser, String branchName);

SnapshotDeletion newSnapshotDeletion();

TagManager newTagManager();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import org.apache.paimon.table.Table;
import org.apache.paimon.table.sink.BatchWriteBuilder;
import org.apache.paimon.table.system.SystemTableLoader;
import org.apache.paimon.utils.BranchManager;
import org.apache.paimon.utils.StringUtils;

import javax.annotation.Nullable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,7 @@ public boolean tryCommitOnce(
boolean committed =
fileIO.writeFileUtf8(newSnapshotPath, newSnapshot.toJson());
if (committed) {
snapshotManager.commitLatestHint(newSnapshotId, branchName);
snapshotManager.commitLatestHint(newSnapshotId);
}
return committed;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,6 @@ public FileStoreCommit newCommit(String commitUser) {
return wrapped.newCommit(commitUser);
}

@Override
public FileStoreCommit newCommit(String commitUser, String branchName) {
privilegeChecker.assertCanInsert(identifier);
return wrapped.newCommit(commitUser, branchName);
}

@Override
public SnapshotDeletion newSnapshotDeletion() {
privilegeChecker.assertCanInsert(identifier);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,6 @@ public SnapshotReader newSnapshotReader() {
return wrapped.newSnapshotReader();
}

@Override
public SnapshotReader newSnapshotReader(String branchName) {
privilegeChecker.assertCanSelect(identifier);
return wrapped.newSnapshotReader(branchName);
}

@Override
public CoreOptions coreOptions() {
return wrapped.coreOptions();
Expand Down Expand Up @@ -270,12 +264,6 @@ public TableCommitImpl newCommit(String commitUser) {
return wrapped.newCommit(commitUser);
}

@Override
public TableCommitImpl newCommit(String commitUser, String branchName) {
privilegeChecker.assertCanInsert(identifier);
return wrapped.newCommit(commitUser, branchName);
}

@Override
public LocalTableQuery newLocalTableQuery() {
privilegeChecker.assertCanSelect(identifier);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,6 @@ public RowKeyExtractor createRowKeyExtractor() {

@Override
public SnapshotReader newSnapshotReader() {
return newSnapshotReader(CoreOptions.branch(options()));
}

@Override
public SnapshotReader newSnapshotReader(String branchName) {
return new SnapshotReaderImpl(
store().newScan(),
tableSchema,
Expand Down Expand Up @@ -308,11 +303,6 @@ public ExpireSnapshots newExpireChangelog() {

@Override
public TableCommitImpl newCommit(String commitUser) {
// Compatibility with previous design, the main branch is written by default
return newCommit(commitUser, CoreOptions.branch(options()));
}

public TableCommitImpl newCommit(String commitUser, String branchName) {
CoreOptions options = coreOptions();
Runnable snapshotExpire = null;
if (!options.writeOnly()) {
Expand Down Expand Up @@ -340,7 +330,7 @@ public TableCommitImpl newCommit(String commitUser, String branchName) {
}

return new TableCommitImpl(
store().newCommit(commitUser, branchName),
store().newCommit(commitUser),
createCommitCallbacks(),
snapshotExpire,
options.writeOnly() ? null : store().newPartitionExpire(commitUser),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ public interface DataTable extends InnerTable {

SnapshotReader newSnapshotReader();

SnapshotReader newSnapshotReader(String branchName);

CoreOptions coreOptions();

SnapshotManager snapshotManager();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@ default Optional<String> comment() {
@Override
TableCommitImpl newCommit(String commitUser);

TableCommitImpl newCommit(String commitUser, String branchName);

LocalTableQuery newLocalTableQuery();

default SimpleStats getSchemaFieldStats(DataFileMeta dataFileMeta) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,6 @@ public SnapshotReader newSnapshotReader() {
return new AuditLogDataReader(dataTable.newSnapshotReader());
}

@Override
public SnapshotReader newSnapshotReader(String branchName) {
return new AuditLogDataReader(dataTable.newSnapshotReader(branchName));
}

@Override
public InnerTableScan newScan() {
return new AuditLogBatchScan(dataTable.newScan());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,6 @@ public SnapshotReader newSnapshotReader() {
return wrapped.newSnapshotReader();
}

@Override
public SnapshotReader newSnapshotReader(String branchName) {
return wrapped.newSnapshotReader(branchName);
}

@Override
public InnerTableScan newScan() {
return wrapped.newScan();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,6 @@ public SnapshotReader newSnapshotReader() {
return wrapped.newSnapshotReader();
}

@Override
public SnapshotReader newSnapshotReader(String branchName) {
return wrapped.newSnapshotReader(branchName);
}

@Override
public InnerTableScan newScan() {
return wrapped.newScan();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,6 @@ public SnapshotReader newSnapshotReader() {
}
}

@Override
public SnapshotReader newSnapshotReader(String branchName) {
return dataTable.newSnapshotReader(branchName);
}

@Override
public InnerTableScan newScan() {
return new InnerTableScanImpl(
Expand Down
Loading

0 comments on commit d677968

Please sign in to comment.