Skip to content

Commit

Permalink
Fix : in pathnames and scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
boiseamit committed Oct 27, 2023
1 parent 89e3ca2 commit 71c0633
Show file tree
Hide file tree
Showing 42 changed files with 47 additions and 46 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ build/

.DS_Store
SSH*btree*
dumps/dump-*
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,8 @@ The following displays what each main driver must output:

| Class | Output |
|---------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `SSHCreateBTree` | - `QUERY:<tree-type>.txt`<br/>- RAF `SSH_lig.txtssh.btree<tree-type><degree>` file<br/>- `dump:<tree-type><degree>.txt` (`<debug>`=`1`) <br/>- `SSHLogDB.db` from the dump file (`<debug>`=`1`)<br/> |
| `SSHSearchBTree` | - `SQUERY:<tree-type><topfrequency>.txt` |
| `SSHCreateBTree` | - `QUERY-<tree-type>.txt`<br/>- RAF `SSH_lig.txtssh.btree<tree-type><degree>` file<br/>- `dump-<tree-type><degree>.txt` (`<debug>`=`1`) <br/>- `SSHLogDB.db` from the dump file (`<debug>`=`1`)<br/> |
| `SSHSearchBTree` | - `SQUERY-<tree-type><topfrequency>.txt` |
| `SSHSearchDatabase` | - top `<SSH Key> <frequency>` to standard out stream |


Expand Down Expand Up @@ -411,15 +411,15 @@ that will then be searched for in the `.db` database file to a specific B-Tree d
- `0`: Any diagnostic messages, help and status messages must be printed on standard
error stream

- `1`: The program writes a text file named `dump:treetype.degree`, ex. `dump:accepted-ip0`,
- `1`: The program writes a text file named `dump-treetype.degree`, ex. `dump-accepted-ip0`,
containing the SSH key and corresponding frequency in an inorder traversal, and has the following
line format:

```bash
<SSH Key> <frequency>
```

The following shows a segment of the dumpfile `dumps/dump:user-ip0`. It has a total of 5294 lines!
The following shows a segment of the dumpfile `dumps/dump-user-ip0`. It has a total of 5294 lines!
```bash
huangqx-115.71.16.143 20
huangt-183.136.169.234 2
Expand All @@ -440,35 +440,35 @@ java -jar build/libs/SSHCreateBTree.jar --cache=1 --degree=0 --sshFile=SSH_log.t
```

Outputs:
- Dump text file: `dump:accepted-ip0`
- Query file: `QUERY:accepted-ip.txt`
- Dump text file: `dump-accepted-ip0`
- Query file: `QUERY-accepted-ip.txt`
- B-Tree RAF file: `SSH_log.txt.ssh.btree.accepted-ip.0`
- Table name: `acceptedip` to `SSHLogDB.db`


| Snippet of Dump file - `dump:accepted-ip0`: | Snippet of Query file - `QUERY:accepted-ip.txt`: |
| Snippet of Dump file - `dump-accepted-ip0`: | Snippet of Query file - `QUERY-accepted-ip.txt`: |
|----------------------------------------------------------|----------------------------------------------------------------|
| ![Dump.png](docs/Dump.png "Example Excerpt of Log File") | ![QueryFile.png](docs/Query.png "Example Excerpt of Log File") |


#### 5.2.2. Search B-Tree in `SSHSearchBTree`
With arguments of:
```bash
java -jar build/libs/SSHSearchBTree.jar --cache=0 --degree=0 --btreefile=SSH_log.txt.ssh.btree.accepted-time.0 --queryfile=QUERY:accepted-time.txt --topfrequency=25 --size=10000 --debug=0
java -jar build/libs/SSHSearchBTree.jar --cache=0 --degree=0 --btreefile=SSH_log.txt.ssh.btree.accepted-time.0 --queryfile=QUERY-accepted-time.txt --topfrequency=25 --size=10000 --debug=0
```

Outputs:
- Search query text file: `SQUERY:accepted-ip25.txt`
- Search query text file: `SQUERY-accepted-ip25.txt`

| SQuery file - `SQUERY:accepted-ip25.txt`: |
| SQuery file - `SQUERY-accepted-ip25.txt`: |
|----------------------------------------------------------------|
| ![Dump.png](docs/SQueryFile.png "Example Excerpt of Log File") |

#### 5.2.3. Search B-Tree Database in `SSHSearchDatabase`

With arguments of:
```bash
java -jar build/libs/SSHSearchDatabase.jar --database=SSHLogDB.db --sQueryfile=SQUERY:accepted-time25.txt
java -jar build/libs/SSHSearchDatabase.jar --database=SSHLogDB.db --sQueryfile=SQUERY-accepted-time25.txt
```

Outputs to standard output stream:
Expand Down
60 changes: 30 additions & 30 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,20 @@ dependencies {
testImplementation group: 'junit', name: 'junit', version: '4.12'
}

task createJarGeneBankCreateBTree(type: Jar) {
task createJarSSHCreateBTree(type: Jar) {
group = 'Run'
description = 'create build/libs/GeneBankCreateBTree.jar'
description = 'create build/libs/SSHCreateBTree.jar'

from(sourceSets.main.output) {
include "cs321/create/**"
}

manifest {
attributes 'Implementation-Title': 'GeneBankCreateBTree',
attributes 'Implementation-Title': 'SSHCreateBTree',
'Implementation-Version': archiveVersion,
'Main-Class': 'cs321.create.GeneBankCreateBTree'
'Main-Class': 'cs321.create.SSHCreateBTree'
}
archiveBaseName = 'GeneBankCreateBTree'
archiveBaseName = 'SSHCreateBTree'
archiveVersion = ''

// the duplicatesStrategy is required by Gradle 7
Expand All @@ -46,20 +46,20 @@ task createJarGeneBankCreateBTree(type: Jar) {
with jar
}

task createJarGeneBankSearchBTree(type: Jar) {
task createJarSSHSearchBTree(type: Jar) {
group = 'Run'
description = 'create build/libs/GeneBankSearchBTree.jar'
description = 'create build/libs/SSHSearchBTree.jar'

from(sourceSets.main.output) {
include "cs321/search/**"
}

manifest {
attributes 'Implementation-Title': 'GeneBankSearchBTree',
attributes 'Implementation-Title': 'SSHSearchBTree',
'Implementation-Version': archiveVersion,
'Main-Class': 'cs321.search.GeneBankSearchBTree'
'Main-Class': 'cs321.search.SSHSearchBTree'
}
archiveBaseName = 'GeneBankSearchBTree'
archiveBaseName = 'SSHSearchBTree'
archiveVersion = ''

// the duplicatesStrategy is required by Gradle 7
Expand All @@ -69,20 +69,20 @@ task createJarGeneBankSearchBTree(type: Jar) {
with jar
}

task createJarGeneBankSearchDatabase(type: Jar) {
task createJarSSHSearchDatabase(type: Jar) {
group = 'Run'
description = 'create build/libs/GeneBankSearchDatabase.jar'
description = 'create build/libs/SSHSearchDatabase.jar'

from(sourceSets.main.output) {
include "cs321/search/**"
}

manifest {
attributes 'Implementation-Title': 'GeneBankSearchDatabase',
attributes 'Implementation-Title': 'SSHSearchDatabase',
'Implementation-Version': archiveVersion,
'Main-Class': 'cs321.search.GeneBankSearchDatabase'
'Main-Class': 'cs321.search.SSHSearchDatabase'
}
archiveBaseName = 'GeneBankSearchDatabase'
archiveBaseName = 'SSHSearchDatabase'
archiveVersion = ''

// the duplicatesStrategy is required by Gradle 7
Expand All @@ -92,54 +92,54 @@ task createJarGeneBankSearchDatabase(type: Jar) {
with jar
}

tasks.createJarGeneBankCreateBTree.finalizedBy('printInstructionsToRunJarGeneBankCreateBTree')
tasks.createJarSSHCreateBTree.finalizedBy('printInstructionsToRunJarSSHCreateBTree')

task printInstructionsToRunJarGeneBankCreateBTree {
task printInstructionsToRunJarSSHCreateBTree {
doLast {
println ''
println '------------------------------------------------------------'
println 'The GeneBankCreateBTree.jar was created successfully. Run:'
println '$ java -jar build/libs/GeneBankCreateBTree.jar <arguments>'
println 'The SSHCreateBTree.jar was created successfully. Run:'
println '$ java -jar build/libs/SSHCreateBTree.jar <arguments>'
println '------------------------------------------------------------'
println ''
}

onlyIf {
tasks.createJarGeneBankCreateBTree.state.failure == null
tasks.createJarSSHCreateBTree.state.failure == null
}
}

tasks.createJarGeneBankSearchBTree.finalizedBy('printInstructionsToRunJarGeneBankSearchBTree')
tasks.createJarSSHSearchBTree.finalizedBy('printInstructionsToRunJarSSHSearchBTree')

task printInstructionsToRunJarGeneBankSearchBTree {
task printInstructionsToRunJarSSHSearchBTree {
doLast {
println ''
println '------------------------------------------------------------'
println 'The GeneBankSearchBTree.jar was created successfully. Run:'
println '$ java -jar build/libs/GeneBankSearchBTree.jar <arguments>'
println 'The SSHSearchBTree.jar was created successfully. Run:'
println '$ java -jar build/libs/SSHSearchBTree.jar <arguments>'
println '------------------------------------------------------------'
println ''
}

onlyIf {
tasks.createJarGeneBankSearchBTree.state.failure == null
tasks.createJarSSHSearchBTree.state.failure == null
}
}

tasks.createJarGeneBankSearchDatabase.finalizedBy('printInstructionsToRunJarGeneBankSearchDatabase')
tasks.createJarSSHSearchDatabase.finalizedBy('printInstructionsToRunJarSSHSearchDatabase')

task printInstructionsToRunJarGeneBankSearchDatabase {
task printInstructionsToRunJarSSHSearchDatabase {
doLast {
println ''
println '------------------------------------------------------------'
println 'The GeneBankSearchDatabase.jar was created successfully. Run:'
println '$ java -jar build/libs/GeneBankSearchDatabase.jar <arguments>'
println 'The SSHSearchDatabase.jar was created successfully. Run:'
println '$ java -jar build/libs/SSHSearchDatabase.jar <arguments>'
println '------------------------------------------------------------'
println ''
}

onlyIf {
tasks.createJarGeneBankSearchDatabase.state.failure == null
tasks.createJarSSHSearchDatabase.state.failure == null
}
}

Expand Down
4 changes: 2 additions & 2 deletions check-dumpfiles.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ echo

for value in accepted-ip accepted-time invalid-ip invalid-time failed-ip failed-time reverseaddress-ip reverseaddress-time user-ip
do
echo -n "Test-$value: Comparing /dumps/dump: $value 0"
diff -w dumps/"dump:"$value"0" results/dumpfiles/"dump:"$value"0"
echo -n "Test-$value: Comparing /dumps/dump $value 0"
diff -w dumps/"dump-"$value"0" results/dumpfiles/"dump-"$value"0"
if test "$?" = "0"
then
echo "----> Test-$value PASSED!"
Expand Down
4 changes: 2 additions & 2 deletions check-squeries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
for value in accepted-ip accepted-time invalid-ip invalid-time failed-ip failed-time reverseaddress-ip reverseaddress-time user-ip
do
echo
echo "Running Search query on "SQUERY:"$value"25.txt""
diff -w data/searchQueries/"SQUERY:"$value"25.txt" "results/squery-results/"SQUERY:"$value"25.txt""
echo "Running Search query on "SQUERY-"$value"25.txt""
diff -w data/searchQueries/"SQUERY-"$value"25.txt" "results/squery-results/"SQUERY-"$value"25.txt""
if test "$?" = "0"
then
echo "----> Test-$value PASSED!"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion search-btrees.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

for value in accepted-ip accepted-time invalid-ip invalid-time failed-ip failed-time reverseaddress-ip reverseaddress-time user-ip
do
time java -jar build/libs/SSHSearchBTree.jar --cache=0 --degree=0 --btreefile=SSH_log.txt.ssh.btree.$value.0 --queryfile=QUERY:$value.txt --topfrequency=25 --size=10000 --debug=0
time java -jar build/libs/SSHSearchBTree.jar --cache=0 --degree=0 --btreefile=SSH_log.txt.ssh.btree.$value.0 --queryfile=QUERY-$value.txt --topfrequency=25 --size=10000 --debug=0
done

0 comments on commit 71c0633

Please sign in to comment.