-
Notifications
You must be signed in to change notification settings - Fork 0
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
80f1b9c
commit eb81421
Showing
10 changed files
with
130 additions
and
33 deletions.
There are no files selected for viewing
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,17 @@ | ||
<component name="ProjectRunConfigurationManager"> | ||
<configuration default="false" name="CoreMaster" type="Application" factoryName="Application" nameIsGenerated="true"> | ||
<option name="MAIN_CLASS_NAME" value="net.juligames.core.master.CoreMaster" /> | ||
<module name="Master" /> | ||
<option name="PROGRAM_PARAMETERS" value="--add-modules java.se --add-exports java.base/jdk.internal.ref=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.management/sun.management=ALL-UNNAMED --add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED" /> | ||
<option name="VM_PARAMETERS" value="-Dhazelcast.diagnostics.enabled=true -DcoreDebug=true " /> | ||
<extension name="coverage"> | ||
<pattern> | ||
<option name="PATTERN" value="net.juligames.core.master.*" /> | ||
<option name="ENABLED" value="true" /> | ||
</pattern> | ||
</extension> | ||
<method v="2"> | ||
<option name="Make" enabled="true" /> | ||
</method> | ||
</configuration> | ||
</component> |
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
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 |
---|---|---|
|
@@ -35,23 +35,26 @@ private CoreMaster() { | |
|
||
public static void main(String[] args) { | ||
|
||
//Setup | ||
MasterLogger.setupJavaLogging(); | ||
|
||
logger = new MasterLogger("Master", java.util.logging.Logger.getLogger(Core.getShortRelease())); | ||
|
||
//entry point for Master | ||
masterCommandRunner = new MasterCommandRunner(logger); | ||
masterConfigManager = new MasterConfigManager(); | ||
|
||
logger.info("welcome to " + Core.getFullCoreName() + " Master by Ture Bentzin <[email protected]>"); | ||
logger.info("Welcome to " + Core.getFullCoreName() + " Master by Ture Bentzin <[email protected]>"); | ||
|
||
|
||
logger.info("preparing directory..."); | ||
logger.info("Preparing directory..."); | ||
masterConfigManager.createDatabaseConfiguration(); | ||
|
||
logger.info("booting hazelcast (MEMBER CORE):"); | ||
logger.info("Booting hazelcast (MEMBER CORE):"); | ||
Core core = new Core(); | ||
try { | ||
core.getHazelcastPostPreparationWorkers().register(hazelcastInstance -> { | ||
logger.info("loading config"); | ||
logger.info("Loading config"); | ||
masterConfigManager.load(); | ||
}); | ||
} catch (Registerator.DuplicateEntryException ignored) { | ||
|
@@ -67,11 +70,11 @@ public static void main(String[] args) { | |
logger.error("FAILED TO SETUP HAZELCAST - Master will probably start anyway but the master should be restarted as soon as possible"); | ||
} | ||
|
||
logger.info("hazelcast boot was completed - advice: hazelcast could potentially fail to boot for a variety of reasons, so if you should see" + | ||
logger.info("Hazelcast boot was completed - advice: hazelcast could potentially fail to boot for a variety of reasons, so if you should see" + | ||
"an error above then you might want to restart the master. In the case that the Clients are put on hold by the core you should also" + | ||
"consider restarting."); | ||
|
||
logger.debug("sql: start"); | ||
logger.debug("SQL: start"); | ||
SQLManager = Core.getInstance().getSQLManager(); | ||
|
||
SQLManager.createTables(); //MASTER CREATES TABLES (NOT THE CORE!!!) | ||
|
@@ -83,7 +86,7 @@ public static void main(String[] args) { | |
|
||
//Data | ||
masterHazelInformationProvider = new MasterHazelInformationProvider(hazelcast); | ||
logger.warning("not all code execution on master is stable because the master DOES NOT PROVIDE a fully usable core!!!"); | ||
logger.warning("Not all code execution on master is stable because the master DOES NOT PROVIDE a fully usable core!!!"); | ||
try { | ||
registerCommands(); | ||
} catch (Registerator.DuplicateEntryException e) { | ||
|
@@ -92,15 +95,15 @@ public static void main(String[] args) { | |
} | ||
|
||
//CommandSystem | ||
logger.info("registering CommandHandler..."); | ||
logger.info("Registering CommandHandler..."); | ||
core.getCommandApi().setCommandHandler(new CommandHandler()); | ||
logger.info("master is now ready to receive commands from hazelcast"); | ||
logger.info("Master is now ready to receive commands from hazelcast"); | ||
|
||
//HOOK | ||
|
||
Core.getInstance().getJavaRuntime().addShutdownHook(new Thread(() -> { | ||
try { | ||
logger.info("master is going down!!"); | ||
logger.info("Master is going down!!"); | ||
} catch (Exception ignored) { | ||
System.out.println("Seems like everything is cursed right now. Please report this!"); | ||
} | ||
|
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