-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c99d675
commit 9dcd216
Showing
28 changed files
with
340 additions
and
119 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,32 @@ | ||
INFO main org.riseger.main.init.MainBootstrap - Log initializer successfully | ||
INFO main org.riseger.main.init.ConfigInitializer - Set working directory.. | ||
INFO main org.riseger.main.init.MainBootstrap - Log initializer successfully | ||
INFO main org.riseger.main.init.ConfigInitializer - Set working directory.. | ||
DEBUG main org.riseger.main.init.ConfigInitializer - Config Set port10086 | ||
DEBUG main org.riseger.main.init.ConfigInitializer - Config Set blocking-log125 | ||
DEBUG main org.riseger.main.init.ConfigInitializer - Config Set core-pool-size5 | ||
DEBUG main org.riseger.main.init.ConfigInitializer - Config Set max-pool-size10 | ||
DEBUG main org.riseger.main.init.ConfigInitializer - Config Set keep-alive-time60 | ||
DEBUG main org.riseger.main.init.ConfigInitializer - Config Set default-memorysize1024 | ||
INFO main org.riseger.main.init.MainBootstrap - Config initializer successfully | ||
INFO main org.riseger.main.init.MainBootstrap - Storage initialized successfully | ||
INFO main org.riseger.main.init.MainBootstrap - Cache initialized successfully | ||
INFO main org.riseger.main.init.MainBootstrap - Compiler initialized successfully | ||
INFO main org.riseger.main.init.MainBootstrap - RequestHandler initialized successfully | ||
INFO main org.riseger.main.init.MainBootstrap - Entry initialized successfully | ||
INFO entry-initializer org.riseger.main.entry.server.NettyServer - Netty server connected ,waiting for port 10086 requests | ||
INFO main org.riseger.main.init.MainBootstrap - Log initializer successfully | ||
INFO main org.riseger.main.init.ConfigInitializer - Set working directory.. | ||
DEBUG main org.riseger.main.init.ConfigInitializer - Config Set port 10086 | ||
DEBUG main org.riseger.main.init.ConfigInitializer - Config Set blocking-log 125 | ||
DEBUG main org.riseger.main.init.ConfigInitializer - Config Set core-pool-size 5 | ||
DEBUG main org.riseger.main.init.ConfigInitializer - Config Set max-pool-size 10 | ||
DEBUG main org.riseger.main.init.ConfigInitializer - Config Set keep-alive-time 60 | ||
DEBUG main org.riseger.main.init.ConfigInitializer - Config Set default-memorysize 1024 | ||
INFO main org.riseger.main.init.MainBootstrap - Config initializer successfully | ||
INFO main org.riseger.main.init.MainBootstrap - Storage initialized successfully | ||
INFO main org.riseger.main.init.MainBootstrap - Cache initialized successfully | ||
INFO main org.riseger.main.init.MainBootstrap - Compiler initialized successfully | ||
INFO main org.riseger.main.init.MainBootstrap - RequestHandler initialized successfully | ||
INFO main org.riseger.main.init.MainBootstrap - Entry initialized successfully | ||
INFO entry-initializer org.riseger.main.entry.server.NettyServer - Netty server connected ,waiting for port 10086 requests |
2 changes: 1 addition & 1 deletion
2
...nt/src/test/java/org/example/AppTest.java → ...nt/src/test/java/org/riseger/AppTest.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package org.example; | ||
package org.riseger; | ||
|
||
/** | ||
* Unit test for simple App. | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package org.riseger; | ||
|
||
public class ConfigConstant { | ||
|
||
public static Integer PORT = 10086; | ||
|
||
public static Integer NETTY_BLOCKING_LOG = 125; | ||
|
||
public static int CORE_POOL_SIZE = 5; // 核心线程数 | ||
|
||
public static int MAX_POOL_SIZE = 10; // 最大线程数 | ||
|
||
public static long KEEP_ALIVE_TIME = 60; // 空闲线程存活时间(单位:秒) | ||
|
||
public static Integer DEFAULT_MEMORYSIZE = 1024; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,38 @@ | ||
package org.riseger.main.init; | ||
|
||
import org.apache.log4j.Logger; | ||
import org.riseger.main.cache.entity.component.Database_c; | ||
import org.riseger.main.cache.manager.CacheMaster; | ||
import org.riseger.main.cache.manager.DatabaseManager; | ||
|
||
import java.util.List; | ||
|
||
public class CacheInitializer implements Initializer { | ||
public class CacheInitializer extends Initializer { | ||
private static final Logger LOG = Logger.getLogger(CacheInitializer.class); | ||
|
||
private final StorageInitializer storageInitializer; | ||
|
||
public CacheInitializer(StorageInitializer storageInitializer) { | ||
public CacheInitializer(String rootPath, StorageInitializer storageInitializer) { | ||
super(rootPath); | ||
this.storageInitializer = storageInitializer; | ||
} | ||
|
||
public void init() { | ||
CacheMaster.setINSTANCE(new CacheMaster()); | ||
DatabaseManager dbm = CacheMaster.INSTANCE.getDatabaseManager(); | ||
List<Database_c> databases = storageInitializer.initDatabases(); | ||
if (databases != null) { | ||
for (Database_c database : databases) { | ||
dbm.addDatabase(database); | ||
public boolean init() { | ||
try { | ||
CacheMaster.setINSTANCE(new CacheMaster()); | ||
DatabaseManager dbm = CacheMaster.INSTANCE.getDatabaseManager(); | ||
List<Database_c> databases = storageInitializer.initDatabases(); | ||
if (databases != null) { | ||
for (Database_c database : databases) { | ||
dbm.addDatabase(database); | ||
} | ||
} | ||
return true; | ||
} catch (Exception e) { | ||
LOG.error("Failed to initialize cache", e); | ||
return false; | ||
} | ||
|
||
} | ||
|
||
} |
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
Oops, something went wrong.