Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shivamka1/smf-dependency-graph
Create dependency graph of all the processes managed by SMF framework on a Solaris machine.
https://github.com/shivamka1/smf-dependency-graph
Last synced: about 8 hours ago
JSON representation
Create dependency graph of all the processes managed by SMF framework on a Solaris machine.
- Host: GitHub
- URL: https://github.com/shivamka1/smf-dependency-graph
- Owner: shivamka1
- License: mit
- Created: 2016-11-21T06:44:42.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2016-11-21T08:38:40.000Z (about 8 years ago)
- Last Synced: 2025-01-13T06:21:03.694Z (6 days ago)
- Language: Java
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# smf-dependency-graph
## Objective
The object is to create dependency graph of all the processes managed by [SMF framework](http://www.oracle.com/technetwork/articles/servers-storage-admin/intro-smf-basics-s11-1729181.html) on a Solaris machine using a javascipt library called as [SigmaJs](http://sigmajs.org).## Algorithm
This algorithm attempts to create a list of nodes and edges as a json string i.e., in a format acceptable by simgajs library provided a list of processes and there dependants in a particular format as specified below.```
read the input file that maintains list of processes and their dependants labels in a particular format
iterate through the list of source/target node labels until end of file is met
create a source node object with the source node label
check if the source node object already exists in the nodes list, if yes retrieve and replace the newly created source node object with it
iterate through the list of source/target node labels until blank line is met
create target node object with the target node label
check if the target node object already exists in the nodes list, if yes retrieve and replace the newly created target node object with it
create edge object with the source and target nodes
populate graph object with the nodes and edges list
marshall the graph object into a json string in an output file
```### Input file format
Maintains a list of processes and their dependants.
```
node a
node b
node cnode d
node e
node fnode f
node g
```### Output file format
The description regarding this format can be found at [SigmaJs](http://sigmajs.org).
```
{
"nodes": [
{
"id": "n0",
"label": "A node",
"x": 0,
"y": 0,
"size": 3
},
{
"id": "n1",
"label": "Another node",
"x": 3,
"y": 1,
"size": 2
}
],
"edges": [
{
"id": "e0",
"source": "n0",
"target": "n1"
}
]
}
```Processes and there dependants are separated by a blank line where the first and the subsequent lines represents processes and there dependants respectively. In the algorithm they are represented as source node and the target node where source nodes are processes and target nodes are there dependants.
```
node a
node b
node cnode d
node e
node fnode f
node g
```##### Notes
- The best data structure to represent a dependency graph is DAG i.e., directed acyclic graph.
- Algorithm still needs to support input files that lists processes and there dependencies.## Run
### With Default Input
```
$ mvn exec:java -D exec.mainClass=com.codingkapoor.smfdependencygraph.Builder
```### With User Input
```
$ mvn exec:java -D exec.mainClass=com.codingkapoor.smfdependencygraph.Builder -Dexec.args=input.txt
```