diff --git a/.gitignore b/.gitignore index 9715ddd..a0f652a 100644 --- a/.gitignore +++ b/.gitignore @@ -140,4 +140,5 @@ csharp/snippets/**/bin csharp/snippets/**/obj csharp/runner/**/bin csharp/runner/**/obj +*.sln diff --git a/csharp/README.md b/csharp/README.md index 3f6a4a4..847cebe 100644 --- a/csharp/README.md +++ b/csharp/README.md @@ -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. diff --git a/java/README.md b/java/README.md index 06ed252..d5efc1a 100644 --- a/java/README.md +++ b/java/README.md @@ -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 @@ -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 ``` @@ -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 | | ]* diff --git a/java/snippets/configuration/README.md b/java/snippets/configuration/README.md index 5537d31..ac8118e 100644 --- a/java/snippets/configuration/README.md +++ b/java/snippets/configuration/README.md @@ -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.