Skip to content

Commit

Permalink
Merge b468bcf into 57a6b0e
Browse files Browse the repository at this point in the history
  • Loading branch information
ddcprg committed Jul 3, 2018
2 parents 57a6b0e + b468bcf commit 660ab99
Show file tree
Hide file tree
Showing 82 changed files with 461 additions and 355 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## TBD
### Changed
* circus-train-vacuum-tool moved into [Housekeeping](https://github.com/HotelsDotCom/housekeeping) project under the module housekeeping-vacuum-tool.
* ConfiGuration classes moved from Core to API sub-project. See [#78](https://github.com/HotelsDotCom/circus-train/issues/782).

## 11.5.2 - 2018-06-15
### Changed
Expand Down
11 changes: 11 additions & 0 deletions circus-train-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
<description>Design contracts.</description>

<dependencies>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
</dependency>

<!-- Hadoop -->
<dependency>
<groupId>org.apache.hadoop</groupId>
Expand Down Expand Up @@ -52,6 +57,12 @@
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
</dependency>
<dependency>
<groupId>com.openpojo</groupId>
<artifactId>openpojo</artifactId>
<version>0.8.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.hive</groupId>
<artifactId>hive-exec</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hotels.bdp.circustrain.core.conf;
package com.hotels.bdp.circustrain.api.conf;

import static javax.validation.constraints.Pattern.Flag.CASE_INSENSITIVE;

Expand All @@ -23,7 +23,7 @@

import org.hibernate.validator.constraints.NotBlank;

import com.hotels.bdp.circustrain.validation.constraints.TunnelRoute;
import com.hotels.bdp.circustrain.api.validation.constraints.TunnelRoute;

public class MetastoreTunnel {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (C) 2016-2017 Expedia Inc.
* Copyright (C) 2016-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.
Expand All @@ -13,15 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hotels.bdp.circustrain.core.conf;
package com.hotels.bdp.circustrain.api.conf;

import java.util.concurrent.TimeUnit;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConfigurationProperties(prefix = "metrics-reporter")
public class MetricsReporter {

private long period = 1L;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (C) 2016-2017 Expedia Inc.
* Copyright (C) 2016-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.
Expand All @@ -13,19 +13,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hotels.bdp.circustrain.core.conf;
package com.hotels.bdp.circustrain.api.conf;

import java.util.List;
import java.util.Map;

import javax.validation.Valid;

import org.hibernate.validator.constraints.NotBlank;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConfigurationProperties(prefix = "replica-catalog")
public class ReplicaCatalog implements TunnelMetastoreCatalog {

private @NotBlank String name;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (C) 2016-2017 Expedia Inc.
* Copyright (C) 2016-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.
Expand All @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hotels.bdp.circustrain.core.conf;
package com.hotels.bdp.circustrain.api.conf;

public class ReplicaTable {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (C) 2016-2017 Expedia Inc.
* Copyright (C) 2016-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.
Expand All @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hotels.bdp.circustrain.core.conf;
package com.hotels.bdp.circustrain.api.conf;

public enum ReplicationMode {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (C) 2016-2017 Expedia Inc.
* Copyright (C) 2016-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.
Expand All @@ -13,13 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hotels.bdp.circustrain.core.conf;
package com.hotels.bdp.circustrain.api.conf;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConfigurationProperties(prefix = "security")
public class Security {

private String credentialProvider;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (C) 2016-2017 Expedia Inc.
* Copyright (C) 2016-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.
Expand All @@ -13,23 +13,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hotels.bdp.circustrain.core.conf;
package com.hotels.bdp.circustrain.api.conf;

import java.util.List;
import java.util.Map;

import javax.validation.Valid;

import org.hibernate.validator.constraints.NotBlank;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;

import com.hotels.bdp.circustrain.api.Modules;

@Profile({ Modules.REPLICATION })
@Configuration
@ConfigurationProperties(prefix = "source-catalog")
public class SourceCatalog implements TunnelMetastoreCatalog {

private @NotBlank String name;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (C) 2016-2017 Expedia Inc.
* Copyright (C) 2016-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.
Expand All @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hotels.bdp.circustrain.core.conf;
package com.hotels.bdp.circustrain.api.conf;

import javax.annotation.Nullable;
import javax.validation.constraints.Min;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (C) 2016-2017 Expedia Inc.
* Copyright (C) 2016-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.
Expand All @@ -13,15 +13,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hotels.bdp.circustrain.core.conf;
package com.hotels.bdp.circustrain.api.conf;

import java.util.HashMap;
import java.util.Map;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;

import com.hotels.bdp.circustrain.validation.constraints.TableReplicationFullReplicationModeConstraint;
import com.hotels.bdp.circustrain.api.validation.constraints.TableReplicationFullReplicationModeConstraint;

@TableReplicationFullReplicationModeConstraint
public class TableReplication {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (C) 2016-2017 Expedia Inc.
* Copyright (C) 2016-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.
Expand All @@ -13,22 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hotels.bdp.circustrain.core.conf;
package com.hotels.bdp.circustrain.api.conf;

import java.util.List;

import javax.validation.Valid;

import org.hibernate.validator.constraints.NotEmpty;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;

import com.hotels.bdp.circustrain.api.Modules;

@Profile({ Modules.REPLICATION })
@Configuration
@ConfigurationProperties(prefix = "")
public class TableReplications {

private @Valid @NotEmpty List<TableReplication> tableReplications;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (C) 2016-2017 Expedia Inc.
* Copyright (C) 2016-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.
Expand All @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hotels.bdp.circustrain.core.conf;
package com.hotels.bdp.circustrain.api.conf;

import com.hotels.bdp.circustrain.api.conf.MetastoreCatalog;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (C) 2016-2017 Expedia Inc.
* Copyright (C) 2016-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.
Expand All @@ -13,17 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hotels.bdp.circustrain.core.conf;
package com.hotels.bdp.circustrain.api.copier;

import java.util.Map;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import com.hotels.bdp.circustrain.api.copier.CopierOptions;

@Configuration
@ConfigurationProperties(prefix = "")
public class GenericCopierOptions implements CopierOptions {

private Map<String, Object> copierOptions;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (C) 2016-2017 Expedia Inc.
* Copyright (C) 2016-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.
Expand All @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hotels.bdp.circustrain.validation.constraints;
package com.hotels.bdp.circustrain.api.validation.constraints;

import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
Expand All @@ -25,7 +25,7 @@
import javax.validation.Payload;
import javax.validation.ReportAsSingleViolation;

import com.hotels.bdp.circustrain.validation.constraintvalidators.TableReplicationFullReplicationModeValidator;
import com.hotels.bdp.circustrain.api.validation.constraintvalidators.TableReplicationFullReplicationModeValidator;

@Constraint(validatedBy = { TableReplicationFullReplicationModeValidator.class })
@Target({ TYPE })
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
/**
* Copyright (C) 2016-2017 Expedia Inc and the original hibernate-validator contributors.
*
* Based on:
*
* https://github.com/hibernate/hibernate-validator/blob/5.2/engine/src/main/java/org/hibernate/validator/constraints/Email.java#L37
* Copyright (C) 2016-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.
Expand All @@ -17,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hotels.bdp.circustrain.validation.constraints;
package com.hotels.bdp.circustrain.api.validation.constraints;

import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
import static java.lang.annotation.ElementType.CONSTRUCTOR;
Expand All @@ -36,7 +32,7 @@
import javax.validation.ReportAsSingleViolation;
import javax.validation.constraints.Pattern;

import com.hotels.bdp.circustrain.validation.constraintvalidators.TunnelRouteValidator;
import com.hotels.bdp.circustrain.api.validation.constraintvalidators.TunnelRouteValidator;

/**
* Validates the annotated {@link String} is sequence of one or more {@link java.net.URI} separated by the literal
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (C) 2016-2017 Expedia Inc.
* Copyright (C) 2016-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.
Expand All @@ -13,16 +13,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hotels.bdp.circustrain.validation.constraintvalidators;
package com.hotels.bdp.circustrain.api.validation.constraintvalidators;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

import org.apache.commons.lang3.StringUtils;

import com.hotels.bdp.circustrain.core.conf.ReplicationMode;
import com.hotels.bdp.circustrain.core.conf.TableReplication;
import com.hotels.bdp.circustrain.validation.constraints.TableReplicationFullReplicationModeConstraint;
import com.hotels.bdp.circustrain.api.conf.ReplicationMode;
import com.hotels.bdp.circustrain.api.conf.TableReplication;
import com.hotels.bdp.circustrain.api.validation.constraints.TableReplicationFullReplicationModeConstraint;

public class TableReplicationFullReplicationModeValidator
implements ConstraintValidator<TableReplicationFullReplicationModeConstraint, TableReplication> {
Expand Down

0 comments on commit 660ab99

Please sign in to comment.