Skip to content

Commit

Permalink
Parallel calls
Browse files Browse the repository at this point in the history
  • Loading branch information
sumeet-db committed Sep 11, 2024
1 parent d7b94cd commit 3bd4a6e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 80 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,24 @@ public class CoordinatedCommitsUtils {
private CoordinatedCommitsUtils() {}

/** The subdirectory in which to store the unbackfilled commit files. */
final static String COMMIT_SUBDIR = "_commits";
final static public String COMMIT_SUBDIR = "_commits";

/** The configuration key for the coordinated commits owner. */
private static final String COORDINATED_COMMITS_COORDINATOR_CONF_KEY =
/** The configuration key for the coordinated commits owner name. */
private static final String COORDINATED_COMMITS_COORDINATOR_NAME_KEY =
"delta.coordinatedCommits.commitCoordinator-preview";

/**
* Creates a new unbackfilled delta file path for the given commit version.
* The path is of the form `tablePath/_delta_log/_commits/00000000000000000001.uuid.json`.
*/
public static Path generateUnbackfilledDeltaFilePath(
Path logPath,
long version) {
String uuid = UUID.randomUUID().toString();
Path basePath = new Path(logPath, COMMIT_SUBDIR);
return new Path(basePath, String.format("%020d.%s.json", version, uuid));
}

/**
* Returns the path to the backfilled delta file for the given commit version.
* The path is of the form `tablePath/_delta_log/00000000000000000001.json`.
Expand Down Expand Up @@ -111,7 +123,7 @@ public static Path commitDirPath(Path logPath) {
private static String getCoordinator(AbstractMetadata metadata) {
String coordinator = metadata
.getConfiguration()
.get(COORDINATED_COMMITS_COORDINATOR_CONF_KEY);
.get(COORDINATED_COMMITS_COORDINATOR_NAME_KEY);
return coordinator != null ? coordinator : "";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.locks.ReentrantReadWriteLock

import io.delta.storage.LogStore
import io.delta.storage.commit.CoordinatedCommitsUtils
import io.delta.storage.commit.actions.AbstractMetadata
import io.delta.storage.commit.actions.AbstractProtocol
import org.apache.hadoop.conf.Configuration
Expand Down

0 comments on commit 3bd4a6e

Please sign in to comment.