Skip to content

Commit

Permalink
fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
yuzelin committed Nov 21, 2024
1 parent e2460b2 commit bd421ad
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ private Plan nextPlan() {

// first try to get overwrite changes
if (snapshot.commitKind() == Snapshot.CommitKind.OVERWRITE) {
SnapshotReader.Plan overwritePlan = tryGetOverwirtePlan(snapshot);
SnapshotReader.Plan overwritePlan = handleOverwriteSnapshot(snapshot);
if (overwritePlan != null) {
nextSnapshotId++;
return overwritePlan;
Expand Down Expand Up @@ -229,7 +229,7 @@ private boolean shouldDelaySnapshot(long snapshotId) {
}

@Nullable
protected SnapshotReader.Plan tryGetOverwirtePlan(Snapshot snapshot) {
protected SnapshotReader.Plan handleOverwriteSnapshot(Snapshot snapshot) {
if (supportStreamingReadOverwrite) {
LOG.debug("Find overwrite snapshot id {}.", nextSnapshotId);
SnapshotReader.Plan overwritePlan =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import org.apache.paimon.predicate.Predicate;
import org.apache.paimon.table.FileStoreTable;
import org.apache.paimon.table.Table;
import org.apache.paimon.table.source.DimScanOverwriteException;
import org.apache.paimon.table.source.OutOfRangeException;
import org.apache.paimon.types.RowType;
import org.apache.paimon.utils.FileIOUtils;
Expand Down Expand Up @@ -250,7 +249,7 @@ public Collection<RowData> lookup(RowData keyRow) {
rows.add(new FlinkRowData(matchedRow));
}
return rows;
} catch (OutOfRangeException | DimScanOverwriteException e) {
} catch (OutOfRangeException | ReopenException e) {
reopen();
return lookup(keyRow);
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import org.apache.paimon.Snapshot;
import org.apache.paimon.operation.DefaultValueAssigner;
import org.apache.paimon.table.source.DataTableStreamScan;
import org.apache.paimon.table.source.DimScanOverwriteException;
import org.apache.paimon.table.source.snapshot.AllDeltaFollowUpScanner;
import org.apache.paimon.table.source.snapshot.BoundedChecker;
import org.apache.paimon.table.source.snapshot.FollowUpScanner;
Expand Down Expand Up @@ -64,12 +63,12 @@ public LookupDataTableScan(

@Override
@Nullable
protected SnapshotReader.Plan tryGetOverwirtePlan(Snapshot snapshot) {
SnapshotReader.Plan plan = super.tryGetOverwirtePlan(snapshot);
protected SnapshotReader.Plan handleOverwriteSnapshot(Snapshot snapshot) {
SnapshotReader.Plan plan = super.handleOverwriteSnapshot(snapshot);
if (plan != null) {
return plan;
}
throw new DimScanOverwriteException();
throw new ReopenException();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
* limitations under the License.
*/

package org.apache.paimon.table.source;
package org.apache.paimon.flink.lookup;

/** Signals that dim table source scans an OVERWRITE snapshot. */
public class DimScanOverwriteException extends RuntimeException {
/** Signals that dim table source need to reopen. */
public class ReopenException extends RuntimeException {

private static final long serialVersionUID = 1L;

public DimScanOverwriteException() {
public ReopenException() {
super();
}
}

0 comments on commit bd421ad

Please sign in to comment.