Skip to content

Commit

Permalink
[fix] Fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
tsreaper committed Sep 23, 2024
1 parent efdd226 commit 5694e63
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ public List<CommitMessage> prepareCommit(boolean waitCompaction, long commitIden
result.add(committable);

if (committable.isEmpty()) {

if (writerCleanChecker.apply(writerContainer)) {
// Clear writer if no update, and if its latest modification has committed.
//
Expand Down Expand Up @@ -246,6 +245,10 @@ public List<CommitMessage> prepareCommit(boolean waitCompaction, long commitIden
return result;
}

// This abstract function returns a whole function (instead of just a boolean value),
// because we do not want to introduce `commitUser` into this base class.
//
// For writers with no conflicts, `commitUser` might be some random value.
protected abstract Function<WriterContainer<T>, Boolean> createWriterCleanChecker();

protected static <T>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ protected abstract CompactManager getCompactManager(
int bucket,
List<DataFileMeta> restoredFiles,
ExecutorService compactExecutor,
@javax.annotation.Nullable DeletionVectorsMaintainer dvMaintainer);
@Nullable DeletionVectorsMaintainer dvMaintainer);

public List<DataFileMeta> compactRewrite(
BinaryRow partition,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ protected CompactManager getCompactManager(
int bucket,
List<DataFileMeta> restoredFiles,
ExecutorService compactExecutor,
@javax.annotation.Nullable DeletionVectorsMaintainer dvMaintainer) {
@Nullable DeletionVectorsMaintainer dvMaintainer) {
if (options.writeOnly()) {
return new NoopCompactManager();
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

import javax.annotation.Nullable;

import java.util.Collections;
import java.util.List;

/**
Expand All @@ -42,11 +41,13 @@ public StateValueFilter stateValueFilter() {

@Override
public @Nullable List<StateValue> get(String tableName, String key) {
return Collections.emptyList();
throw new UnsupportedOperationException();
}

@Override
public void put(String tableName, String key, List<StateValue> stateValues) {}
public void put(String tableName, String key, List<StateValue> stateValues) {
throw new UnsupportedOperationException();
}

@Override
public void snapshotState() throws Exception {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public abstract class TableWriteOperator<IN> extends PrepareCommitOperator<IN, C
private final StoreSinkWrite.Provider storeSinkWriteProvider;
private final String initialCommitUser;

protected transient StoreSinkWriteState state;
private transient StoreSinkWriteState state;
protected transient StoreSinkWrite write;

public TableWriteOperator(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@

package org.apache.paimon.flink;

import org.apache.flink.runtime.state.FunctionInitializationContext;
import org.apache.flink.runtime.state.FunctionSnapshotContext;
import org.apache.flink.streaming.api.checkpoint.CheckpointedFunction;
import org.apache.paimon.Snapshot;
import org.apache.paimon.data.InternalRow;
import org.apache.paimon.fs.Path;
Expand Down

0 comments on commit 5694e63

Please sign in to comment.