ivanzlenko commented on code in PR #7969:
URL: https://github.com/apache/ignite-3/pull/7969#discussion_r3077983612
##########
modules/raft/src/main/java/org/apache/ignite/internal/raft/util/SharedLogStorageManagerUtils.java:
##########
@@ -41,36 +50,49 @@ public class SharedLogStorageManagerUtils {
* LOGIT_STORAGE_ENABLED_PROPERTY and fsync set to true.
*/
@TestOnly
- public static LogStorageManager create(String nodeName, Path
logStoragePath) {
- return create("test", nodeName, logStoragePath, true);
- }
+ public static LogStorageManager create(String nodeName, Path
logStoragePath, LogStorageConfiguration logStorageConfig) {
+ var segmentLogStorageOptions = new SegmentLogStorageOptions(1,
logStorageConfig, new FailureManager(new NoOpFailureHandler()));
- /**
- * Creates a LogStorageManager with {@link DefaultLogStorageManager} or
{@link LogitLogStorageManager} implementation depending on
- * LOGIT_STORAGE_ENABLED_PROPERTY.
- */
- public static LogStorageManager create(
- String factoryName,
- String nodeName,
- Path logStoragePath,
- boolean fsync
- ) {
- return create(factoryName, nodeName, logStoragePath, fsync,
RocksDbLogStorageOptions.defaults());
+ return create("test", nodeName, logStoragePath, true,
RocksDbLogStorageOptions.defaults(), segmentLogStorageOptions);
}
/**
- * Creates a LogStorageManager with {@link DefaultLogStorageManager} or
{@link LogitLogStorageManager} implementation depending on
- * LOGIT_STORAGE_ENABLED_PROPERTY.
+ * Creates a LogStorageManager with {@link SegmentLogStorageManager},
{@link DefaultLogStorageManager} or {@link LogitLogStorageManager}
+ * implementation depending on SEGSTORE_ENABLED_PROPERTY /
LOGIT_STORAGE_ENABLED_PROPERTY.
*/
public static LogStorageManager create(
String factoryName,
String nodeName,
Path logStoragePath,
boolean fsync,
- RocksDbLogStorageOptions specificOptions
+ RocksDbLogStorageOptions rocksDbStoreSpecificOptions,
+ @Nullable SegmentLogStorageOptions segmentStoreSpecificOptions
) {
- return
IgniteSystemProperties.getBoolean(LOGIT_STORAGE_ENABLED_PROPERTY,
LOGIT_STORAGE_ENABLED_PROPERTY_DEFAULT)
- ? new LogitLogStorageManager(nodeName, new StoreOptions(),
logStoragePath)
- : new DefaultLogStorageManager(factoryName, nodeName,
logStoragePath, fsync, specificOptions);
+ if (!IgniteSystemProperties.segmentLogStorageEnabled()) {
+ return
IgniteSystemProperties.getBoolean(LOGIT_STORAGE_ENABLED_PROPERTY,
LOGIT_STORAGE_ENABLED_PROPERTY_DEFAULT)
+ ? new LogitLogStorageManager(nodeName, new StoreOptions(),
logStoragePath)
+ : new DefaultLogStorageManager(factoryName, nodeName,
logStoragePath, fsync, rocksDbStoreSpecificOptions);
+ }
+
+ assert segmentStoreSpecificOptions != null;
+
+ int stripes = segmentStoreSpecificOptions.stripes();
+ LogStorageConfiguration storageConfiguration =
segmentStoreSpecificOptions.configuration();
+ FailureProcessor failureProcessor =
segmentStoreSpecificOptions.failureProcessor();
+
+ try {
+ return new SegmentLogStorageManager(
+ nodeName,
+ factoryName,
+ logStoragePath,
+ stripes,
+ failureProcessor,
+ fsync,
+ storageConfiguration
+ );
+ } catch (IOException e) {
+ throw new LogStorageException("Couldn't create
SegmentLogStorageManager", e);
+ }
+
Review Comment:
let's remove this blank line
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]