Skip to content

Commit

Permalink
fix store init error
Browse files Browse the repository at this point in the history
  • Loading branch information
VGalaxies committed Jul 4, 2024
1 parent 87f1b73 commit 6bb3134
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 12 deletions.
2 changes: 1 addition & 1 deletion hugegraph-pd/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
<include>.flattened-pom.xml</include>
<!-- WARN: delete dist dir may influence dev? -->
<!-- TODO: replace with ${final.name} in pd-dist -->
<include>dist/**</include>
<include>apache-hugegraph-incubating-pd-1.3.0/**</include>
</includes>
<followSymlinks>false</followSymlinks>
</fileset>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
import static org.apache.hugegraph.config.OptionChecker.rangeDouble;
import static org.apache.hugegraph.config.OptionChecker.rangeInt;

import java.util.Map;

import org.apache.hugegraph.config.ConfigConvOption;
import org.apache.hugegraph.config.ConfigListConvOption;
import org.apache.hugegraph.config.ConfigOption;
Expand Down Expand Up @@ -82,18 +84,20 @@ public class RocksDBOptions extends OptionHolder {
""
);

public static final ConfigOption<InfoLogLevel> LOG_LEVEL =
public static final ConfigOption<String> LOG_LEVEL =
new ConfigOption<>(
"rocksdb.log_level",
"The info log level of RocksDB.",
allowValues(InfoLogLevel.DEBUG_LEVEL,
InfoLogLevel.INFO_LEVEL,
InfoLogLevel.WARN_LEVEL,
InfoLogLevel.ERROR_LEVEL,
InfoLogLevel.FATAL_LEVEL,
InfoLogLevel.HEADER_LEVEL),
InfoLogLevel.INFO_LEVEL
);
allowValues("DEBUG", "INFO", "WARN", "ERROR", "FATAL", "HEADER"),
"INFO"
);
public static final Map<String, InfoLogLevel> LOG_LEVEL_MAPPING =
Map.of("DEBUG", InfoLogLevel.DEBUG_LEVEL,
"INFO", InfoLogLevel.INFO_LEVEL,
"WARN", InfoLogLevel.WARN_LEVEL,
"ERROR", InfoLogLevel.ERROR_LEVEL,
"FATAL", InfoLogLevel.FATAL_LEVEL,
"HEADER", InfoLogLevel.HEADER_LEVEL);

public static final ConfigOption<Integer> NUM_LEVELS =
new ConfigOption<>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ public static void initOptions(HugeConfig conf,
db.setAllowConcurrentMemtableWrite(true);
db.setEnableWriteThreadAdaptiveYield(true);
}
db.setInfoLogLevel(conf.get(RocksDBOptions.LOG_LEVEL));
db.setInfoLogLevel(
RocksDBOptions.LOG_LEVEL_MAPPING.get(conf.get(RocksDBOptions.LOG_LEVEL)));
db.setMaxSubcompactions(conf.get(RocksDBOptions.MAX_SUB_COMPACTIONS));
db.setAllowMmapWrites(conf.get(RocksDBOptions.ALLOW_MMAP_WRITES));
db.setAllowMmapReads(conf.get(RocksDBOptions.ALLOW_MMAP_READS));
Expand Down
2 changes: 1 addition & 1 deletion hugegraph-store/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
<include>*.tar.gz</include>
<include>.flattened-pom.xml</include>
<!-- TODO: replace with ${final.name} in store-dist -->
<include>dist/**</include>
<include>apache-hugegraph-incubating-store-1.3.0/**</include>
</includes>
<followSymlinks>false</followSymlinks>
</fileset>
Expand Down

0 comments on commit 6bb3134

Please sign in to comment.