diff --git a/integrations/dropwizard/README.md b/integrations/dropwizard/README.md deleted file mode 100644 index 5dcf408..0000000 --- a/integrations/dropwizard/README.md +++ /dev/null @@ -1,16 +0,0 @@ -Dropwizard -========== -This provides generic [Dropwizard][dropwizard] instrumentation. It only uses opentracing interfaces and should be portable to other compliant implementations. - - -# Usage # -This provides instrumentation that - - -## See Also ## -This module is built on top of [Haystack JAX RS 2.0][haystackjaxrs]. - -[haystackjaxrs]: -[jaxrs2]: https://jax-rs.github.io/apidocs/2.1/ -[jersey]: https://jersey.java.net -[dropwizard]: http://www.dropwizard.io diff --git a/integrations/dropwizard/pom.xml b/integrations/dropwizard/pom.xml deleted file mode 100644 index 0dedd81..0000000 --- a/integrations/dropwizard/pom.xml +++ /dev/null @@ -1,99 +0,0 @@ - - - 4.0.0 - - - com.expedia.www - haystack-client-java-integrations - 0.2.5-SNAPSHOT - - - haystack-client-dropwizard - jar - - haystack-client-dropwizard - Dropwizard bindings for the client - - - - - io.dropwizard - dropwizard-bom - ${dropwizard.version} - pom - import - - - - - - - com.expedia.www - haystack-client-core - ${project.version} - - - - com.expedia.www - haystack-client-micrometer - ${project.version} - true - - - - com.expedia.www - haystack-client-dropwizard-metrics - ${project.version} - true - - - - io.opentracing - opentracing-api - - - - io.opentracing - opentracing-noop - - - - io.dropwizard - dropwizard-core - - - - io.dropwizard - dropwizard-configuration - - - - io.dropwizard - dropwizard-jersey - - - - io.dropwizard - dropwizard-jackson - - - - org.slf4j - slf4j-api - - - - - junit - junit - test - - - - io.dropwizard - dropwizard-testing - test - - - - diff --git a/integrations/dropwizard/src/main/java/com/expedia/haystack/dropwizard/configuration/AgentClientFactory.java b/integrations/dropwizard/src/main/java/com/expedia/haystack/dropwizard/configuration/AgentClientFactory.java deleted file mode 100644 index 35ff050..0000000 --- a/integrations/dropwizard/src/main/java/com/expedia/haystack/dropwizard/configuration/AgentClientFactory.java +++ /dev/null @@ -1,206 +0,0 @@ -/* - * Copyright 2018 Expedia, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package com.expedia.haystack.dropwizard.configuration; - -import com.expedia.open.tracing.Span; -import com.expedia.www.haystack.client.dispatchers.clients.Client; -import com.expedia.www.haystack.client.dispatchers.clients.GRPCAgentClient; -import com.expedia.www.haystack.client.dispatchers.formats.Format; -import com.expedia.www.haystack.client.metrics.MetricsRegistry; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.dropwizard.setup.Environment; -import org.hibernate.validator.constraints.NotEmpty; - -import javax.annotation.Nullable; -import javax.validation.constraints.Max; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; - -/** - * A factory for configuring and building {@link GRPCAgentClient} instances. - * - * Configaruation options are as follows: - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
NameDefaultDescription
hosthaystack-agentThe host to create a GRPC channel to
port34000The port to sue when creating a GRPC channel
keepAliveTimeMSNone
keepAliveTimeoutMSNone
keepAliveWithoutCallsNone
See {@link BaseClientFactory} for more options, if any.
See {@link ClientFactory} for more options, if any.
- */ -@JsonTypeName("agent") -public class AgentClientFactory extends BaseClientFactory { - - @NotEmpty - private String host = "haystack-agent"; - - @NotNull - @Min(1) - @Max(65535) - private Integer port = 34000; - - @Nullable - private Long keepAliveTimeMS; - - @Nullable - private Long keepAliveTimeoutMS; - - @Nullable - private Boolean keepAliveWithoutCalls; - - public AgentClientFactory() { - setFormat(new ProtoBufFormatFactory()); - } - - @Override - public Client build(Environment environment, MetricsRegistry metrics) { - GRPCAgentClient.Builder grpcBuilder = new GRPCAgentClient.Builder(metrics, host, port); - grpcBuilder.withFormat((Format) getFormat().build(environment)); - - if (keepAliveTimeMS != null) { - grpcBuilder.withKeepAliveTimeMS(keepAliveTimeMS); - } - if (keepAliveTimeoutMS != null) { - grpcBuilder.withKeepAliveTimeoutMS(keepAliveTimeoutMS); - } - if (keepAliveWithoutCalls != null) { - grpcBuilder.withKeepAliveWithoutCalls(keepAliveWithoutCalls); - } - - return grpcBuilder.build(); - } - - /** - * @return the host - */ - @JsonProperty - public String getHost() { - return host; - } - - /** - * @param host the host to set - */ - @JsonProperty - public void setHost(String host) { - this.host = host; - } - - /** - * @return the port - */ - @JsonProperty - public Integer getPort() { - return port; - } - - /** - * @param port the port to set - */ - @JsonProperty - public void setPort(Integer port) { - this.port = port; - } - - /** - * @return the keepAliveTimeMS - */ - @JsonProperty - public Long getKeepAliveTimeMS() { - return keepAliveTimeMS; - } - - /** - * @param keepAliveTimeMS the keepAliveTimeMS to set - */ - @JsonProperty - public void setKeepAliveTimeMS(Long keepAliveTimeMS) { - this.keepAliveTimeMS = keepAliveTimeMS; - } - - /** - * @return the keepAliveTimeoutMS - */ - @JsonProperty - public Long getKeepAliveTimeoutMS() { - return keepAliveTimeoutMS; - } - - /** - * @param keepAliveTimeoutMS the keepAliveTimeoutMS to set - */ - @JsonProperty - public void setKeepAliveTimeoutMS(Long keepAliveTimeoutMS) { - this.keepAliveTimeoutMS = keepAliveTimeoutMS; - } - - /** - * @return the keepAliveWithoutCalls - */ - @JsonProperty - public Boolean getKeepAliveWithoutCalls() { - return keepAliveWithoutCalls; - } - - /** - * @param keepAliveWithoutCalls the keepAliveWithoutCalls to set - */ - @JsonProperty - public void setKeepAliveWithoutCalls(Boolean keepAliveWithoutCalls) { - this.keepAliveWithoutCalls = keepAliveWithoutCalls; - } - -} diff --git a/integrations/dropwizard/src/main/java/com/expedia/haystack/dropwizard/configuration/BaseClientFactory.java b/integrations/dropwizard/src/main/java/com/expedia/haystack/dropwizard/configuration/BaseClientFactory.java deleted file mode 100644 index e9a749f..0000000 --- a/integrations/dropwizard/src/main/java/com/expedia/haystack/dropwizard/configuration/BaseClientFactory.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2018 Expedia, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package com.expedia.haystack.dropwizard.configuration; - -import javax.validation.constraints.NotNull; - -import com.fasterxml.jackson.annotation.JsonProperty; - -public abstract class BaseClientFactory implements ClientFactory { - - @NotNull - protected FormatFactory format; - - /** - * @return the format - */ - @JsonProperty - public FormatFactory getFormat() { - return format; - } - - /** - * @param format the format to set - */ - @JsonProperty - public void setFormat(FormatFactory format) { - this.format = format; - } -} diff --git a/integrations/dropwizard/src/main/java/com/expedia/haystack/dropwizard/configuration/ClientFactory.java b/integrations/dropwizard/src/main/java/com/expedia/haystack/dropwizard/configuration/ClientFactory.java deleted file mode 100644 index 911959c..0000000 --- a/integrations/dropwizard/src/main/java/com/expedia/haystack/dropwizard/configuration/ClientFactory.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2018 Expedia, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package com.expedia.haystack.dropwizard.configuration; - -import com.expedia.www.haystack.client.dispatchers.clients.Client; -import com.expedia.www.haystack.client.metrics.MetricsRegistry; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeInfo.As; -import com.fasterxml.jackson.annotation.JsonTypeInfo.Id; -import io.dropwizard.jackson.Discoverable; -import io.dropwizard.setup.Environment; - -@JsonTypeInfo(use = Id.NAME, include = As.PROPERTY, property = "type") -public interface ClientFactory extends Discoverable { - Client build(Environment environment, MetricsRegistry metrics); -} diff --git a/integrations/dropwizard/src/main/java/com/expedia/haystack/dropwizard/configuration/DispatcherFactory.java b/integrations/dropwizard/src/main/java/com/expedia/haystack/dropwizard/configuration/DispatcherFactory.java deleted file mode 100644 index 2fe65d2..0000000 --- a/integrations/dropwizard/src/main/java/com/expedia/haystack/dropwizard/configuration/DispatcherFactory.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2018 Expedia, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package com.expedia.haystack.dropwizard.configuration; - -import com.expedia.www.haystack.client.dispatchers.Dispatcher; -import com.expedia.www.haystack.client.metrics.MetricsRegistry; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeInfo.As; -import com.fasterxml.jackson.annotation.JsonTypeInfo.Id; - -import io.dropwizard.jackson.Discoverable; -import io.dropwizard.setup.Environment; - -@JsonTypeInfo(use = Id.NAME, include = As.PROPERTY, property = "type") -public interface DispatcherFactory extends Discoverable { - - Dispatcher build(Environment environment, MetricsRegistry metrics); -} diff --git a/integrations/dropwizard/src/main/java/com/expedia/haystack/dropwizard/configuration/DropwizardMetricsFactory.java b/integrations/dropwizard/src/main/java/com/expedia/haystack/dropwizard/configuration/DropwizardMetricsFactory.java deleted file mode 100644 index bba26d5..0000000 --- a/integrations/dropwizard/src/main/java/com/expedia/haystack/dropwizard/configuration/DropwizardMetricsFactory.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2018 Expedia, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package com.expedia.haystack.dropwizard.configuration; - -import javax.annotation.Nullable; - -import com.expedia.www.haystack.client.metrics.MetricsRegistry; -import com.expedia.www.haystack.client.metrics.dropwizard.DropwizardMetricsRegistry; -import com.expedia.www.haystack.client.metrics.dropwizard.NameMapper; -import com.fasterxml.jackson.annotation.JsonTypeName; - -import io.dropwizard.setup.Environment; - -/** - * A factory for configuring and building {@link DropwizardMetricsRegistry} instances. - * - * See {@link MetricsFactory} for more options, if any. - */ -@JsonTypeName("dropwizard") -public class DropwizardMetricsFactory implements MetricsFactory { - - @Nullable - private NameMapper nameMapper = NameMapper.DEFAULT; - - @Override - public MetricsRegistry build(Environment environment) { - return new DropwizardMetricsRegistry(environment.metrics(), nameMapper); - } -} diff --git a/integrations/dropwizard/src/main/java/com/expedia/haystack/dropwizard/configuration/FormatFactory.java b/integrations/dropwizard/src/main/java/com/expedia/haystack/dropwizard/configuration/FormatFactory.java deleted file mode 100644 index 790f5ba..0000000 --- a/integrations/dropwizard/src/main/java/com/expedia/haystack/dropwizard/configuration/FormatFactory.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2018 Expedia, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package com.expedia.haystack.dropwizard.configuration; - -import com.expedia.www.haystack.client.dispatchers.formats.Format; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeInfo.As; -import com.fasterxml.jackson.annotation.JsonTypeInfo.Id; - -import io.dropwizard.jackson.Discoverable; -import io.dropwizard.setup.Environment; - -@JsonTypeInfo(use = Id.NAME, include = As.PROPERTY, property = "type") -public interface FormatFactory extends Discoverable { - - Format build(Environment environment); - -} diff --git a/integrations/dropwizard/src/main/java/com/expedia/haystack/dropwizard/configuration/LoggerClientFactory.java b/integrations/dropwizard/src/main/java/com/expedia/haystack/dropwizard/configuration/LoggerClientFactory.java deleted file mode 100644 index bf99c70..0000000 --- a/integrations/dropwizard/src/main/java/com/expedia/haystack/dropwizard/configuration/LoggerClientFactory.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright 2018 Expedia, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package com.expedia.haystack.dropwizard.configuration; - -import com.expedia.www.haystack.client.dispatchers.clients.Client; -import com.expedia.www.haystack.client.dispatchers.clients.LoggerClient; -import com.expedia.www.haystack.client.metrics.MetricsRegistry; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.dropwizard.setup.Environment; - -import javax.annotation.Nullable; - -/** - * A factory for configuring and building {@link LoggerClient} instances. - * - * Configaruation for the logger used is possible; by default it uses the logger for the {@link LoggerClient}. - * - * See {@link BaseClientFactory} for more options, if any. - * See {@link ClientFactory} for more options, if any. - */ -@JsonTypeName("logger") -public class LoggerClientFactory extends BaseClientFactory { - - @Nullable - private String loggerName; - - public LoggerClientFactory() { - setFormat(new StringFormatFactory()); - } - - @Override - public Client build(Environment environment, MetricsRegistry metrics) { - LoggerClient.Builder builder = new LoggerClient.Builder(metrics, getFormat().build(environment)); - if (loggerName != null) { - builder.withLogger(loggerName); - } - return builder.build(); - } - - /** - * @return the loggerName - */ - @JsonProperty - public String getLoggerName() { - return loggerName; - } - - /** - * @param loggerName the loggerName to set - */ - @JsonProperty - public void setLoggerName(String loggerName) { - this.loggerName = loggerName; - } - -} diff --git a/integrations/dropwizard/src/main/java/com/expedia/haystack/dropwizard/configuration/LoggerDispatcherFactory.java b/integrations/dropwizard/src/main/java/com/expedia/haystack/dropwizard/configuration/LoggerDispatcherFactory.java deleted file mode 100644 index 5ccdcd0..0000000 --- a/integrations/dropwizard/src/main/java/com/expedia/haystack/dropwizard/configuration/LoggerDispatcherFactory.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2018 Expedia, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package com.expedia.haystack.dropwizard.configuration; - -import javax.annotation.Nullable; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; - -import com.expedia.www.haystack.client.dispatchers.LoggerDispatcher; -import com.expedia.www.haystack.client.metrics.MetricsRegistry; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeName; - -import io.dropwizard.setup.Environment; - -@JsonTypeName("logger") -public class LoggerDispatcherFactory implements DispatcherFactory { - @Nullable - private String loggerName; - - @Override - public LoggerDispatcher build(Environment environment, MetricsRegistry metrics) { - LoggerDispatcher.Builder loggerBuilder = new LoggerDispatcher.Builder(metrics); - - if (loggerName != null) { - loggerBuilder.withLogger(loggerName); - } - - return loggerBuilder.build(); - } - - /** - * @return the loggerName - */ - @JsonProperty - public String getLoggerName() { - return loggerName; - } - - /** - * @param loggerName the loggerName to set - */ - @JsonProperty - public void setLoggerName(String loggerName) { - this.loggerName = loggerName; - } -} diff --git a/integrations/dropwizard/src/main/java/com/expedia/haystack/dropwizard/configuration/MetricsFactory.java b/integrations/dropwizard/src/main/java/com/expedia/haystack/dropwizard/configuration/MetricsFactory.java deleted file mode 100644 index 509c33b..0000000 --- a/integrations/dropwizard/src/main/java/com/expedia/haystack/dropwizard/configuration/MetricsFactory.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2018 Expedia, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package com.expedia.haystack.dropwizard.configuration; - -import com.expedia.www.haystack.client.metrics.MetricsRegistry; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeInfo.As; -import com.fasterxml.jackson.annotation.JsonTypeInfo.Id; - -import io.dropwizard.jackson.Discoverable; -import io.dropwizard.setup.Environment; - -@JsonTypeInfo(use = Id.NAME, include = As.PROPERTY, property = "type") -public interface MetricsFactory extends Discoverable { - MetricsRegistry build(Environment environment); -} diff --git a/integrations/dropwizard/src/main/java/com/expedia/haystack/dropwizard/configuration/MicrometerMetricsFactory.java b/integrations/dropwizard/src/main/java/com/expedia/haystack/dropwizard/configuration/MicrometerMetricsFactory.java deleted file mode 100644 index f45b4a9..0000000 --- a/integrations/dropwizard/src/main/java/com/expedia/haystack/dropwizard/configuration/MicrometerMetricsFactory.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2018 Expedia, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package com.expedia.haystack.dropwizard.configuration; - -import com.expedia.www.haystack.client.metrics.MetricsRegistry; -import com.expedia.www.haystack.client.metrics.NoopMetricsRegistry; -import com.expedia.www.haystack.client.metrics.micrometer.GlobalMetricsRegistry; -import com.fasterxml.jackson.annotation.JsonTypeName; - -import io.dropwizard.setup.Environment; - -/** - * A factory for configuring and building {@link NoopMetricsRegistry} instances. - * - * All configaruation is ignored by the registry. - * - * See {@link MetricsFactory} for more options, if any. - */ -@JsonTypeName("micrometer") -public class MicrometerMetricsFactory implements MetricsFactory { - - @Override - public MetricsRegistry build(Environment environment) { - return new GlobalMetricsRegistry(); - } -} diff --git a/integrations/dropwizard/src/main/java/com/expedia/haystack/dropwizard/configuration/NoopClientFactory.java b/integrations/dropwizard/src/main/java/com/expedia/haystack/dropwizard/configuration/NoopClientFactory.java deleted file mode 100644 index 26aed3c..0000000 --- a/integrations/dropwizard/src/main/java/com/expedia/haystack/dropwizard/configuration/NoopClientFactory.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2018 Expedia, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package com.expedia.haystack.dropwizard.configuration; - -import com.expedia.www.haystack.client.dispatchers.clients.Client; -import com.expedia.www.haystack.client.dispatchers.clients.NoopClient; -import com.expedia.www.haystack.client.metrics.MetricsRegistry; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.dropwizard.setup.Environment; - -/** - * A factory for configuring and building {@link NoopClient} instances. - * - * All configaruation is ignored by the client. - * - * See {@link BaseClientFactory} for more options, if any. - * See {@link ClientFactory} for more options, if any. - */ -@JsonTypeName("noop") -public class NoopClientFactory extends BaseClientFactory { - - public NoopClientFactory() { - // set a format to pass validation - setFormat(new StringFormatFactory()); - } - - @Override - public Client build(Environment environment, MetricsRegistry metrics) { - return new NoopClient(); - } - -} diff --git a/integrations/dropwizard/src/main/java/com/expedia/haystack/dropwizard/configuration/NoopDispatcherFactory.java b/integrations/dropwizard/src/main/java/com/expedia/haystack/dropwizard/configuration/NoopDispatcherFactory.java deleted file mode 100644 index 5982212..0000000 --- a/integrations/dropwizard/src/main/java/com/expedia/haystack/dropwizard/configuration/NoopDispatcherFactory.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2018 Expedia, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package com.expedia.haystack.dropwizard.configuration; - -import com.expedia.www.haystack.client.dispatchers.Dispatcher; -import com.expedia.www.haystack.client.dispatchers.NoopDispatcher; -import com.expedia.www.haystack.client.metrics.MetricsRegistry; -import com.fasterxml.jackson.annotation.JsonTypeName; - -import io.dropwizard.setup.Environment; - -@JsonTypeName("noop") -public class NoopDispatcherFactory implements DispatcherFactory { - - @Override - public Dispatcher build(Environment environment, MetricsRegistry metrics) { - return new NoopDispatcher(); - } - -} diff --git a/integrations/dropwizard/src/main/java/com/expedia/haystack/dropwizard/configuration/NoopMetricsFactory.java b/integrations/dropwizard/src/main/java/com/expedia/haystack/dropwizard/configuration/NoopMetricsFactory.java deleted file mode 100644 index d50417d..0000000 --- a/integrations/dropwizard/src/main/java/com/expedia/haystack/dropwizard/configuration/NoopMetricsFactory.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2018 Expedia, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package com.expedia.haystack.dropwizard.configuration; - -import com.expedia.www.haystack.client.metrics.MetricsRegistry; -import com.expedia.www.haystack.client.metrics.NoopMetricsRegistry; -import com.fasterxml.jackson.annotation.JsonTypeName; - -import io.dropwizard.setup.Environment; - -/** - * A factory for configuring and building {@link NoopMetricsRegistry} instances. - * - * All configaruation is ignored by the registry. - * - * See {@link MetricsFactory} for more options, if any. - */ -@JsonTypeName("noop") -public class NoopMetricsFactory implements MetricsFactory { - - @Override - public MetricsRegistry build(Environment environment) { - return new NoopMetricsRegistry(); - } -} diff --git a/integrations/dropwizard/src/main/java/com/expedia/haystack/dropwizard/configuration/ProtoBufFormatFactory.java b/integrations/dropwizard/src/main/java/com/expedia/haystack/dropwizard/configuration/ProtoBufFormatFactory.java deleted file mode 100644 index e177234..0000000 --- a/integrations/dropwizard/src/main/java/com/expedia/haystack/dropwizard/configuration/ProtoBufFormatFactory.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2018 Expedia, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package com.expedia.haystack.dropwizard.configuration; - -import com.expedia.www.haystack.client.dispatchers.formats.Format; -import com.expedia.www.haystack.client.dispatchers.formats.ProtoBufFormat; -import com.fasterxml.jackson.annotation.JsonTypeName; - -import io.dropwizard.setup.Environment; - -@JsonTypeName("protobuf") -public class ProtoBufFormatFactory implements FormatFactory { - @Override - public Format build(Environment environment) { - return new ProtoBufFormat(); - } -} - - diff --git a/integrations/dropwizard/src/main/java/com/expedia/haystack/dropwizard/configuration/RemoteDispatcherFactory.java b/integrations/dropwizard/src/main/java/com/expedia/haystack/dropwizard/configuration/RemoteDispatcherFactory.java deleted file mode 100644 index b1a28a9..0000000 --- a/integrations/dropwizard/src/main/java/com/expedia/haystack/dropwizard/configuration/RemoteDispatcherFactory.java +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Copyright 2018 Expedia, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package com.expedia.haystack.dropwizard.configuration; - -import javax.annotation.Nullable; -import javax.validation.Valid; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; - -import com.expedia.www.haystack.client.dispatchers.Dispatcher; -import com.expedia.www.haystack.client.dispatchers.RemoteDispatcher; -import com.expedia.www.haystack.client.metrics.MetricsRegistry; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeName; - -import io.dropwizard.setup.Environment; - -@JsonTypeName("remote") -public class RemoteDispatcherFactory implements DispatcherFactory { - @Valid - @NotNull - private ClientFactory client; - - @Nullable - @Min(1) - private Integer maxQueueSize; - - @Nullable - @Min(1) - private Integer threadCount; - - @Nullable - @Min(1) - private Long flushIntervalMs; - - @Nullable - @Min(1) - private Long shutdownTimoutMs; - - @Override - public Dispatcher build(Environment environment, MetricsRegistry metrics) { - RemoteDispatcher.Builder builder = new RemoteDispatcher.Builder(metrics, client.build(environment, metrics)); - if (maxQueueSize != null) { - builder.withBlockingQueueLimit(maxQueueSize); - } - if (threadCount != null) { - builder.withExecutorThreadCount(threadCount); - } - if (flushIntervalMs != null) { - builder.withFlushIntervalMillis(flushIntervalMs); - } - if (shutdownTimoutMs != null) { - builder.withShutdownTimeoutMillis(shutdownTimoutMs); - } - return builder.build(); - } - - /** - * @return the client - */ - @JsonProperty - public ClientFactory getClient() { - return client; - } - - /** - * @param client the client to set - */ - @JsonProperty - public void setClient(ClientFactory client) { - this.client = client; - } - - /** - * @return the maxQueueSize - */ - @JsonProperty - public Integer getMaxQueueSize() { - return maxQueueSize; - } - - /** - * @param maxQueueSize the maxQueueSize to set - */ - @JsonProperty - public void setMaxQueueSize(Integer maxQueueSize) { - this.maxQueueSize = maxQueueSize; - } - - /** - * @return the threadCount - */ - @JsonProperty - public Integer getThreadCount() { - return threadCount; - } - - /** - * @param threadCount the threadCount to set - */ - @JsonProperty - public void setThreadCount(Integer threadCount) { - this.threadCount = threadCount; - } - - /** - * @return the flushIntervalMs - */ - @JsonProperty - public Long getFlushIntervalMs() { - return flushIntervalMs; - } - - /** - * @param flushIntervalMs the flushIntervalMs to set - */ - @JsonProperty - public void setFlushIntervalMs(Long flushIntervalMs) { - this.flushIntervalMs = flushIntervalMs; - } - - /** - * @return the shutdownTimoutMs - */ - @JsonProperty - public Long getShutdownTimoutMs() { - return shutdownTimoutMs; - } - - /** - * @param shutdownTimoutMs the shutdownTimoutMs to set - */ - @JsonProperty - public void setShutdownTimoutMs(Long shutdownTimoutMs) { - this.shutdownTimoutMs = shutdownTimoutMs; - } - -} diff --git a/integrations/dropwizard/src/main/java/com/expedia/haystack/dropwizard/configuration/StringFormatFactory.java b/integrations/dropwizard/src/main/java/com/expedia/haystack/dropwizard/configuration/StringFormatFactory.java deleted file mode 100644 index a04f9d4..0000000 --- a/integrations/dropwizard/src/main/java/com/expedia/haystack/dropwizard/configuration/StringFormatFactory.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2018 Expedia, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package com.expedia.haystack.dropwizard.configuration; - -import com.expedia.www.haystack.client.dispatchers.formats.Format; -import com.expedia.www.haystack.client.dispatchers.formats.StringFormat; -import com.fasterxml.jackson.annotation.JsonTypeName; - -import io.dropwizard.setup.Environment; - -@JsonTypeName("string") -public class StringFormatFactory implements FormatFactory { - @Override - public Format build(Environment environment) { - return new StringFormat(); - } -} - diff --git a/integrations/dropwizard/src/main/java/com/expedia/haystack/dropwizard/configuration/TracerFactory.java b/integrations/dropwizard/src/main/java/com/expedia/haystack/dropwizard/configuration/TracerFactory.java deleted file mode 100644 index 8854109..0000000 --- a/integrations/dropwizard/src/main/java/com/expedia/haystack/dropwizard/configuration/TracerFactory.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright 2018 Expedia, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package com.expedia.haystack.dropwizard.configuration; - -import java.util.List; - -import javax.validation.Valid; -import javax.validation.constraints.NotNull; - -import org.hibernate.validator.constraints.NotEmpty; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.expedia.www.haystack.client.Tracer; -import com.expedia.www.haystack.client.dispatchers.ChainedDispatcher; -import com.expedia.www.haystack.client.dispatchers.Dispatcher; -import com.expedia.www.haystack.client.metrics.MetricsRegistry; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.base.MoreObjects; -import com.google.common.collect.ImmutableList; - -import io.dropwizard.setup.Environment; -import io.opentracing.noop.NoopTracerFactory; - -public class TracerFactory { - private static final Logger LOGGER = LoggerFactory.getLogger(TracerFactory.class); - - @Valid - @NotNull - private MetricsFactory metrics = new DropwizardMetricsFactory(); - - @Valid - private boolean enabled = true; - - @NotEmpty - private String serviceName; - - @Valid - @NotEmpty - private List dispatchers = ImmutableList.of(new RemoteDispatcherFactory()); - - public io.opentracing.Tracer build(Environment environment) { - if (!enabled) { - return NoopTracerFactory.create(); - } - - MetricsRegistry registry = metrics.build(environment); - - Dispatcher dispatcher; - if (dispatchers.size() > 1) { - ChainedDispatcher.Builder builder = new ChainedDispatcher.Builder(); - for (DispatcherFactory factory : dispatchers) { - builder.withDispatcher(factory.build(environment, registry)); - } - dispatcher = builder.build(); - } else { - dispatcher = dispatchers.get(0).build(environment, registry); - } - - final Tracer.Builder builder = new Tracer.Builder(registry, serviceName, dispatcher); - return builder.build(); - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this) - .add("serviceName", serviceName) - .add("dispatchers", dispatchers) - .toString(); - } - - @JsonProperty - public MetricsFactory getMetrics() { - return metrics; - } - - @JsonProperty - public void setMetrics(MetricsFactory metrics) { - this.metrics = metrics; - } - - @JsonProperty - public boolean isEnabled() { - return enabled; - } - - @JsonProperty - public void setEnabled(boolean enabled) { - this.enabled = enabled; - } - - @JsonProperty - public String getServiceName() { - return serviceName; - } - - @JsonProperty - public void setServiceName(String serviceName) { - this.serviceName = serviceName; - } - - @JsonProperty - public List getDispatchers() { - return dispatchers; - } - - @JsonProperty - public void setDispatchers(List dispatchers) { - this.dispatchers = dispatchers; - } -} diff --git a/integrations/dropwizard/src/main/resources/META-INF/services/com.expedia.haystack.dropwizard.configuration.ClientFactory b/integrations/dropwizard/src/main/resources/META-INF/services/com.expedia.haystack.dropwizard.configuration.ClientFactory deleted file mode 100644 index 53ba688..0000000 --- a/integrations/dropwizard/src/main/resources/META-INF/services/com.expedia.haystack.dropwizard.configuration.ClientFactory +++ /dev/null @@ -1,3 +0,0 @@ -com.expedia.haystack.dropwizard.configuration.AgentClientFactory -com.expedia.haystack.dropwizard.configuration.LoggerClientFactory -com.expedia.haystack.dropwizard.configuration.NoopClientFactory diff --git a/integrations/dropwizard/src/main/resources/META-INF/services/com.expedia.haystack.dropwizard.configuration.DispatcherFactory b/integrations/dropwizard/src/main/resources/META-INF/services/com.expedia.haystack.dropwizard.configuration.DispatcherFactory deleted file mode 100644 index 886af59..0000000 --- a/integrations/dropwizard/src/main/resources/META-INF/services/com.expedia.haystack.dropwizard.configuration.DispatcherFactory +++ /dev/null @@ -1,3 +0,0 @@ -com.expedia.haystack.dropwizard.configuration.LoggerDispatcherFactory -com.expedia.haystack.dropwizard.configuration.NoopDispatcherFactory -com.expedia.haystack.dropwizard.configuration.RemoteDispatcherFactory diff --git a/integrations/dropwizard/src/main/resources/META-INF/services/com.expedia.haystack.dropwizard.configuration.FormatFactory b/integrations/dropwizard/src/main/resources/META-INF/services/com.expedia.haystack.dropwizard.configuration.FormatFactory deleted file mode 100644 index 886e9f8..0000000 --- a/integrations/dropwizard/src/main/resources/META-INF/services/com.expedia.haystack.dropwizard.configuration.FormatFactory +++ /dev/null @@ -1,2 +0,0 @@ -com.expedia.haystack.dropwizard.configuration.ProtoBufFormatFactory -com.expedia.haystack.dropwizard.configuration.StringFormatFactory diff --git a/integrations/dropwizard/src/main/resources/META-INF/services/com.expedia.haystack.dropwizard.configuration.MetricsFactory b/integrations/dropwizard/src/main/resources/META-INF/services/com.expedia.haystack.dropwizard.configuration.MetricsFactory deleted file mode 100644 index 2feb4f6..0000000 --- a/integrations/dropwizard/src/main/resources/META-INF/services/com.expedia.haystack.dropwizard.configuration.MetricsFactory +++ /dev/null @@ -1,3 +0,0 @@ -com.expedia.haystack.dropwizard.configuration.NoopMetricsFactory -com.expedia.haystack.dropwizard.configuration.MicrometerMetricsFactory -com.expedia.haystack.dropwizard.configuration.DropwizardMetricsFactory diff --git a/integrations/dropwizard/src/main/resources/META-INF/services/io.dropwizard.jackson.Discoverable b/integrations/dropwizard/src/main/resources/META-INF/services/io.dropwizard.jackson.Discoverable deleted file mode 100644 index c3af423..0000000 --- a/integrations/dropwizard/src/main/resources/META-INF/services/io.dropwizard.jackson.Discoverable +++ /dev/null @@ -1,4 +0,0 @@ -com.expedia.haystack.dropwizard.configuration.MetricsFactory -com.expedia.haystack.dropwizard.configuration.FormatFactory -com.expedia.haystack.dropwizard.configuration.ClientFactory -com.expedia.haystack.dropwizard.configuration.DispatcherFactory diff --git a/integrations/dropwizard/src/test/java/com/expedia/haystack/dropwizard/configuration/BaseFactoryTest.java b/integrations/dropwizard/src/test/java/com/expedia/haystack/dropwizard/configuration/BaseFactoryTest.java deleted file mode 100644 index fd36770..0000000 --- a/integrations/dropwizard/src/test/java/com/expedia/haystack/dropwizard/configuration/BaseFactoryTest.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2018 Expedia, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package com.expedia.haystack.dropwizard.configuration; - -import static org.assertj.core.api.Assertions.assertThat; - -import java.io.File; - -import javax.validation.Validator; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.google.common.io.Resources; - -import io.dropwizard.configuration.YamlConfigurationFactory; -import io.dropwizard.jackson.DiscoverableSubtypeResolver; -import io.dropwizard.jackson.Jackson; -import io.dropwizard.jersey.validation.Validators; - -public abstract class BaseFactoryTest { - protected final ObjectMapper objectMapper = Jackson.newObjectMapper(); - protected final Validator validator = Validators.newValidator(); - - protected void isDiscoverable(Iterable> factories) throws Exception { - assertThat(new DiscoverableSubtypeResolver().getDiscoveredSubtypes()) - .containsAll(factories); - } - - protected T testFactory(YamlConfigurationFactory factory, String yamlFile, Class clazz) throws Exception { - final File yml = new File(Resources.getResource(yamlFile).toURI()); - T t = factory.build(yml); - assertThat(t).isInstanceOf(clazz); - return t; - } -} diff --git a/integrations/dropwizard/src/test/java/com/expedia/haystack/dropwizard/configuration/ClientFactoryTest.java b/integrations/dropwizard/src/test/java/com/expedia/haystack/dropwizard/configuration/ClientFactoryTest.java deleted file mode 100644 index 11710b0..0000000 --- a/integrations/dropwizard/src/test/java/com/expedia/haystack/dropwizard/configuration/ClientFactoryTest.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2018 Expedia, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package com.expedia.haystack.dropwizard.configuration; - -import static org.assertj.core.api.Assertions.assertThat; - -import org.junit.Test; - -import com.google.common.collect.ImmutableList; - -import io.dropwizard.configuration.YamlConfigurationFactory; - -public class ClientFactoryTest extends BaseFactoryTest { - private final YamlConfigurationFactory factory = - new YamlConfigurationFactory<>(ClientFactory.class, validator, objectMapper, "dw"); - - @Test - public void isDiscoverable() throws Exception { - // Make sure the types we specified in META-INF gets picked up - isDiscoverable(ImmutableList.of(AgentClientFactory.class, LoggerClientFactory.class, NoopClientFactory.class)); - } - - @Test - public void testBuildAgent() throws Exception { - AgentClientFactory agent = (AgentClientFactory) testFactory(factory, "yaml/client/agent.yml", AgentClientFactory.class); - assertThat(agent.getPort()).isBetween(1, 65535); - assertThat(agent.getFormat()).isNotNull(); - } - - @Test - public void testBuildLogger() throws Exception { - testFactory(factory, "yaml/client/logger.yml", LoggerClientFactory.class); - } - - @Test - public void testBuildNoop() throws Exception { - testFactory(factory, "yaml/client/noop.yml", NoopClientFactory.class); - } -} diff --git a/integrations/dropwizard/src/test/java/com/expedia/haystack/dropwizard/configuration/DispatcherFactoryTest.java b/integrations/dropwizard/src/test/java/com/expedia/haystack/dropwizard/configuration/DispatcherFactoryTest.java deleted file mode 100644 index a0d2d03..0000000 --- a/integrations/dropwizard/src/test/java/com/expedia/haystack/dropwizard/configuration/DispatcherFactoryTest.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2018 Expedia, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package com.expedia.haystack.dropwizard.configuration; - -import org.junit.Test; - -import com.google.common.collect.ImmutableList; - -import io.dropwizard.configuration.YamlConfigurationFactory; - -public class DispatcherFactoryTest extends BaseFactoryTest { - private final YamlConfigurationFactory factory = - new YamlConfigurationFactory<>(DispatcherFactory.class, validator, objectMapper, "dw"); - - @Test - public void isDiscoverable() throws Exception { - // Make sure the types we specified in META-INF gets picked up - isDiscoverable(ImmutableList.of(RemoteDispatcherFactory.class, - LoggerDispatcherFactory.class, - RemoteDispatcherFactory.class)); - } - - @Test - public void testBuildRemote() throws Exception { - RemoteDispatcherFactory agent = (RemoteDispatcherFactory) testFactory(factory, "yaml/dispatcher/remote.yml", RemoteDispatcherFactory.class); - } - - @Test - public void testBuildLogger() throws Exception { - testFactory(factory, "yaml/dispatcher/logger.yml", LoggerDispatcherFactory.class); - } - - @Test - public void testBuildNoop() throws Exception { - testFactory(factory, "yaml/dispatcher/noop.yml", NoopDispatcherFactory.class); - } -} diff --git a/integrations/dropwizard/src/test/java/com/expedia/haystack/dropwizard/configuration/FormatFactoryTest.java b/integrations/dropwizard/src/test/java/com/expedia/haystack/dropwizard/configuration/FormatFactoryTest.java deleted file mode 100644 index 73364c7..0000000 --- a/integrations/dropwizard/src/test/java/com/expedia/haystack/dropwizard/configuration/FormatFactoryTest.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2018 Expedia, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package com.expedia.haystack.dropwizard.configuration; - -import org.junit.Test; - -import com.google.common.collect.ImmutableList; - -import io.dropwizard.configuration.YamlConfigurationFactory; - -public class FormatFactoryTest extends BaseFactoryTest { - private final YamlConfigurationFactory factory = - new YamlConfigurationFactory<>(FormatFactory.class, validator, objectMapper, "dw"); - - @Test - public void isDiscoverable() throws Exception { - // Make sure the types we specified in META-INF gets picked up - isDiscoverable(ImmutableList.of(StringFormatFactory.class, ProtoBufFormatFactory.class)); - } - - @Test - public void testBuildStringFormat() throws Exception { - testFactory(factory, "yaml/format/string.yml", StringFormatFactory.class); - } - - @Test - public void testBuildProtobufFormat() throws Exception { - testFactory(factory, "yaml/format/protobuf.yml", ProtoBufFormatFactory.class); - } - -} diff --git a/integrations/dropwizard/src/test/java/com/expedia/haystack/dropwizard/configuration/MetricsFactoryTest.java b/integrations/dropwizard/src/test/java/com/expedia/haystack/dropwizard/configuration/MetricsFactoryTest.java deleted file mode 100644 index 5b09f7a..0000000 --- a/integrations/dropwizard/src/test/java/com/expedia/haystack/dropwizard/configuration/MetricsFactoryTest.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2018 Expedia, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package com.expedia.haystack.dropwizard.configuration; - -import org.junit.Test; - -import com.google.common.collect.ImmutableList; - -import io.dropwizard.configuration.YamlConfigurationFactory; - -public class MetricsFactoryTest extends BaseFactoryTest { - private final YamlConfigurationFactory factory = - new YamlConfigurationFactory<>(MetricsFactory.class, validator, objectMapper, "dw"); - - @Test - public void isDiscoverable() throws Exception { - // Make sure the types we specified in META-INF gets picked up - isDiscoverable(ImmutableList.of(NoopMetricsFactory.class, MicrometerMetricsFactory.class)); - } - - @Test - public void testNoopMetricsFactory() throws Exception { - testFactory(factory, "yaml/metrics/noop.yml", NoopMetricsFactory.class); - } - - @Test - public void testMicrometerMetricsFactory() throws Exception { - testFactory(factory, "yaml/metrics/micrometer.yml", MicrometerMetricsFactory.class); - } - - @Test - public void testDropwizardMetricsFactory() throws Exception { - testFactory(factory, "yaml/metrics/dropwizard.yml", DropwizardMetricsFactory.class); - } -} diff --git a/integrations/dropwizard/src/test/resources/yaml/client/agent.yml b/integrations/dropwizard/src/test/resources/yaml/client/agent.yml deleted file mode 100644 index 31e35b9..0000000 --- a/integrations/dropwizard/src/test/resources/yaml/client/agent.yml +++ /dev/null @@ -1,2 +0,0 @@ -type: agent -port: 1337 diff --git a/integrations/dropwizard/src/test/resources/yaml/client/logger.yml b/integrations/dropwizard/src/test/resources/yaml/client/logger.yml deleted file mode 100644 index 73ef633..0000000 --- a/integrations/dropwizard/src/test/resources/yaml/client/logger.yml +++ /dev/null @@ -1 +0,0 @@ -type: logger diff --git a/integrations/dropwizard/src/test/resources/yaml/client/noop.yml b/integrations/dropwizard/src/test/resources/yaml/client/noop.yml deleted file mode 100644 index 09c1f86..0000000 --- a/integrations/dropwizard/src/test/resources/yaml/client/noop.yml +++ /dev/null @@ -1 +0,0 @@ -type: noop diff --git a/integrations/dropwizard/src/test/resources/yaml/dispatcher/logger.yml b/integrations/dropwizard/src/test/resources/yaml/dispatcher/logger.yml deleted file mode 100644 index 73ef633..0000000 --- a/integrations/dropwizard/src/test/resources/yaml/dispatcher/logger.yml +++ /dev/null @@ -1 +0,0 @@ -type: logger diff --git a/integrations/dropwizard/src/test/resources/yaml/dispatcher/noop.yml b/integrations/dropwizard/src/test/resources/yaml/dispatcher/noop.yml deleted file mode 100644 index 09c1f86..0000000 --- a/integrations/dropwizard/src/test/resources/yaml/dispatcher/noop.yml +++ /dev/null @@ -1 +0,0 @@ -type: noop diff --git a/integrations/dropwizard/src/test/resources/yaml/dispatcher/remote.yml b/integrations/dropwizard/src/test/resources/yaml/dispatcher/remote.yml deleted file mode 100644 index 6fc2b5e..0000000 --- a/integrations/dropwizard/src/test/resources/yaml/dispatcher/remote.yml +++ /dev/null @@ -1,4 +0,0 @@ -type: remote -client: - type: agent - port: 13345 diff --git a/integrations/dropwizard/src/test/resources/yaml/format/protobuf.yml b/integrations/dropwizard/src/test/resources/yaml/format/protobuf.yml deleted file mode 100644 index e920cb2..0000000 --- a/integrations/dropwizard/src/test/resources/yaml/format/protobuf.yml +++ /dev/null @@ -1 +0,0 @@ -type: protobuf diff --git a/integrations/dropwizard/src/test/resources/yaml/format/string.yml b/integrations/dropwizard/src/test/resources/yaml/format/string.yml deleted file mode 100644 index 5c21d88..0000000 --- a/integrations/dropwizard/src/test/resources/yaml/format/string.yml +++ /dev/null @@ -1 +0,0 @@ -type: string diff --git a/integrations/dropwizard/src/test/resources/yaml/metrics/dropwizard.yml b/integrations/dropwizard/src/test/resources/yaml/metrics/dropwizard.yml deleted file mode 100644 index a616f5f..0000000 --- a/integrations/dropwizard/src/test/resources/yaml/metrics/dropwizard.yml +++ /dev/null @@ -1 +0,0 @@ -type: dropwizard diff --git a/integrations/dropwizard/src/test/resources/yaml/metrics/micrometer.yml b/integrations/dropwizard/src/test/resources/yaml/metrics/micrometer.yml deleted file mode 100644 index f482ae7..0000000 --- a/integrations/dropwizard/src/test/resources/yaml/metrics/micrometer.yml +++ /dev/null @@ -1 +0,0 @@ -type: micrometer diff --git a/integrations/dropwizard/src/test/resources/yaml/metrics/noop.yml b/integrations/dropwizard/src/test/resources/yaml/metrics/noop.yml deleted file mode 100644 index 09c1f86..0000000 --- a/integrations/dropwizard/src/test/resources/yaml/metrics/noop.yml +++ /dev/null @@ -1 +0,0 @@ -type: noop diff --git a/integrations/pom.xml b/integrations/pom.xml index 15b6600..af23109 100644 --- a/integrations/pom.xml +++ b/integrations/pom.xml @@ -39,7 +39,6 @@ - dropwizard dropwizard-metrics micrometer