Showing posts with label Properties. Show all posts
Showing posts with label Properties. Show all posts

Sunday, March 26, 2017

Update Properties

It is time, once again, to update the properties page.  Since I haven't updated in a while, there is lots to do.

Sunday, February 19, 2017

Property Defaults

Miranda properties and their default values:

Miscellaneous properties. 

These properties have "com.lsllc.miranda" as their prefix.

Name Default Description
DelayBetweenRetries 10000 The amount of time, in milliseconds that the sytem waits before retrying a connection to another node.
DeliveryDirectory data/deliveries The directory where deliveries files are kept.
FileCheckPeriod 1000 The amount of time, in milliseconds, that the systems wait in between chececks to see if any files have changed.
GarbageCollectionPeriod 3600000 The amont of time, in milliseconds, the system waits before doing a collection of old users, topics and subscriptions.
Log4jFile log4j.xml The log4j cofiguration file.
MaxWriteFailures 5 The number of times that the sytem tries to write out a file when before giving up, when shutting down.
MessageDirectory data/messages The directory where the system keeps the message files.
MessageFileSize 100 The number of events (messages) in a single event file.
MessagePort 443 The TCP port that the system listens for clients to send events (messages) to.
Network mina The network library that the system uses.
PropertiesFile mirnda.properties The properties file for the system.
SubscriptionsFile data/subscriptions.json The file the system uses for suscriptions.
TopicsFile data/topics.json The file where the system keeps the topics.
UsersFiledata/users.jsonThe file where the system keeps the users.

Cluster Properties

These properties pertain to the operation of the system cluster.  They all share the prefix: "com.ltsllc.miranda.cluster"

Name Default Description
File data/cluster.json The file that contains the nodes that make up the cluster
HealthCheckPeriod 86400000 The period of time, in milliseconds, that the system checks if a node is up.
Port 6789 The port that the system waits for new nodes to connect on.
Timeout 604800000 The amount of time, in milliseconds, that a node can be down before the system concludes that the node is dead.

Encryption Properties

These properties effect the way that the system uses encryption.  Each uses "com.ltsllc.miranda.encytion" as a prefix to its name.  Entries in bold have no default value.

Name Default Description
CertificateAlias server The alias of the certificacte that the system presents to other nodes.
KeyStore serverkeystore The file that contains the server private key. The file must be in Java Keystore format.
KeyStoreAlias server The alias of the server private key.
KeyStorePassword none The password for the keystore.
Mode localCA The encryption mode used by the system.
Truststore truststore The file that contains the certificate used to sign the other certificates.
TruststoreAlias ca The alias of the certificate used to sign the other certificates.
TruststorePassword none The password for the truststore

HTTP Properties

These properties govern how the system uses HTTP and HTTPS.  All properties have the prefix "com.ltsllc.miranda.http"

Name Default Description
Base html The directory that contains the system's HTML and other web-oriented files.
HttpPort 80 The TCP port that the system listens for new HTTP connections on.
Server jetty The web server to use.
SslPort 443 The TCP port that the system listens for new HTTPS connections on.

"My" Properties

These properties control what is sent with a join message.  None of these properties have default values.  All of these properties have the prefix "com.ltsllc.miranda.my"

Name Default Description
Description none A human-readable desciption of the node,
dns none The DNS name of the system.
ip none The IP address of the system.
Port none The TCP port that the system listens to for new nodes.

Panic Properties

These properties control how the system responds to panics.  All these properties have the prefix "com.ltsllc.miranda.panic"

Name Default Description
Limit 3 How many recovable panics the system will handle before it terminates.
Timeout 3600000 The amount of time, in milliseconds, that the system waits before decrementing the panic count.


Sunday, January 8, 2017

File Structure

Miranda has the following directory structure:

Name Default Description
com.ltsllc.miranda.ClusterFile data/cluster.json Where the system keeps information about the cluster
com.ltsllc.miranda.UserFile data/users.json Where the system keeps information about the users
com.ltsllc.miranda.TopicsFile data/topics.json Where the system keeps information about the system topics
com.ltsllc.miranda.SubscriptionsFile data/subscriptions.json Where the system keeps information about the subscriptions
com.ltsllc.miranda.MessagesDirectory data/messages The directory where the system keeps the messages files
com.ltsllc.miranda.DeliveriesDirectory data/deliveries The directory where the system keeps the deliveries files

Miranda keeps several messages files. Each one holds 100 messages.  The files are named with the index of the first message in the file, so the first one is named "1.json" the next "101.json" and so on.

Deliveries are kept in a directory with the name of the subscription, with the files named for the index of the first message in the file.  The deliveries are kept in groups of 100 so the first file is named "1.json" the second "101.json" and so on.

All files are JSON, cluster.json contains a list of hosts, users.json contains a list of users, topics.json contains a list of topics and suscriptions.json contains a list of subscriptions.

The messages file contains messages in the system.  Each of the files in the deliveries directory   contains a list of delivery objects.

Friday, January 6, 2017

Property Augmentation

Property Augmentation is the process of adding new properties to an object without doing anything to existing properties.

Miranda uses this when it defines its properties and their default values.

Miranda looks at the command line for a properties file, but if it doesn't find one it looks in the system properties for a property named MirandaProperties.PROPERTY_SYSTEM_PROPERTIES (currently defined to be "com.ltsllc.miranda.Properties").  If that is not defined then the system uses the default name (currently "miranda.properties").

The system augments the system properties with default values (defined by MirandaProerties.DEFAULT_PROPERTIES) and then, if the properties file exists.  It tries to load that file and it uses that to augment the system properties.

One of the things about augmentation is that the last write wins, so this is really a long winded way of getting the system properties.