Commit Graph
893 Commits
Author SHA1 Message Date
Mr. Patrickus AgbiusandClaude Opus 5.5 69a808496b Only release query cache lock when acquired (#4157)
Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-02 19:36:50 +00:00
Kevin Toth c81c9fdc12 Update pom's for 8.6.0-SNAPSHOT 2026-10-29 11:47:11 +00:00
Kevin Toth 095ca160b2 Update pom's for 8.5.0-SNAPSHOT 2026-10-22 15:14:39 +00:00
Moriarty 46f9572e83 Migrate web query limits and runner tests (#4031) 2026-10-16 00:58:49 +00:00
Moriarty 0f96ad8299 Migrate composite web query logic test (#4025) 2026-10-15 12:14:16 +00:00
Kevin Toth 6f5624cc8c Update pom's for 8.4.0-SNAPSHOT 2026-10-13 10:31:37 +00:00
Kevin Toth 46e2ecddc5 8.2.1-SNAPSHOT 2026-10-05 12:23:56 +00:00
Kevin Toth 9bde7da67e 8.2.0 2026-10-05 12:23:35 +00:00
Kevin Toth a68175c01a Update pom's for 8.3.0-SNAPSHOT 2026-10-05 12:19:46 +00:00
Laura Schanno ac7ac7e78e Do not silently drop system limit configurations (#3820) 2026-10-01 19:09:02 +00:00
Laura SchannoandIvan Bella 692ab2b62e Do not silently drop group limit overrides (#3819)
Co-authored-by: Ivan Bella <[email protected]>
2026-09-30 12:34:28 +00:00
Kevin Toth 045de2e906 Update pom's for 8.2.0-SNAPSHOT 2026-09-21 11:07:38 +00:00
Kevin Toth b646acb79b Update pom's for 8.1.0-SNAPSHOT 2026-09-02 15:05:37 +00:00
807d61b52e Migrate to Wildfly 26.1.3.Final (#3508)
Co-authored-by: Ivan Bella <[email protected]>
Co-authored-by: Bill Oley <[email protected]>
Co-authored-by: Moriarty <[email protected]>
Co-authored-by: Claude Opus 5 <[email protected]>
2026-09-02 14:04:28 +00:00
Kevin Toth c8c648e12a Update pom's for 7.47.0-SNAPSHOT 2026-08-31 16:31:44 +00:00
Kevin Toth ed50f5a76f Update pom's for 7.46.0-SNAPSHOT 2026-08-26 15:39:22 +00:00
Laura SchannoandMoriarty bd25e04589 Improve thread-safety of QueryUncaughtExceptionHandler (#3832)
Make the following changes to improve the thread-safety of
QueryUncaughtExceptionHandler, and add test coverage.
- Generate a sequence for each call to uncaughtException() to help
ensure the first call with a non-null Throwable wins the race,
regardless of which thread's CAS operation completes first.
- In uncaughtException(), atomically update the sequence number, thread,
and throwable at the same time.
- Use an efficient, thread-safe collection for storing and retrieving
messages.

---------

Co-authored-by: Moriarty <[email protected]>
2026-08-24 11:28:57 +00:00
hgklohr a3b817a85b Update pom's for 7.45.0-SNAPSHOT 2026-08-13 16:56:05 +00:00
hgklohr 2fa747e48e Update pom's for 7.44.0-SNAPSHOT 2026-08-05 13:44:37 +00:00
MoriartyandClaude Sonnet 5 8077f849b0 Fix remaining flakiness in QueryExecutorBeanTest#testPredict (#3723)
## Summary
- `QueryMetric`'s `createDate` is stamped from wall-clock time
(truncated to the second) and is part of `equals()`/`hashCode()`. A
prior fix (#3658) worked around a resulting flake in `testPredict()` by
relaxing a Mockito `eq(metric)` matcher to `any(BaseQueryMetric.class)`,
but that gave up on verifying the actual metric passed to the predictor.
- This restores strict matching without the race: `QueryMetricFactory`
is mocked directly, and `ReflectionTestUtils.setField(m, "createDate",
...)` pins the same `createDate` on both the metric the bean builds
internally and the metric built for comparison in the test, so the two
sides can no longer straddle a second boundary.
- No production code changes — confined to the test file.

## Test plan
- [x] `mvn -pl web-services/query -Dtest=QueryExecutorBeanTest test` —
9/9 pass
- [x] `testPredict` re-run 5x in a row to confirm no flakiness

Co-authored-by: Claude Sonnet 5 <[email protected]>
2026-07-22 20:43:05 +00:00
hgklohr 3aeffd7c56 Update pom's for 7.43.0-SNAPSHOT 2026-07-21 15:40:23 +00:00
alerman 14b657084d Fix caching (#3658) 2026-07-21 11:24:04 +00:00
Drew Farris c0e9cff9f8 Adds truthmark tables, for storing human-generated annotations (#3686) 2026-07-14 20:08:10 +00:00
MoriartyandClaude Sonnet 4.6 16e61e196d ban powermock (#3644)
ban powermock dependency and import

---------

Co-authored-by: Claude Sonnet 4.6 <[email protected]>
2026-06-30 13:46:03 +00:00
ade138565c Migrate ExtendedQueryExecutorBeanTest to Mockito/JUnit5 (#3616)
## Summary

- Replace EasyMock/PowerMock with Mockito (`when/thenReturn`,
`doReturn/doThrow`, `spy`)
- Replace JUnit4 annotations (`@Before`, `@RunWith`, `@Ignore`) with
JUnit5 equivalents
- Convert `@Test(expected=X)` to `assertThrows`
- Fix assertion argument order for JUnit5 (message moves to last
position)
- Replace `setInternalState` (PowerMock Whitebox) with
`ReflectionTestUtils.setField`
- Replace `createPartialMock` with `spy(new X())` + `doReturn`
- Remove EasyMock replay/verify scaffolding
- Add `@MockitoSettings(strictness = Strictness.LENIENT)` to suppress
unused-stub warnings
- 71 tests, 0 failures (2 pre-existing `@Disabled` tests skipped)

## Test plan

- [ ] `mvn -pl web-services/query test
-Dtest=ExtendedQueryExecutorBeanTest` passes with 71 tests, 0 failures

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Sonnet 4.6 <[email protected]>
Co-authored-by: palindrome <[email protected]>
2026-06-29 16:54:52 +00:00
MoriartyandClaude Sonnet 4.6 8ca6b695e7 Migrate QueryExecutorBeanTest to Mockito/JUnit5 (#3613)
## Summary

- Replaces JUnit4/PowerMock/EasyMock with JUnit5/Mockito in
`QueryExecutorBeanTest`
- Removes `@RunWith(PowerMockRunner.class)`, `@PrepareForTest`, and
`@PowerMockIgnore` in favour of `@ExtendWith(MockitoExtension.class)`
with `LENIENT` strictness
- Converts all `createStrictMock`/`createMock` → `mock()`,
`expect/andReturn/replayAll/verifyAll` → `when/thenReturn`, and
`IAnswer` → `Answer` lambdas
- Replaces `Whitebox.setInternalState`/`getInternalState` with
`ReflectionTestUtils.setField`/`getField`
- Removes `suppress(constructor(DefaultQueryParameters.class))` — safe
because production code calls `qp.clear()`, not `new
DefaultQueryParameters()`
- Uses static imports for all JUnit assertions

## Test plan

- [ ] `mvn -pl web-services/query test -Dtest=QueryExecutorBeanTest` —
all 9 tests pass
- [ ] `mvn -pl web-services/query clean test` — full module build passes
(30 test classes, 0 failures)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Sonnet 4.6 <[email protected]>
2026-06-26 09:17:52 +00:00
MoriartyandClaude Sonnet 4.6 1cc8844dec Replace deprecated datawave.util.TableName with datawave.table.constants.TableName (#3641)
## Summary

- Replaces all 120 uses of `datawave.util.TableName` (deprecated since
7.40.0, `forRemoval=true`) with the new
`datawave.table.constants.TableName` class in `core/tables`
- Adds an explicit `datawave-core-tables` dependency to
`core/query/pom.xml` — the only affected module that didn't already have
it transitively

## Test plan

- [x] Formatting build passes (`mvn clean install -DskipTests
-DskipITs`)
- [x] Full test suite passes on CI

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Sonnet 4.6 <[email protected]>
2026-06-25 16:16:47 +00:00
137060691b Migrate QueryMetricsEnrichmentInterceptorTest to Mockito/JUnit5 (#3610)
Replace PowerMock/EasyMock with Mockito (MockedStatic for
FindAnnotation, ReflectionTestUtils for field access) and upgrade JUnit4
to JUnit5.

---------

Co-authored-by: Claude Sonnet 4.6 <[email protected]>
Co-authored-by: palindrome <[email protected]>
2026-06-23 16:08:11 +00:00
hgklohr 7691b73e6b Update pom's for 7.42.0-SNAPSHOT 2026-06-18 20:06:11 +00:00
Laura Schannoandhgklohr 4a5f37cd03 Use same Zookeeper client for all QueryHeartbeats (#3612)
The ActiveQueryTracker creates a new zookeeper client everytime we
create a new QueryHeartbeat via ActiveQueryTracker.trackQuery(). This
client does not get closed and results in ever-increasing Curator
Framework threads that eventually affect server performance.

Make changes to effect the following:
- Reuse the same ActiveQueryTracker zookeeper client when creating new
heartbeats.
- Modify the ActiveQueryTracker to ensure this client is not
periodically cleaned up, and is instead kept alive for the lifetime of
the ActiveQueryTracker instance.
- Update documentation.

Co-authored-by: hgklohr <[email protected]>
2026-06-18 12:56:16 +00:00
Ivan Bella 04328e9a50 Added debugging to see if we can figure out how RunnningQuery can hang (#3611) 2026-06-17 18:34:04 +00:00
Joe Alphonso b3a6bbd133 Setting next Development version to 7.41.2-SNAPSHOT 2026-06-12 17:29:46 -04:00
Joe Alphonso 8bf504e095 Preparing for 7.41.1 Release 2026-06-12 17:29:01 -04:00
Joe Alphonso 22793bd004 Setting next Development version to 7.41.1-SNAPSHOT 2026-06-12 16:24:06 -04:00
Joe Alphonso f522829b14 Preparing for 7.41.0 Release 2026-06-12 16:20:53 -04:00
Joseph AlphonsoandJoe Alphonso 336293cafc Replace Markings Map with POJO (#3469)
update accumulo-utils to use a POJO for storing markings and then
updated the rest of the codebase that referenced it.
replaced some of the ColumnVisibility usage with AccessExpression to
improve performance.

---------

Co-authored-by: Joe Alphonso <[email protected]>
2026-06-12 15:25:43 -04:00
hgklohr 872f374ec5 Update pom's for 7.41.0-SNAPSHOT 2026-06-09 17:24:05 +00:00
aea68234ea Fix QueryLimiter CDI injection (#3537)
Ensure the QueryLimiter is properly injected into the CachedResultsBean
and the QueryExpirationBean.

Fixes #3536

---------

Co-authored-by: foster33 <[email protected]>
Co-authored-by: Drew Farris <[email protected]>
2026-06-02 16:06:54 +00:00
hgklohr d637c2d050 Update pom's for 7.40.0-SNAPSHOT 2026-05-20 11:17:19 +00:00
Joseph AlphonsoandJoe Alphonso bd90fde6fd fix flaky tests (#3538)
**IndexExpansionQueryTest.java**
- Due to the random nature of these tests the
DatawaveFatalQueryException is not always thrown

**QueryLimiterConcurrencyTest.java**
- query creation time allowance is too short when running tests
concurrently (100L -> 250L)

**ExtendedRunningQueryTest.java**
- resolves race condition by explicitly setting the list of boolean
return values for the hasNext mock

Co-authored-by: Joe Alphonso <[email protected]>
2026-05-07 18:49:22 +00:00
Moriarty c92d0de5b5 Migrate ExtendedRunningQueryTest from PowerMock/JUnit4 to Mockito/JUnit5 (#3531) 2026-05-01 15:23:51 +00:00
2e0fc4187b Add ability to enforce concurrent query limits (#3257)
## Configuration
Add the ability to enforce concurrent query limits across a group of
webservers. Zookeeper is used to track active queries and the following
data:
- The query ID
- The user who submitted the query
- The system the query was submitted on
- The query logic the query originated from

Query limit enforcement is done through the `QueryLimiter` class. Given
a user, system, and query logic, it can determine if any of the
following limits have been exceeded:

- The max allowed concurrent queries for the user.
- The max allowed concurrent queries of the query logic for the user.
- The max allowed concurrent queries for the system.
- The max allowed concurrent queries of the query logic for the system.

Limits may be defined and customized on a per-user and per-system basis.
They may also be defined for groups of query logics. The classes
`UserLimitProvider`, `SystemLimitProvider`, and
`QueryLogicGroupLimitProvider` are respectively responsible for
identifying the best limits to enforce for a user, system, and query
logic. They will be initialized in the `QueryLimiter` after providing a
`QueryLimitConfiguration` instance. The following can be configured:

On a system-wide basis:
- The default concurrent user query limit. This applies to the total
number of queries a user may run across all systems. May be overridden
per user.
- The default concurrent system query limit. Primarily to avoid a system
getting overloaded. May be overridden per system.

On a per-system basis:
- The system name/ids the configuration targets. Regex matching is
supported. Pattern uniqueness is enforced.
- The concurrent system query limit. Overrides the system-wide value.
- Whether queries submitted to the system count towards a user's
concurrent query total. This is always true unless specified otherwise.
- The concurrent system query limit for different query logic groups.
Regex matching against group names is supported. Pattern uniqueness is
enforced.

On a per-user basis:
- The user DN.
- The user's concurrent query limit. Overrides the system-wide
configuration.
- The user's concurrent query limit for different query logic groups.
Regex matching against group names is supported.

On a per-query-logic-group basis:
- The group name.
- The query logics included in the group. Regex matching is supported.
Pattern uniqueness is enforced.
- The default concurrent user query limit. This applies to the total
concurrent queries a user may run that originate from a query logic in
the group across all systems.

Given the possibilities for exact matches, partial regex matches, and
wildcard regex matches, the determination of the best limit to use for
any particular system, query logic, or query logic group is done by
sorting matches into the following 'matching buckets' (in best-match
priority):

1. Exact match: We attempt to find an exact match first and use the
associated limit.
2. Partial regex (non-wildcard-only): If we cannot find an exact match,
then we attempt to find all partial matches, and see if any of their
limits are met.
3. Wildcard-only regex: In the case of no exact or partial matches, we
use the wildcard match with the lowest limit.

## Implementation

Checking limits and marking as active/inactive is done through the
`QueryLimiter` class. The three main methods to know are:
- `QueryLimiter.checkForLimits()`
- `QueryLimiter.countQueryTowardsLimits()`
- `QueryLimiter.stopCountingQueryTowardsLimits()`

When a query is marked as active via
`QueryLimiter.countQueryTowardsLimits()`, it will delegate to the
ActiveQueryTracker, which will in turn create nodes in Zookeeper under
the `ActiveQueries` namespace. When `ActiveQueryTracker.trackQuery()` is
called, the following nodes are created:

```
# Container nodes
/users/<userDn>/<queryLogic> # Only for queries on systems that count towards user limit
/systems/<system>/<queryLogic>
/distinctQueryLogics/<queryLogic>  [Only created if it does not exist.]

# Ephemeral nodes. These will auto-delete themselves if their associated Zookeeper connection ever goes down.
/users/<userDn>/<queryLogic>/<queryId> # Only for queries on systems that count towards user limit
/systems/<system>/<queryLogic>/<queryId>
```

`ActiveQueryTracker.trackQuery()` will return a `QueryHeartbeat` that
contain a list of `PersistentNode` (provided by the Apache Curator
library) wrappers around the ephemeral nodes listed above. The
`QueryHeartbeat` will maintain the connection to Zookeeper and attempt
to keep the ephemeral nodes present in Zookeeper until
`QueryHeartbeat.stop()` is called. If `QueryHeartbeat.stop()` is called,
or the webserver crashes, the ephemeral nodes will automatically be
deleted by Zookeeper.

The following error codes have been added:
```
412-20  - Concurrent query limit exceeded
500-164 - Error checking concurrent query limits
```
Closes #3100

---------

Co-authored-by: Bill Oley <[email protected]>
Co-authored-by: foster33 <[email protected]>
Co-authored-by: Ivan Bella <[email protected]>
2026-04-29 16:01:21 +00:00
hgklohr 75e32682d2 Update pom's for 7.39.0-SNAPSHOT 2026-04-27 11:11:00 +00:00
Moriarty b4af3e5520 Remove Powermock from CreatedQueryLogicCacheBeanTest (#3516)
Remove Powermock from CreatedQueryLogicCacheBeanTest

Replaces System.currentTimeMillis() call with Clock.millis(), allowing
for easier mocking in unit tests.

Refactored CreatedQueryLogicCacheBeanTest such that asserts are more
behavior driven and declarative.
2026-04-23 13:40:05 +00:00
Ivan Bella 1ab1fb4a92 Updated the RunningQuery to use an injected ExecutorService. (#3522)
Updated the QueryExecutorBean amongst other clases to set the
ExecutorService on the RunningQuery as the ManagedExecutorService. The
ManagerExecutorService will handle passing the roles onto the threads
which allows query logics to make calls to other EJBs as needed.
2026-04-23 12:30:22 +00:00
Moriarty 2faf82d200 Remove some instances of PowerMock from web-services/query module (#3518)
Remove some instances of PowerMock from web-services/query module

Completely refactored ConfiguredQueryLogicFactoryBeanTest to rely on
Spring as much as possible

Deleted redundant QueryLogicFactoryBeanTest
2026-04-20 08:34:10 +00:00
hgklohr d40f3c82cb Update pom's for 7.38.0-SNAPSHOT 2026-03-30 19:41:29 +00:00
Ivan Bella b16ab4cc62 Updated the running query to use the asynchronous results thread all the (#3473)
time (can be overridden).
2026-03-28 11:43:56 -04:00
hgklohr 06a5cb73d9 Update pom's for 7.37.0-SNAPSHOT 2026-03-11 16:12:52 +00:00
hgklohr 18e3bb7c7d Update pom's for 7.36.0-SNAPSHOT 2026-02-20 15:58:01 +00:00