-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: introduce storage manager selector to support more selector str…
…ategy (#621) ### What changes were proposed in this pull request? 1. Introduce storage manager selector to support more selector strategy for `MultiStorageManager` 2. Introduce the conf of `rss.server.multistorage.manager.selector.class` to support different flush strategy, like I hope huge partition directly flushed to HDFS and normal partition could be flushed to DISK when single buffer flush is enabled. ### Why are the changes needed? Solving the problem mentioned in #378 (comment). In current codebase, when encountering huge partition, if single buffer flush is enabled, the normal partition data will be flush to HDFS(I don't hope so, because the local disk is free and the flushing speed is faster than HDFS). But if disable single flush buffer, the huge partition event before marking as huge partition may be big, which cause the slow flushing and then cause requiring allocated buffer failed. Based on above problems, this PR is to make single event carrying with 100 mb flushed into HDFS or local file leveraging the conf of `rss.server.multistorage.manager.selector.class` ### Does this PR introduce _any_ user-facing change? Yes. Doc will be updated later. ### How was this patch tested? 1. UTs
- Loading branch information
Showing
11 changed files
with
310 additions
and
52 deletions.
There are no files selected for viewing
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
47 changes: 47 additions & 0 deletions
47
.../src/main/java/org/apache/uniffle/server/storage/multi/DefaultStorageManagerSelector.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,47 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.uniffle.server.storage.multi; | ||
|
||
import org.apache.uniffle.server.ShuffleDataFlushEvent; | ||
import org.apache.uniffle.server.ShuffleServerConf; | ||
import org.apache.uniffle.server.storage.AbstractStorageManagerFallbackStrategy; | ||
import org.apache.uniffle.server.storage.StorageManager; | ||
|
||
import static org.apache.uniffle.server.ShuffleServerConf.FLUSH_COLD_STORAGE_THRESHOLD_SIZE; | ||
|
||
public class DefaultStorageManagerSelector extends FallbackBasedStorageManagerSelector { | ||
private final long flushColdStorageThresholdSize; | ||
|
||
public DefaultStorageManagerSelector( | ||
StorageManager warmStorageManager, | ||
StorageManager coldStorageManager, | ||
AbstractStorageManagerFallbackStrategy fallbackStrategy, | ||
ShuffleServerConf rssConf) { | ||
super(warmStorageManager, coldStorageManager, fallbackStrategy); | ||
this.flushColdStorageThresholdSize = rssConf.get(FLUSH_COLD_STORAGE_THRESHOLD_SIZE); | ||
} | ||
|
||
@Override | ||
StorageManager regularSelect(ShuffleDataFlushEvent flushEvent) { | ||
StorageManager storageManager = warmStorageManager; | ||
if (flushEvent.getSize() > flushColdStorageThresholdSize) { | ||
storageManager = coldStorageManager; | ||
} | ||
return storageManager; | ||
} | ||
} |
Oops, something went wrong.