move to es core 1.4.2

This commit moves the es core dependency to 1.4.2, which becomes the minimum version required from now on.

Changes made accordingly to this decision since we can break backwards compatibility and assume es core>=1.4.2

Closes elastic/elasticsearch#562

Original commit: elastic/x-pack-elasticsearch@484b4a2528
This commit is contained in:
javanna 2014-12-08 13:40:21 +01:00 committed by Luca Cavanna
parent 82c9b4fc61
commit 98c3531bf9
4 changed files with 8 additions and 10 deletions

View File

@ -48,7 +48,7 @@
<properties>
<lucene.version>4.10.2</lucene.version>
<lucene.maven.version>4.10.2</lucene.maven.version>
<elasticsearch.version>1.4.0</elasticsearch.version>
<elasticsearch.version>1.4.2</elasticsearch.version>
<license.plugin.version>1.0.0-beta1</license.plugin.version>
<tests.jvms>auto</tests.jvms>

View File

@ -25,7 +25,7 @@ public class ShieldVersion implements Serializable {
// the (internal) format of the id is there so we can easily do after/before checks on the id
public static final int V_1_0_0_ID = /*00*/1000099;
public static final ShieldVersion V_1_0_0 = new ShieldVersion(V_1_0_0_ID, true, Version.V_1_4_0, LicenseVersion.V_1_0_0);
public static final ShieldVersion V_1_0_0 = new ShieldVersion(V_1_0_0_ID, true, Version.V_1_4_2, LicenseVersion.V_1_0_0);
public static final ShieldVersion CURRENT = V_1_0_0;

View File

@ -14,7 +14,6 @@ import org.elasticsearch.common.base.Predicates;
import org.elasticsearch.common.collect.ImmutableList;
import org.elasticsearch.common.component.AbstractComponent;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.inject.Provider;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.shield.User;
import org.elasticsearch.shield.audit.AuditTrail;
@ -32,17 +31,16 @@ import java.util.Set;
*/
public class InternalAuthorizationService extends AbstractComponent implements AuthorizationService {
private final Provider<ClusterService> clusterServiceProvider;
private final ClusterService clusterService;
private final RolesStore rolesStore;
private final AuditTrail auditTrail;
private final IndicesResolver[] indicesResolvers;
@Inject
//TODO replace Provider<ClusterService> with ClusterService once 1.4.1 is out, see https://github.com/elasticsearch/elasticsearch/pull/8415
public InternalAuthorizationService(Settings settings, RolesStore rolesStore, Provider<ClusterService> clusterServiceProvider, AuditTrail auditTrail) {
public InternalAuthorizationService(Settings settings, RolesStore rolesStore, ClusterService clusterService, AuditTrail auditTrail) {
super(settings);
this.rolesStore = rolesStore;
this.clusterServiceProvider = clusterServiceProvider;
this.clusterService = clusterService;
this.auditTrail = auditTrail;
this.indicesResolvers = new IndicesResolver[] {
new DefaultIndicesResolver(this)
@ -65,7 +63,7 @@ public class InternalAuthorizationService extends AbstractComponent implements A
ImmutableList.Builder<String> indicesAndAliases = ImmutableList.builder();
Predicate<String> predicate = Predicates.or(predicates.build());
MetaData metaData = clusterServiceProvider.get().state().metaData();
MetaData metaData = clusterService.state().metaData();
for (String index : metaData.concreteAllIndices()) {
if (predicate.apply(index)) {
indicesAndAliases.add(index);
@ -181,7 +179,7 @@ public class InternalAuthorizationService extends AbstractComponent implements A
}
private Set<String> resolveIndices(User user, String action, TransportRequest request) {
MetaData metaData = clusterServiceProvider.get().state().metaData();
MetaData metaData = clusterService.state().metaData();
// some APIs are indices requests that are not actually associated with indices. For example,
// search scroll request, is categorized under the indices context, but doesn't hold indices names

View File

@ -23,7 +23,7 @@ public class ClusterDiscoveryConfiguration extends SettingsSource {
static {
//see https://github.com/elasticsearch/elasticsearch/pull/8634
assert Version.CURRENT.onOrBefore(Version.V_1_4_0) : "Remove this class or bump the version, the required fixes will come with es core 1.5";
assert Version.CURRENT.onOrBefore(Version.V_1_4_2) : "Remove this class or bump the version, the required fixes will come with es core 1.5";
}
static Settings DEFAULT_NODE_SETTINGS = ImmutableSettings.settingsBuilder()