Skip to content

Commit

Permalink
Fully removed heap_cache setting from config.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandraRoatis authored and AionJayT committed Oct 4, 2019
1 parent 7daaffc commit 14c0393
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 30 deletions.
8 changes: 0 additions & 8 deletions modAionImpl/src/org/aion/zero/impl/db/DBUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ public static void pruneAndCorrect() {
cfg.dbFromXML();
cfg.getConsensus().setMining(false);

cfg.getDb().setHeapCacheEnabled(false);

Map<LogEnum, LogLevel> cfgLog = new HashMap<>();
cfgLog.put(LogEnum.DB, LogLevel.INFO);
cfgLog.put(LogEnum.GEN, LogLevel.INFO);
Expand Down Expand Up @@ -110,8 +108,6 @@ public static void dbCompact() {
cfg.dbFromXML();
cfg.getConsensus().setMining(false);

cfg.getDb().setHeapCacheEnabled(false);

Map<LogEnum, LogLevel> cfgLog = new HashMap<>();
cfgLog.put(LogEnum.DB, LogLevel.INFO);
cfgLog.put(LogEnum.GEN, LogLevel.INFO);
Expand All @@ -132,8 +128,6 @@ public static void dumpBlocks(long count) {
cfg.dbFromXML();
cfg.getConsensus().setMining(false);

cfg.getDb().setHeapCacheEnabled(false);

AionLoggerFactory.initAll();

// get the current blockchain
Expand Down Expand Up @@ -161,8 +155,6 @@ public static void dumpTestData(long blockNumber, String[] otherParameters) {
cfg.dbFromXML();
cfg.getConsensus().setMining(false);

cfg.getDb().setHeapCacheEnabled(false);

AionLoggerFactory.initAll();

// get the current blockchain
Expand Down
16 changes: 2 additions & 14 deletions modMcf/src/org/aion/mcf/config/CfgDb.java
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,8 @@ public Map<String, Properties> asProperties() {
props.setProperty(Props.DB_CACHE_SIZE, String.valueOf(128 * (int) Utils.MEGA_BYTE));

props.setProperty(Props.ENABLE_AUTO_COMMIT, "true");
props.setProperty(Props.ENABLE_HEAP_CACHE, String.valueOf(heap_cache));
// TODO AKI-425: fully remove heap cache functionality; replace with object caches
props.setProperty(Props.ENABLE_HEAP_CACHE, "false");
props.setProperty(Props.MAX_HEAP_CACHE_SIZE, "32");
props.setProperty(Props.ENABLE_HEAP_CACHE_STATS, "false");

Expand All @@ -433,19 +434,6 @@ public Map<String, Properties> asProperties() {
return propSet;
}

private boolean heap_cache = false;

public void setHeapCacheEnabled(boolean value) {
// already disabled when expert==false
if (expert) {
for (Map.Entry<String, CfgDbDetails> entry : specificConfig.entrySet()) {
entry.getValue().enable_heap_cache = value;
}
} else {
heap_cache = true;
}
}

public void setDatabasePath(String value) {
path = value;
}
Expand Down
10 changes: 2 additions & 8 deletions modMcf/src/org/aion/mcf/config/CfgDbDetails.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ public CfgDbDetails() {
this.enable_auto_commit = true;
this.enable_db_cache = true;
this.enable_db_compression = true;
this.enable_heap_cache = false;
// size 0 means unbound
this.max_heap_cache_size = "1024";
this.enable_heap_cache_stats = false;
Expand All @@ -47,7 +46,6 @@ public CfgDbDetails() {
public boolean enable_db_compression;

public boolean enable_auto_commit;
public boolean enable_heap_cache;
public String max_heap_cache_size;
public boolean enable_heap_cache_stats;

Expand Down Expand Up @@ -112,9 +110,6 @@ public void fromXML(final XMLStreamReader sr) throws XMLStreamException {
case Props.ENABLE_DB_COMPRESSION:
this.enable_db_compression = Boolean.parseBoolean(Cfg.readValue(sr));
break;
case Props.ENABLE_HEAP_CACHE:
this.enable_heap_cache = Boolean.parseBoolean(Cfg.readValue(sr));
break;
case Props.MAX_HEAP_CACHE_SIZE:
this.max_heap_cache_size = Cfg.readValue(sr);
break;
Expand Down Expand Up @@ -229,7 +224,8 @@ public Properties asProperties() {
props.setProperty(Props.DB_CACHE_SIZE, String.valueOf(this.cache_size));

props.setProperty(Props.ENABLE_AUTO_COMMIT, String.valueOf(this.enable_auto_commit));
props.setProperty(Props.ENABLE_HEAP_CACHE, String.valueOf(this.enable_heap_cache));
// TODO AKI-425: fully remove heap cache functionality; replace with object caches
props.setProperty(Props.ENABLE_HEAP_CACHE, "false");
props.setProperty(Props.MAX_HEAP_CACHE_SIZE, this.max_heap_cache_size);
props.setProperty(
Props.ENABLE_HEAP_CACHE_STATS, String.valueOf(this.enable_heap_cache_stats));
Expand All @@ -250,7 +246,6 @@ public boolean equals(Object o) {
return enable_db_cache == that.enable_db_cache
&& enable_db_compression == that.enable_db_compression
&& enable_auto_commit == that.enable_auto_commit
&& enable_heap_cache == that.enable_heap_cache
&& enable_heap_cache_stats == that.enable_heap_cache_stats
&& block_size == that.block_size
&& max_fd_open_alloc == that.max_fd_open_alloc
Expand All @@ -268,7 +263,6 @@ public int hashCode() {
enable_db_cache,
enable_db_compression,
enable_auto_commit,
enable_heap_cache,
max_heap_cache_size,
enable_heap_cache_stats,
block_size,
Expand Down

0 comments on commit 14c0393

Please sign in to comment.