Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asautins/samza 2783 create are same file earlier #1683

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
import java.util.concurrent.CompletionStage;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.function.BiPredicate;

import org.apache.commons.lang3.tuple.Pair;
import org.apache.samza.SamzaException;
import org.apache.samza.checkpoint.Checkpoint;
Expand All @@ -51,6 +53,7 @@
import org.apache.samza.storage.TaskBackupManager;
import org.apache.samza.storage.blobstore.diff.DirDiff;
import org.apache.samza.storage.blobstore.index.DirIndex;
import org.apache.samza.storage.blobstore.index.FileIndex;
import org.apache.samza.storage.blobstore.index.SnapshotIndex;
import org.apache.samza.storage.blobstore.index.SnapshotMetadata;
import org.apache.samza.storage.blobstore.metrics.BlobStoreBackupManagerMetrics;
Expand Down Expand Up @@ -174,7 +177,7 @@ public CompletableFuture<Map<String, String>> upload(CheckpointId checkpointId,
storeToSCMAndSnapshotIndexPairFutures = new HashMap<>();
// This map is used to return serialized State Checkpoint Markers to the caller
Map<String, CompletableFuture<String>> storeToSerializedSCMFuture = new HashMap<>();

BiPredicate<File, FileIndex> areSameFile = DirDiffUtil.areSameFile(false);
storesToBackup.forEach((storeName) -> {
long storeUploadStartTime = System.nanoTime();
try {
Expand Down Expand Up @@ -207,7 +210,7 @@ public CompletableFuture<Map<String, String>> upload(CheckpointId checkpointId,

long dirDiffStartTime = System.nanoTime();
// get the diff between previous and current store directories
DirDiff dirDiff = DirDiffUtil.getDirDiff(checkpointDir, prevDirIndex, DirDiffUtil.areSameFile(false));
DirDiff dirDiff = DirDiffUtil.getDirDiff(checkpointDir, prevDirIndex, areSameFile);
metrics.storeDirDiffNs.get(storeName).update(System.nanoTime() - dirDiffStartTime);

DirDiff.Stats stats = DirDiff.getStats(dirDiff);
Expand Down