-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
0) Renamed UnshardedClusterInfo into UnshardedFinder and introduced a…
… ListBasedServiceRegistry along with the MapBased one 1) Added a criteria interface in the ShardSelector to keep it seperate from the T in ServiceNode and trickled the changes upstream to whereever ShardSelector is getting built. 2) Added test cases to the new criteria interface 3) Added Http serivceNodeProvider and serviceFinders, along with the HttpServiceFinderHub 4) Added tests for Http interfaces as well. 5) Added license to the missing files 6) Fixed sonar issues
- Loading branch information
Showing
132 changed files
with
3,065 additions
and
736 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,18 +50,23 @@ | |
<name>Tushar Naik</name> | ||
<email>[email protected]</email> | ||
</developer> | ||
<developer> | ||
<id>koushikr</id> | ||
<name>Koushik Ramachandra</name> | ||
<email>[email protected]</email> | ||
</developer> | ||
</developers> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<guava.version>30.1.1-jre</guava.version> | ||
<curator.version>4.0.1</curator.version> | ||
<curator.version>4.2.0</curator.version> | ||
<jackson.version>2.12.5</jackson.version> | ||
<slf4j.version>1.7.32</slf4j.version> | ||
|
||
<maven.compiler.version>3.8.0</maven.compiler.version> | ||
<java.version>1.8</java.version> | ||
<lombok.version>1.18.20</lombok.version> | ||
<lombok.version>1.18.16</lombok.version> | ||
|
||
<junit.version>4.13.2</junit.version> | ||
<awaitility.version>4.1.0</awaitility.version> | ||
|
@@ -78,7 +83,7 @@ | |
<dependency> | ||
<groupId>com.google.code.findbugs</groupId> | ||
<artifactId>annotations</artifactId> | ||
<version>3.0.1u2</version> | ||
<version>3.0.1</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.google.guava</groupId> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 11 additions & 10 deletions
21
...der/unsharded/UnshardedClusterFinder.java → .../finder/SimpleUnshardedServiceFinder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,30 @@ | ||
/** | ||
/* | ||
* Copyright 2015 Flipkart Internet Pvt. Ltd. | ||
* | ||
* <p> | ||
* 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 | ||
* | ||
* <p> | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* <p> | ||
* 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.flipkart.ranger.core.finder.unsharded; | ||
package com.flipkart.ranger.core.finder; | ||
|
||
import com.flipkart.ranger.core.finder.ServiceFinder; | ||
import com.flipkart.ranger.core.finder.serviceregistry.ListBasedServiceRegistry; | ||
import com.flipkart.ranger.core.model.Criteria; | ||
import com.flipkart.ranger.core.model.ServiceNodeSelector; | ||
import com.flipkart.ranger.core.model.ShardSelector; | ||
|
||
public class UnshardedClusterFinder extends ServiceFinder<UnshardedClusterInfo, UnshardedClusterServiceRegistry> { | ||
public UnshardedClusterFinder(UnshardedClusterServiceRegistry serviceRegistry, | ||
ShardSelector<UnshardedClusterInfo, UnshardedClusterServiceRegistry> shardSelector, | ||
ServiceNodeSelector<UnshardedClusterInfo> nodeSelector) { | ||
public class SimpleUnshardedServiceFinder<T, C extends Criteria<T>> extends ServiceFinder<T, C, ListBasedServiceRegistry<T>> { | ||
public SimpleUnshardedServiceFinder(ListBasedServiceRegistry<T> serviceRegistry, | ||
ShardSelector<T, C, ListBasedServiceRegistry<T>> shardSelector, | ||
ServiceNodeSelector<T> nodeSelector) { | ||
super(serviceRegistry, shardSelector, nodeSelector); | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
...re/src/main/java/com/flipkart/ranger/core/finder/SimpleUnshardedServiceFinderBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright 2015 Flipkart Internet Pvt. Ltd. | ||
* <p> | ||
* 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 | ||
* <p> | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* <p> | ||
* 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.flipkart.ranger.core.finder; | ||
|
||
import com.flipkart.ranger.core.finder.serviceregistry.ListBasedServiceRegistry; | ||
import com.flipkart.ranger.core.finder.shardselector.ListShardSelector; | ||
import com.flipkart.ranger.core.model.*; | ||
|
||
public abstract class SimpleUnshardedServiceFinderBuilder<T, B extends SimpleUnshardedServiceFinderBuilder<T, B, D, C>, D extends Deserializer<T>, C extends Criteria<T>> | ||
extends BaseServiceFinderBuilder<T, ListBasedServiceRegistry<T>, SimpleUnshardedServiceFinder<T, C>, B, D, C> { | ||
|
||
@Override | ||
protected SimpleUnshardedServiceFinder<T, C> buildFinder( | ||
Service service, | ||
ShardSelector<T, C, ListBasedServiceRegistry<T>> shardSelector, | ||
ServiceNodeSelector<T> nodeSelector | ||
) { | ||
if (null == shardSelector) { | ||
shardSelector = new ListShardSelector<>(); | ||
} | ||
final ListBasedServiceRegistry<T> serviceRegistry = new ListBasedServiceRegistry<>(service); | ||
return new SimpleUnshardedServiceFinder<>(serviceRegistry, shardSelector, nodeSelector); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.