Skip to content

Commit b85e7bd

Browse files
authored
Updated README.md files for formatting & additional C# instructions. (#23)
* Java and C# Code Snippets for 4.0.0 Beta 2 * Updated CHANGELOG.md for C# examples and Java example updates * Updated README.md files for formatting and additional C# instructions
1 parent 5e477a1 commit b85e7bd

File tree

4 files changed

+32
-13
lines changed

4 files changed

+32
-13
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -140,4 +140,5 @@ csharp/snippets/**/bin
140140
csharp/snippets/**/obj
141141
csharp/runner/**/bin
142142
csharp/runner/**/obj
143+
*.sln
143144

csharp/README.md

+6
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
The C# snippets are contained in the `snippets` directory under various
44
directories -- each as its own assembly/project.
55

6+
## Prerequisites
7+
8+
Before attempting to build the snippets you will need to make the make the
9+
`Senzing.Sdk.[version].nupkg` file available to the `dotnet` executable so
10+
it can be used as a dependency. This is done via these [instructions](https://github.com/senzing-garage/sz-sdk-csharp/blob/main/README.md#Usage).
11+
612
## Building
713

814
The C# snippets can built using the `dotnet build [project-name]` command under each directory. They can be run using `dotnet run --project [project-name]` command. Attempting to run a snippet will also trigger building it.

java/README.md

+20-9
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
The Java snippets are contained in the `snippets` directory under various Java package directories.
44

55
## Building
6-
The Java snippets can built using the `pom.xml` in this directory using `mvn package`. The result will be the `sz-sdk-snippets.jar` file in the `target` directory.
76

7+
The Java snippets can built using the `pom.xml` in this directory using `mvn package`. The result will be the `sz-sdk-snippets.jar` file in the `target` directory.
88

99
## Running
1010

@@ -15,12 +15,14 @@ There are several ways to run the code snippets.
1515
You may run any individual Snippet class directly providing you have a Senzing repository to run it with and the `SENZING_ENGINE_CONFIGURATION_JSON` environment variable set for connecting to that repository. Many of the snippets will find a default data file to run with if run from this directory, but also allow the caller to use a different data file if given by the first command-line argument.
1616

1717
1. Run a snippet that takes no command-line arguments.
18-
```
18+
19+
```console
1920
java -cp target/sz-sdk-snippets.jar loading.LoadRecords
2021
```
2122

2223
2. Run a snippet and override the input file using command-line arguments
23-
```
24+
25+
```console
2426
java -cp target/sz-sdk-snippets.jar loading.LoadRecordsViaLoop ../../resources/data/load-500-with-errors.jsonl
2527
```
2628

@@ -32,29 +34,38 @@ then against. This is the `Main-Class` of the `sz-sdk-snippets.jar` file so it
3234
**NOTE:** When code snippets are run this way you cannot specify command-line arguments for individual snippets, nor can you respond to command-line input requests (they will be automatically be responded by the runner -- including forced termination of a snippet that is intended to run indefinitely).
3335

3436
1. Execute all code snippets:
35-
```
37+
38+
```console
3639
java -jar target/sz-sdk-snippets.jar all
3740
```
3841

3942
2. Execute all code snippets in a Java package:
40-
```
43+
44+
```console
4145
java -jar target/sz-sdk-snippets.jar loading
4246
```
4347

4448
3. Execute all code snippets from multiple packages:
45-
```
49+
50+
```console
4651
java -jar target/sz-sdk-snippets.jar loading redo
4752
```
53+
4854
4. Execute specific code snippets:
49-
```
55+
56+
```console
5057
java -jar target/sz-sdk-snippets.jar loading.LoadViaLoop loading.LoadViaQueue
5158
```
59+
5260
5. Mix and match packages with individual snippets:
53-
```
61+
62+
```console
5463
java -jar target/sz-sdk-snippets.jar redo loading.LoadViaLoop
5564
```
65+
5666
6. Generate a help message by specifying no arguments:
57-
```
67+
68+
```console
5869
java -jar target/sz-sdk-snippets.jar
5970

6071
java -jar sz-sdk-snippets.jar [ all | <group> | <snippet> ]*

java/snippets/configuration/README.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
# Deleting Data
2-
The configuration snippets outline how to modify the Senzing configuration, register the modified configuration with a configuration ID and update the default configuration ID for the repository.
2+
3+
The configuration snippets outline how to modify the Senzing configuration, register the modified configuration with a configuration ID and update the default configuration ID for the repository.
34

45
You may either `setDefaultConfigId()` or `replaceDefaultConfigId()`. Initially, the the default config ID must be set since there is no existing config ID to replace. However, when updating you may use `replaceDefaultConfigId()` to guard against race conditions of multiple threads or processes updating at the same time.
56

67
## Snippets
8+
79
* **AddDataSources.java**
8-
* Gets the current default config, creates a modified config with additional data sources, registers that modified config and then replaces the default config ID.
10+
* Gets the current default config, creates a modified config with additional data sources, registers that modified config and then replaces the default config ID.
911
* **InitDefaultConfig.java**
10-
* Initializes the repository with a default config ID using the template configuration provided by Senzing.
11-
12+
* Initializes the repository with a default config ID using the template configuration provided by Senzing.

0 commit comments

Comments
 (0)