(int serverId)
| 18 | final CoverHistory coverHistory; |
| 19 | |
| 20 | public App(int serverId) { |
| 21 | config = Config.load("zeze.xml"); |
| 22 | config.setServerId(serverId); |
| 23 | config.setFastRedoWhenConflict(false); |
| 24 | config.setCheckpointPeriod(1000); |
| 25 | config.getServiceConfMap().remove("Zeze.Onz.Server"); |
| 26 | config.setHistory("ZezeTest"); |
| 27 | |
| 28 | var tdef = config.getDefaultTableConf(); |
| 29 | // 提高并发 |
| 30 | tdef.setCacheCleanPeriod(1000); |
| 31 | // 超出容量时,快速尝试。 |
| 32 | tdef.setCacheCleanPeriodWhenExceedCapacity(100); |
| 33 | // 减少容量,实际使用记录数要超过一些。让TableCache.Cleanup能并发起来。 |
| 34 | tdef.setCacheCapacity(Simulate.CacheCapacity); |
| 35 | tdef.setCacheFactor(1.0f); |
| 36 | |
| 37 | var tflush = config.getTableConfMap().get("demo_Module1_tflush"); |
| 38 | // 提高并发 |
| 39 | tflush.setCacheCleanPeriod(1000); |
| 40 | // 超出容量时,快速尝试。 |
| 41 | tflush.setCacheCleanPeriodWhenExceedCapacity(100); |
| 42 | // 减少容量,实际使用记录数要超过一些。让TableCache.Cleanup能并发起来。 |
| 43 | tflush.setCacheCapacity(Tasks.tflushInt1Trade.CacheCapacity); |
| 44 | tflush.setCacheFactor(1.0f); |
| 45 | |
| 46 | config.getServiceConfMap().remove("TestServer"); |
| 47 | coverHistory = new CoverHistory(this.app); |
| 48 | |
| 49 | for (var dbCfg : config.getDatabaseConfMap().values()) { |
| 50 | var dc = dbCfg.getDruidConf(); |
| 51 | if (dc != null && (dc.maxActive == null || dc.maxActive > 10)) |
| 52 | dc.maxActive = 10; |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | public int getServerId() { |
| 57 | return config.getServerId(); |
nothing calls this directly
no test coverage detected