Skip to content
Closed
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
2 changes: 1 addition & 1 deletion CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# Each line is a file pattern followed by one or more owners.

# These owners will be the default owners for everything in the repo.
* @rjrudin @NiteshMehta @vishwach @adganta @ashokrprogress @hmadala001 @prgs-rsingh
* @rjrudin @jonmille @ngodugu-marklogic @RitaChen609 @rjdew-progress
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,15 +198,15 @@ are all synonyms):

./gradlew shadowJar

This will produce an assembly jar at `./flux-cli/build/libs/marklogic-flux-*-all.jar`.
This will produce an assembly jar at `./flux-cli/build/libs/marklogic-flux-<version>-all.jar`.

You can now run any CLI command via spark-submit. This is an example of previewing an import of files - change the value
of `--path`, as an absolute path is needed, and of course change the value of `--master` to match that of your Spark
cluster:

```
$SPARK_HOME/bin/spark-submit --class com.marklogic.flux.spark.Submit \
--master spark://NYWHYC3G0W:7077 flux-cli/build/libs/marklogic-flux-*-all.jar \
--master spark://NYWHYC3G0W:7077 flux-cli/build/libs/marklogic-flux-<version>-all.jar \
import-files --path /Users/rudin/workspace/flux/flux-cli/src/test/resources/mixed-files \
--connection-string "admin:admin@localhost:8000" \
--preview 5 --preview-drop content
Expand All @@ -223,7 +223,7 @@ to something you can access):
$SPARK_HOME/bin/spark-submit --class com.marklogic.flux.spark.Submit \
--packages org.apache.hadoop:hadoop-aws:3.3.4,org.apache.hadoop:hadoop-client:3.3.4 \
--master spark://NYWHYC3G0W:7077 \
flux-cli/build/libs/marklogic-flux-*-all.jar \
flux-cli/build/libs/marklogic-flux-<version>-all.jar \
import-files --path "s3a://changeme/" \
--connection-string "admin:admin@localhost:8000" \
--s3-add-credentials \
Expand Down
19 changes: 6 additions & 13 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'net.saliman.properties' version '1.6.0'
id 'net.saliman.properties' version '1.5.2'
id "org.sonarqube" version "7.0.1.6134"
}

Expand Down Expand Up @@ -67,9 +67,9 @@ subprojects {
details.because "Force all io.netty 4.x to ${nettyVersion} to address CVEs including CVE-2026-44249, CVE-2026-50010, and CVE-2026-45416 in netty-handler."
}

if (details.requested.group.equals("org.apache.logging.log4j") && details.requested.version.startsWith("2.")) {
details.useVersion "${log4jVersion}"
details.because "Forces all log4j 2.x artifacts that Spark brings in to ${log4jVersion} to address BDSA-2026-22385 / CVE-2026-49844 and other CVEs."
if (details.requested.group.equals("org.apache.logging.log4j") && details.requested.version.startsWith("2.24")) {
details.useVersion "2.26.0"
details.because "Forces Spark 4.1.x to use latest log4j 2.x to eliminate CVEs."
}

if (details.requested.group.startsWith("com.fasterxml.jackson")) {
Expand All @@ -81,14 +81,11 @@ subprojects {
}
details.because "Force Jackson to 2.21.x to align with Java Client 8.1.0."
}
if (details.requested.group.equals("org.xerial.snappy") && details.requested.name.equals("snappy-java")) {
details.useVersion "${snappyVersion}"
details.because "Forces snappy-java to ${snappyVersion} to remediate 1.1.10.8 CVEs per MLE-33626."
}

if (details.requested.group.equals("org.apache.thrift") && details.requested.name.equals("libthrift")) {
// This is being done solely for Black Duck's sake, as it seems to be having trouble recognizing that the
// internal snapshot build of the MarkLogic Spark connector is already using version 0.24.0.
details.useVersion "0.25.0"
details.useVersion "0.24.0"
details.because "Forces Spark 4.2.x to use the latest libthrift, which is needed to avoid CVEs."
}

Expand All @@ -105,10 +102,6 @@ subprojects {
events = ['started', 'passed', 'skipped', 'failed']
exceptionFormat = 'full'
}
// Explicitly setting this instead of relying on JVM ergonomics, as Spark's tests (e.g. those involving
// broadcast serialization) can trigger a heap OOM when the default max heap ends up too small under
// memory pressure from other processes on the machine.
maxHeapSize = "4g"
jvmArgs = [
// Needed for all Java 17 testing.
"--add-opens", "java.base/sun.nio.ch=ALL-UNNAMED",
Expand Down
39 changes: 19 additions & 20 deletions docs/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,32 +1,34 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (7.1.3)
activesupport (7.2.3.1)
base64
benchmark (>= 0.3)
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
concurrent-ruby (~> 1.0, >= 1.3.1)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
logger (>= 1.4.2)
minitest (>= 5.1, < 6)
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
base64 (0.2.0)
bigdecimal (3.1.6)
base64 (0.3.0)
benchmark (0.5.0)
bigdecimal (4.0.1)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.12.2)
colorator (1.1.0)
commonmarker (0.23.10)
concurrent-ruby (1.2.3)
connection_pool (2.4.1)
concurrent-ruby (1.3.6)
connection_pool (3.0.2)
dnsruby (1.70.0)
simpleidn (~> 0.2.1)
drb (2.2.0)
ruby2_keywords
drb (2.2.3)
em-websocket (0.5.3)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0)
Expand Down Expand Up @@ -98,7 +100,7 @@ GEM
activesupport (>= 2)
nokogiri (>= 1.4)
http_parser.rb (0.8.0)
i18n (1.14.1)
i18n (1.14.8)
concurrent-ruby (~> 1.0)
jekyll (3.9.4)
addressable (~> 2.4)
Expand Down Expand Up @@ -210,7 +212,7 @@ GEM
gemoji (>= 3, < 5)
html-pipeline (~> 2.2)
jekyll (>= 3.0, < 5.0)
json (2.18.1)
json (2.19.2)
kramdown (2.4.0)
rexml
kramdown-parser-gfm (1.1.0)
Expand All @@ -221,18 +223,16 @@ GEM
rb-inotify (~> 0.9, >= 0.9.10)
logger (1.7.0)
mercenary (0.3.6)
mini_portile2 (2.8.9)
minima (2.5.1)
jekyll (>= 3.5, < 5.0)
jekyll-feed (~> 0.9)
jekyll-seo-tag (~> 2.1)
minitest (5.22.2)
mutex_m (0.2.0)
minitest (5.27.0)
net-http (0.9.1)
uri (>= 0.11.1)
nokogiri (1.19.1-arm64-darwin)
nokogiri (1.19.3-arm64-darwin)
racc (~> 1.4)
nokogiri (1.19.1-x86_64-linux-gnu)
nokogiri (1.19.3-x86_64-linux-gnu)
racc (~> 1.4)
octokit (4.25.1)
faraday (>= 1, < 3)
Expand All @@ -246,7 +246,6 @@ GEM
ffi (~> 1.0)
rexml (3.4.2)
rouge (3.30.0)
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
safe_yaml (1.0.5)
sass (3.7.4)
Expand All @@ -257,6 +256,7 @@ GEM
sawyer (0.9.2)
addressable (>= 2.3.5)
faraday (>= 0.17.3, < 3)
securerandom (0.4.1)
simpleidn (0.2.1)
unf (~> 0.1.4)
terminal-table (1.8.0)
Expand All @@ -274,7 +274,6 @@ GEM

PLATFORMS
arm64-darwin-23
ruby
x86_64-linux

DEPENDENCIES
Expand Down
4 changes: 2 additions & 2 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Or if you are using Gradle, add the following to your `build.gradle` file:

```
dependencies {
implementation "com.marklogic:flux-api:2.0.0"
implementation "com.marklogic:flux-api:2.1.2"
}
```

Expand Down Expand Up @@ -161,7 +161,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath "com.marklogic:flux-api:2.0.0"
classpath "com.marklogic:flux-api:2.1.2"
}
}
```
Expand Down
52 changes: 6 additions & 46 deletions docs/import/classifier.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,9 @@ The table below lists each of the options used to configure how the classifier i
| `--classifier-path` | Specify the path of the classifier service. |
| `--classifier-api-key` | Provide the API key for accessing the classifier service when hosted in Progress Data Cloud. |
| `--classifier-token-path` | Specify the path to the token generator for the classifier service when hosted in Progress Data Cloud. |
| `--classifier-batch-size` | Set the number of text chunks to send in a single request to the classifier. Defaults to 20. |
| `--classifier-batch-size` | Set the number of documents or text chunks to send in a single request to the classifier. Defaults to 20. |
| `--classifier-socket-timeout` | Set the socket timeout in seconds for classification requests. Defaults to 10. |
| `--classifier-connection-timeout` | Set the connection timeout in seconds for classification requests. Defaults to 10. |
| `--classifier-skip-document` | Classify only chunks of text and skip classifying each whole document. Requires `--splitter-*` options; otherwise no text is classified. |
| `--classifier-prop key=value` | Specify additional options for configuring the behavior of the classifier service. |

As an example, the following options - applicable to any import command - would result in the text of each document
Expand All @@ -66,54 +65,15 @@ to be written to MarkLogic having classification added to it, generated via Sema
{% endtab %}
{% endtabs %}

## Classifying only chunks

When you combine classification with [splitting text into chunks](splitting.md), Flux performs two types of
classification by default:

1. Each whole document is sent to the classifier in its own request, and the resulting classification is added at the
document level (on the source document, or on the extracted-text document when `--extract-text` is used).
2. The text chunks are grouped into multi-article requests (controlled by `--classifier-batch-size`), and each chunk
receives its own classification.

If you only need classification on the chunks, include `--classifier-skip-document`. This avoids one classifier request
per document—reducing total request volume and helping stay within licensed concurrency limits—and omits the
document-level classification element while still classifying all chunks. Note that `--classifier-skip-document` should
be used together with `--splitter-*` options (or Nuclia); otherwise, no text will be classified.

For example, the following options split the text of each document into chunks and classify only the chunks:

{% tabs log %}
{% tab log Unix %}
```
--splitter-text \
--classifier-host example.org \
--classifier-port 443 \
--classifier-path "/cls/dev/cs1/" \
--classifier-skip-document
```
{% endtab %}
{% tab log Windows %}
```
--splitter-text ^
--classifier-host example.org ^
--classifier-port 443 ^
--classifier-path "/cls/dev/cs1/" ^
--classifier-skip-document
```
{% endtab %}
{% endtabs %}

## Configuring batch processing

When classifying chunks of text, the performance of the Semaphore classifier is typically improved by having Flux send
more than one chunk at a time to the classifier (each whole document, when not skipped, is always sent in its own
request). Flux defaults to sending the text of up to 20 chunks in each multi-article request to the classifier. You
The performance of the Semaphore classifier is typically improved by having Flux send more than one document at a time
to the classifier. Flux defaults to sending the text of up to 20 documents in each request to the classifier. You
can control this via the `--classifier-batch-size` option.

The appropriate value for this option will depend on the size of your chunks and the performance characteristics of
your Semaphore instance. For small chunks, you may find improved performance by increasing the batch size to a
higher number, and vice versa for larger chunks.
The appropriate value for this option will depend on the size of your documents and the performance characteristics of
your Semaphore instance. For small documents, you may find improved performance by increasing the batch size to a
higher number, and vice versa for larger documents.

## Configuring the behavior of the classifier service

Expand Down
4 changes: 4 additions & 0 deletions docs/import/embedder/embedder.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,10 @@ also use a [MarkLogic REST transform](https://docs.marklogic.com/guide/rest-dev/
embeddings are stored in your documents. See the [guide on common import options](../common-import-features.md) for more
information on transforms.

Flux records the model name reported by the selected embedding model on each chunk as a `model-name` property in JSON
or a `model-name` element in XML. For Ollama, this is the name configured with `--embedder-prop model-name`. If an
integration does not report a specific name, the value is `unknown`.

### JSON documents

By default, Flux will store an embedding in an array named `_vector` that is added to the chunk object. Each value in
Expand Down
6 changes: 3 additions & 3 deletions docs/spark-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Flux integrates with [spark-submit](https://spark.apache.org/docs/latest/submitt
submit a Flux command invocation to a remote Spark cluster. Every Flux command is a Spark application, and thus every
Flux command, along with all of its option, can be invoked via `spark-submit`.

To use Flux with `spark-submit`, first download the `marklogic-flux-2.1.0-all.jar` file from the
To use Flux with `spark-submit`, first download the `marklogic-flux-2.1.2-all.jar` file from the
[GitHub release page](https://github.com/marklogic/flux/releases). This jar file includes Flux and all of
its dependencies, excluding those of Spark itself, which will be provided via the Spark cluster that you connect to
via `spark-submit`.
Expand All @@ -51,7 +51,7 @@ The following shows a notional example of running the Flux `import-files` comman
```
$SPARK_HOME/bin/spark-submit --class com.marklogic.flux.spark.Submit \
--master spark://changeme:7077 \
marklogic-flux-2.1.0-all.jar \
marklogic-flux-2.1.2-all.jar \
import-files \
--path path/to/data \
--connection-string user:password@host:8000 \
Expand All @@ -62,7 +62,7 @@ $SPARK_HOME/bin/spark-submit --class com.marklogic.flux.spark.Submit \
```
$SPARK_HOME\bin\spark-submit --class com.marklogic.flux.spark.Submit ^
--master spark://changeme:7077 ^
marklogic-flux-2.1.0-all.jar ^
marklogic-flux-2.1.2-all.jar ^
import-files ^
--path path/to/data ^
--connection-string user:password@host:8000 ^
Expand Down
6 changes: 3 additions & 3 deletions examples/client-project/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ buildscript {
mavenLocal()
}
dependencies {
classpath "com.marklogic:flux-api:2.0.0"
classpath "com.marklogic:flux-api:2.1.2"
}
}

Expand All @@ -30,8 +30,8 @@ repositories {
}

dependencies {
implementation "com.marklogic:flux-api:2.0.0"
implementation "com.marklogic:flux-embedding-model-minilm:2.0.0"
implementation "com.marklogic:flux-api:2.1.2"
implementation "com.marklogic:flux-embedding-model-minilm:2.1.2"
}

/**
Expand Down
9 changes: 5 additions & 4 deletions flux-cli/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'net.saliman.properties' version '1.6.0'
id 'net.saliman.properties' version '1.5.2'
id "application"
id "jacoco"
id 'com.gradleup.shadow' version '9.2.1'
Expand All @@ -15,7 +15,8 @@ configurations {
// Resolves a medium CVE that comes from json-unit-assertj .
force "net.minidev:json-smart:2.5.2"

force "at.yawk.lz4:lz4-java:1.12.1"
// Resolves a CVE in 1.11.0
force "at.yawk.lz4:lz4-java:1.11.1"
}
}
}
Expand All @@ -30,7 +31,7 @@ dependencies {
implementation "info.picocli:picocli:${picocliVersion}"

// Need this for compilation as it's not an API dependency of the Spark connector.
compileOnly "com.marklogic:marklogic-client-api:8.3-SNAPSHOT"
compileOnly "com.marklogic:marklogic-client-api:8.1.0"

// The shadow jar intended for usage with spark-submit needs the above "core" libraries as well, but not the Spark
// API since spark-submit provides that.
Expand Down Expand Up @@ -132,7 +133,7 @@ distributions {
distributionBaseName = "marklogic-flux"
contents {
from("..") {
include "LICENSE.txt"
include "LICENSE"
include "NOTICE.txt"
}
from("hadoop") {
Expand Down
Loading
Loading