Skip to content
Open
Show file tree
Hide file tree
Changes from 14 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
15 changes: 15 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
<version.arquillian-weld-ee-embedded>1.0.0.Final</version.arquillian-weld-ee-embedded>
<version.assertj>3.20.2</version.assertj>
<version.avro>1.11.4</version.avro>
<version.awaitutility>4.3.0</version.awaitutility>
<version.byte-buddy>1.14.11</version.byte-buddy>
<version.caffeine>3.1.0</version.caffeine>
<version.commons-beanutils>1.9.4</version.commons-beanutils>
Expand Down Expand Up @@ -117,6 +118,7 @@
<version.jjwt>0.11.2</version.jjwt>
<version.json>20231013</version.json>
<version.jts>1.19.0</version.jts>
<version.junit-pioneer>2.3.0</version.junit-pioneer>
<version.junit4>4.13.2</version.junit4>
<version.junit5>5.12.0</version.junit5>
<version.junit5.platform>1.12.0</version.junit5.platform>
Expand Down Expand Up @@ -149,6 +151,8 @@
<!-- Different version of weld for tests since the Arquillian embedded EE container needs an older version. -->
<version.weld-test>2.3.5.Final</version.weld-test>
<version.wildfly>17.0.1.Final</version.wildfly>
<!-- The version of jackson provided by Wildfly 17. -->
<version.wildfly.jackson>2.9.9</version.wildfly.jackson>
<version.woodstox-core>5.4.0</version.woodstox-core>
<version.woodstox-stax2>3.1.4</version.woodstox-stax2>
<version.xerces>2.12.2</version.xerces>
Expand Down Expand Up @@ -1137,6 +1141,11 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId>
<version>${version.awaitutility}</version>
</dependency>
<dependency>
<groupId>org.eclipse.emf</groupId>
<artifactId>org.eclipse.emf.common</artifactId>
Expand Down Expand Up @@ -1469,6 +1478,12 @@
<version>${version.weld-test}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit-pioneer</groupId>
<artifactId>junit-pioneer</artifactId>
<version>${version.junit-pioneer}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ public class CachedResultsBean {
private AccumuloConnectionRequestBean accumuloConnectionRequestBean;

@Inject
@SpringBean(name = "queryLimiter")
private QueryLimiter queryLimiter;

protected static final String COMMA = ",";
Expand Down
10 changes: 10 additions & 0 deletions web-services/deploy/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@
<groupId>gov.nsa.datawave</groupId>
<artifactId>datawave-metrics-core</artifactId>
<version>${project.version}</version>
<exclusions>
<exclusion>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>gov.nsa.datawave</groupId>
Expand All @@ -63,6 +69,10 @@
<groupId>gov.nsa.datawave.core</groupId>
<artifactId>datawave-core-connection-pool</artifactId>
</exclusion>
<exclusion>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,42 @@
<property name="cleanupUnit" value="MINUTES"/>
</bean>

<!-- Configuration for the QueryLimiter. -->
<!-- Configuration for the ZkObjectPublisher.
- zookeeperConfigs: A comma-delimited list of Zookeeper hosts, or a path to a zookeeper config file, e.g., host:2181,host2:2181, or
file:///opt/datawave/zookeeper-warehouse/conf/zoo.cfg
- hdfsConfigUrls: A comma-delimited list of HDFS configuration files, e.g.
file:///opt/datawave/hadoop-warehouse/conf/core-site.xml,file:///opt/datawave/hadoop-warehouse/conf/hdfs-site.xml
- namespace: The unique namespace used by this ZkObjectPublisher. It is critical that each configured
ZkObjectPublisher uses a unique namespace to prevent conflicting writes of attempt statuses.
- objectClass: The fully qualified class name of the class that will be deserialized from the file whose filepath
is set in the data of the node <namespace>/path in Zookeeper.
- objectValidators: A list of validators that deserialized instances of the object must pass before they will be
published to subscribers.
-->
<bean id="queryLimitConfigValidator" class="datawave.webservice.query.limit.QueryLimitConfigurationValidator" />
<bean id="queryLimitConfigPublisher" class="datawave.webservice.zookeeper.ZkObjectPublisher">
<constructor-arg name="zookeeperConfig" value="${zookeeper.hosts}"/>
<constructor-arg name="hdfsConfigUrls" value="${hdfs.site.config.urls}"/>
<constructor-arg name="namespace" value="QueryLimitConfig"/>
<constructor-arg name="objectClass" value="datawave.webservice.query.limit.QueryLimitConfiguration"/>
<constructor-arg name="objectValidators">
<list>
<ref bean="queryLimitConfigValidator"/>
</list>
</constructor-arg>
</bean>

<!-- Configuration for the QueryLimiter.
- zookeeperConfigs: A comma-delimited list of Zookeeper hosts, or a path to a zookeeper config file, e.g., host:2181,host2:2181, or
file:///opt/datawave/zookeeper-warehouse/conf/zoo.cfg
- configuration: The reference to the target configuration bean
- heartbeatCache: The reference to the heartbeat cache
- configPublisher: The reference to the config publisher
-->
<bean id="queryLimiter" class="datawave.webservice.query.limit.QueryLimiter" init-method="setup" destroy-method="shutdown">
<property name="zookeeperConfig" value="${zookeeper.hosts}"/>
<property name="configuration" ref="queryLimitConfiguration"/>
<property name="heartbeatCache" ref="queryHeartbeatCache"/>
<property name="configPublisher" ref="queryLimitConfigPublisher"/>
</bean>
</beans>
22 changes: 22 additions & 0 deletions web-services/query/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,20 @@
<artifactId>datawave-ws-query</artifactId>
<packaging>ejb</packaging>
<name>${project.artifactId}</name>

<dependencies>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
<!-- Use the version bundled with Wildfly. The 2.13.x version will not load correctly in Wildfly 17. -->
<version>${version.wildfly.jackson}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId>
<!-- Use the version bundled with Wildfly. The 2.13.x version will not load correctly in Wildfly 17. -->
<version>${version.wildfly.jackson}</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
Expand Down Expand Up @@ -99,6 +112,10 @@
<version>3.0</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId>
</dependency>
<dependency>
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
Expand Down Expand Up @@ -249,6 +266,11 @@
<artifactId>javassist</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit-pioneer</groupId>
<artifactId>junit-pioneer</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-inline</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,45 +43,27 @@ public class QueryExpirationBean {

private static final Logger log = Logger.getLogger(QueryExpirationBean.class);

private QueryCache queryCache;
private QueryExpirationProperties config;
private AccumuloConnectionFactory connectionFactory;
private CreatedQueryLogicCacheBean queryLogicCacheBean;
private QueryMetricsBean metricsBean;
private QueryLimiter queryLimiter;

private boolean clearAll = false;

@Inject
public void setQueryCache(QueryCache cache) {
this.queryCache = cache;
}
private QueryCache queryCache;

@Inject
@SpringBean(refreshable = true)
public void setQueryExpirationProperties(QueryExpirationProperties properties) {
this.config = properties;
}
private QueryExpirationProperties config;

@Inject
public void setConnectionFactory(AccumuloConnectionFactory connectionFactory) {
this.connectionFactory = connectionFactory;
}
private AccumuloConnectionFactory connectionFactory;

@Inject
public void setCreatedQueryLogicCacheBean(CreatedQueryLogicCacheBean cacheBean) {
this.queryLogicCacheBean = cacheBean;
}
private CreatedQueryLogicCacheBean queryLogicCacheBean;

@Inject
public void setQueryMetricsBean(QueryMetricsBean metrics) {
this.metricsBean = metrics;
}
private QueryMetricsBean metricsBean;

@Inject
public void setQueryLimiter(QueryLimiter queryLimiter) {
this.queryLimiter = queryLimiter;
}
@SpringBean(name = "queryLimiter")
private QueryLimiter queryLimiter;

private boolean clearAll = false;

@PostConstruct
public void init() {
Expand Down
Loading
Loading