Java COMPSs wordcount example (files used as inputs)
**Name:** Java Wordcount
**Contact Person**: support-compss@bsc.es
**Access Level**: public
**License Agreement**: Apache2
**Platform**: COMPSs
# Description
Wordcount application. There are two versions of Wordcount, depending on how the input data is given.
## Version 1
''Single input file'', where all the text is given in the same file and the chunks are calculated with a BLOCK_SIZE parameter.
## Version 2
''Multiple input files'', where the text fragments are already in different files under the same directory
# Execution instructions
Usage:
```
runcompss --classpath=application_sources/jar/wordcount.jar wordcount.multipleFiles.Wordcount DATA_FOLDER
runcompss --classpath=application_sources/jar/wordcount.jar wordcount.uniqueFile.Wordcount DATA_FILE BLOCK_SIZE
```
where:
* DATA_FOLDER: Absolute path to the base folder of the dataset files
* DATA_FILE: Absolute path to the dabase file
* BLOCK_SIZE: Number of bytes of each block
# Execution Examples
```
runcompss --classpath=application_sources/jar/wordcount.jar wordcount.multipleFiles.Wordcount dataset/data-set/
runcompss --classpath=application_sources/jar/wordcount.jar wordcount.uniqueFile.Wordcount dataset/data-set/file_small.txt 650
runcompss --classpath=application_sources/jar/wordcount.jar wordcount.uniqueFile.Wordcount dataset/data-set/file_long.txt 250000
```
# Build
## Option 1: Native java
```
cd application_sources/; javac src/main/java/wordcount/*.java
cd src/main/java/; jar cf wordcount.jar wordcount/
cd ../../../; mv src/main/java/wordcount.jar jar/
```
## Option 2: Maven
```
cd application_sources/
mvn clean package
```
- Publisher
- [<#ROCrate::Organization https://ror.org/05sd8tv96 @properties={"@id"=>"https://ror.org/05sd8tv96", "@type"=>"Organization", "name"=>"Barcelona Supercomputing Center"}>]
- License
- Apache-2.0
Contents
-
Wordcount.java
Size: 3683
Format: text/plain
-
complete_graph.svg
Size: 129436
Format: [["image/svg+xml", <#ROCrate::ContextualEntity https://www.nationalarchives.gov.uk/PRONOM/fmt/92 @properties={"@id"=>"https://www.nationalarchives.gov.uk/PRONOM/fmt/92", "@type"=>"WebSite", "name"=>"Scalable Vector Graphics"}>]]
-
WordcountItf.java
Size: 703
Format: text/plain
-
Wordcount.java
Size: 2653
Format: text/plain
-
WordcountItf.java
Size: 743
Format: text/plain
-
App_Profile.json
Size: 566
Format: ["application/json", <#ROCrate::ContextualEntity https://www.nationalarchives.gov.uk/PRONOM/fmt/817 @properties={"@id"=>"https://www.nationalarchives.gov.uk/PRONOM/fmt/817", "@type"=>"WebSite", "name"=>"JSON Data Interchange Format"}>]
-
compss_submission_command_line.txt
Size: 138
Format: text/plain
-
ro-crate-info.yaml
Size: 2407
Format: ["YAML", <#ROCrate::ContextualEntity https://www.nationalarchives.gov.uk/PRONOM/fmt/818 @properties={"@id"=>"https://www.nationalarchives.gov.uk/PRONOM/fmt/818", "@type"=>"WebSite", "name"=>"YAML"}>]
-
wordcount.jar
Size: 9568
Format: [["application/java-archive", <#ROCrate::ContextualEntity https://www.nationalarchives.gov.uk/PRONOM/x-fmt/412 @properties={"@id"=>"https://www.nationalarchives.gov.uk/PRONOM/x-fmt/412", "@type"=>"WebSite", "name"=>"Java Archive Format"}>]]
-
Readme
Size: 1843
-
project.xml
Size: 289
-
resources.xml
Size: 983
-
pom.xml
Size: 4235
-
file_long.txt
Size: 16777398
-
file_small.txt
Size: 4872
-
data-set