-
Notifications
You must be signed in to change notification settings - Fork 276
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
WIP: Bootstrap optimisation lld flow #2943
Draft
aga9900
wants to merge
12
commits into
master
Choose a base branch
from
bootstrap-optimisation-lld-flow
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
03ecd50
Config Changes For File Based Replication
aga9900 d7a4d89
Adding File Copy Config
aga9900 0dc4a5b
Bootstrap optimisation LLD Changes (#2945)
aga9900 aaa4ed6
Updating LLD Branch
aga9900 c591b23
FileStore skeleton PR
vaibhav-mittal-linkedin 62fd023
[S3 API] Support for S3 AbortMultipartUpload API (#2940)
alyssaxu333 d91b99f
Support rename dataset version (#2935)
SophieGuo410 75ef4f4
add local store to logs (#2947)
manbearpig1996 3dac41d
Updating Git Commit Reverts
aga9900 d53dd22
Merging New Changes For LLD Flow (#2948)
aga9900 944356e
Bootstrap FC optimization: Interfaces for state build and state trans…
piyujai fe1af8a
State build interfaces changes part(2/2) (#2957)
piyujai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
ambry-api/src/main/java/com/github/ambry/clustermap/FileStoreException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.github.ambry.clustermap; | ||
|
||
public class FileStoreException extends RuntimeException{ | ||
public enum FileStoreErrorCode{ | ||
FileStore, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
ambry-api/src/main/java/com/github/ambry/config/FileCopyConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.github.ambry.config; | ||
|
||
public class FileCopyConfig { | ||
|
||
public static final String PARALLEL_PARTITION_HYDRATION_COUNT_PER_DISK = "parallel.partition.hydration.count.per.disk"; | ||
@Config(PARALLEL_PARTITION_HYDRATION_COUNT_PER_DISK) | ||
public final int parallelPartitionHydrationCountPerDisk; | ||
|
||
public static final String NUMBER_OF_FILE_COPY_THREADS = "number.of.file.copy.threads"; | ||
@Config(NUMBER_OF_FILE_COPY_THREADS) | ||
public final int numberOfFileCopyThreads; | ||
|
||
public static final String FILE_CHUNK_TIMEOUT_IN_MINUTES = "file.chunk.timeout.in.minutes"; | ||
@Config(FILE_CHUNK_TIMEOUT_IN_MINUTES) | ||
public final long fileChunkTimeoutInMins; | ||
|
||
/** | ||
* The frequency at which the data gets flushed to disk | ||
*/ | ||
public static final String STORE_DATA_FLUSH_INTERVAL_IN_MBS = "store.data.flush.size.In"; | ||
@Config("store.data.flush.size.In") | ||
@Default("60") | ||
public final long storeDataFlushIntervalSeconds; | ||
|
||
public FileCopyConfig(VerifiableProperties verifiableProperties) { | ||
parallelPartitionHydrationCountPerDisk = verifiableProperties.getInt(PARALLEL_PARTITION_HYDRATION_COUNT_PER_DISK, 1); | ||
numberOfFileCopyThreads = verifiableProperties.getInt(NUMBER_OF_FILE_COPY_THREADS, 4); | ||
fileChunkTimeoutInMins = verifiableProperties.getInt(FILE_CHUNK_TIMEOUT_IN_MINUTES, 5); | ||
storeDataFlushIntervalSeconds = verifiableProperties.getLong("store.data.flush.size", 60); | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
ambry-api/src/main/java/com/github/ambry/config/ServerReplicationMode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.github.ambry.config; | ||
|
||
public enum ServerReplicationMode { | ||
BLOB_BASED, | ||
FILE_BASED; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
plugins { | ||
id 'java' | ||
} | ||
|
||
group = 'com.github.ambry' | ||
version = '0.4.512' | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
testImplementation platform('org.junit:junit-bom:5.9.1') | ||
testImplementation 'org.junit.jupiter:junit-jupiter' | ||
} | ||
|
||
test { | ||
useJUnitPlatform() | ||
} |
79 changes: 79 additions & 0 deletions
79
ambry-file-transfer/src/main/java/com/github/ambry/FileCopyManager.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
package com.github.ambry; | ||
|
||
import com.codahale.metrics.MetricRegistry; | ||
import com.github.ambry.clustermap.ClusterMap; | ||
import com.github.ambry.clustermap.ClusterParticipant; | ||
import com.github.ambry.clustermap.DataNodeId; | ||
import com.github.ambry.clustermap.PartitionStateChangeListener; | ||
import com.github.ambry.clustermap.StateModelListenerType; | ||
import com.github.ambry.config.ClusterMapConfig; | ||
import com.github.ambry.config.FileCopyConfig; | ||
import com.github.ambry.config.StoreConfig; | ||
import com.github.ambry.network.NetworkClientFactory; | ||
import com.github.ambry.server.StoreManager; | ||
import com.github.ambry.store.StoreKeyFactory; | ||
import java.io.IOException; | ||
import java.util.Map; | ||
import java.util.concurrent.ScheduledExecutorService; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
public class FileCopyManager { | ||
|
||
protected final Logger logger = LoggerFactory.getLogger(getClass()); | ||
|
||
public FileCopyManager(PrioritisationManager prioritisationManager, FileCopyConfig fileCopyConfig, ClusterMapConfig clusterMapConfig, | ||
StoreConfig storeConfig, StoreManager storeManager, StoreKeyFactory storeKeyFactory, ClusterMap clusterMap, | ||
ScheduledExecutorService scheduler, DataNodeId dataNode, NetworkClientFactory networkClientFactory, | ||
MetricRegistry metricRegistry, ClusterParticipant clusterParticipant) { | ||
if (clusterParticipant != null) { | ||
clusterParticipant.registerPartitionStateChangeListener(StateModelListenerType.FileCopyManagerListener, | ||
new PartitionStateChangeListenerImpl()); | ||
logger.info("File Copy Manager's state change listener registered!"); | ||
} | ||
if(!prioritisationManager.isRunning()) { | ||
prioritisationManager.start(); | ||
} | ||
} | ||
public void start() throws InterruptedException, IOException { | ||
|
||
} | ||
class PartitionStateChangeListenerImpl implements PartitionStateChangeListener { | ||
|
||
@Override | ||
public void onPartitionBecomeBootstrapFromOffline(String partitionName) { | ||
// StateBuilding (storeManager.buildStateForFileCopy()) will be triggered at the end of FCM's async handler. | ||
} | ||
|
||
@Override | ||
public void onPartitionBecomeStandbyFromBootstrap(String partitionName) { | ||
|
||
} | ||
|
||
@Override | ||
public void onPartitionBecomeLeaderFromStandby(String partitionName) { | ||
|
||
} | ||
|
||
@Override | ||
public void onPartitionBecomeStandbyFromLeader(String partitionName) { | ||
|
||
} | ||
|
||
@Override | ||
public void onPartitionBecomeInactiveFromStandby(String partitionName) { | ||
|
||
} | ||
|
||
@Override | ||
public void onPartitionBecomeOfflineFromInactive(String partitionName) { | ||
|
||
} | ||
|
||
@Override | ||
public void onPartitionBecomeDroppedFromOffline(String partitionName) { | ||
|
||
} | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
plugins { | ||
id 'java' | ||
} | ||
|
||
group = 'com.github.ambry' | ||
version = '0.4.514' | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
testImplementation platform('org.junit:junit-bom:5.9.1') | ||
testImplementation 'org.junit.jupiter:junit-jupiter' | ||
} | ||
|
||
test { | ||
useJUnitPlatform() | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change it to MBs