Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,5 @@ csharp/snippets/**/bin
csharp/snippets/**/obj
csharp/runner/**/bin
csharp/runner/**/obj
*.sln

6 changes: 6 additions & 0 deletions csharp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
The C# snippets are contained in the `snippets` directory under various
directories -- each as its own assembly/project.

## Prerequisites

Before attempting to build the snippets you will need to make the make the
`Senzing.Sdk.[version].nupkg` file available to the `dotnet` executable so
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).

## Building

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.
Expand Down
29 changes: 20 additions & 9 deletions java/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
The Java snippets are contained in the `snippets` directory under various Java package directories.

## Building
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.

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.

## Running

Expand All @@ -15,12 +15,14 @@ There are several ways to run the code snippets.
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.

1. Run a snippet that takes no command-line arguments.
```

```console
java -cp target/sz-sdk-snippets.jar loading.LoadRecords
```

2. Run a snippet and override the input file using command-line arguments
```

```console
java -cp target/sz-sdk-snippets.jar loading.LoadRecordsViaLoop ../../resources/data/load-500-with-errors.jsonl
```

Expand All @@ -32,29 +34,38 @@ then against. This is the `Main-Class` of the `sz-sdk-snippets.jar` file so it
**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).

1. Execute all code snippets:
```

```console
java -jar target/sz-sdk-snippets.jar all
```

2. Execute all code snippets in a Java package:
```

```console
java -jar target/sz-sdk-snippets.jar loading
```

3. Execute all code snippets from multiple packages:
```

```console
java -jar target/sz-sdk-snippets.jar loading redo
```

4. Execute specific code snippets:
```

```console
java -jar target/sz-sdk-snippets.jar loading.LoadViaLoop loading.LoadViaQueue
```

5. Mix and match packages with individual snippets:
```

```console
java -jar target/sz-sdk-snippets.jar redo loading.LoadViaLoop
```

6. Generate a help message by specifying no arguments:
```

```console
java -jar target/sz-sdk-snippets.jar

java -jar sz-sdk-snippets.jar [ all | <group> | <snippet> ]*
Expand Down
9 changes: 5 additions & 4 deletions java/snippets/configuration/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Deleting Data
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.

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.

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.

## Snippets

* **AddDataSources.java**
* Gets the current default config, creates a modified config with additional data sources, registers that modified config and then replaces the default config ID.
* Gets the current default config, creates a modified config with additional data sources, registers that modified config and then replaces the default config ID.
* **InitDefaultConfig.java**
* Initializes the repository with a default config ID using the template configuration provided by Senzing.

* Initializes the repository with a default config ID using the template configuration provided by Senzing.
Loading