Skip to content

Commit 8a348c7

Browse files
committed
Add allocation_id to IndicesShardStores API
1 parent a14aac8 commit 8a348c7

File tree

6 files changed

+18
-13
lines changed

6 files changed

+18
-13
lines changed

src/Nest/Indices/Monitoring/IndicesShardStores/IndicesShardStoresResponse.cs

+6-3
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,13 @@ public class ShardStore
4141
[JsonProperty("transport_address")]
4242
public string TransportAddress { get; set; }
4343

44-
[JsonProperty("version")]
45-
public long Version { get; set; }
44+
[JsonProperty("legacy_version")]
45+
public long? LegacyVersion { get; set; }
4646

47-
[JsonProperty("store_exeption")]
47+
[JsonProperty("allocation_id")]
48+
public string AllocationId { get; set; }
49+
50+
[JsonProperty("store_exception")]
4851
public ShardStoreException StoreException { get; set; }
4952

5053
[JsonProperty("allocation")]

src/Nest/Indices/Monitoring/IndicesShardStores/ShardStoreJsonConverter.cs

+5-4
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ internal class ShardStoreJsonConverter : JsonConverter
1111
private readonly VerbatimDictionaryKeysJsonConverter _dictionaryConverter =
1212
new VerbatimDictionaryKeysJsonConverter();
1313

14-
private readonly PropertyJsonConverter _elasticTypeConverter = new PropertyJsonConverter();
15-
1614
public override bool CanRead => true;
1715
public override bool CanWrite => false;
1816
public override bool CanConvert(Type objectType) => objectType == typeof(IDictionary<string, IFieldMapping>);
@@ -42,15 +40,18 @@ public override object ReadJson(JsonReader reader, Type objectType, object exist
4240
case "transport_address":
4341
r.TransportAddress = p.Value.Value<string>();
4442
break;
45-
case "version":
46-
r.Version = p.Value.Value<long>();
43+
case "legacy_version":
44+
r.LegacyVersion = p.Value.Value<long?>();
4745
break;
4846
case "store_exception":
4947
r.StoreException = p.Value.ToObject<ShardStoreException>();
5048
break;
5149
case "allocation":
5250
r.Allocation = p.Value.ToObject<ShardStoreAllocation>();
5351
break;
52+
case "allocation_id":
53+
r.AllocationId = p.Value.Value<string>();
54+
break;
5455
case "attributes":
5556
r.Attributes = p.Value.ToObject<Dictionary<string, object>>();
5657
break;

src/Tests/ClientConcepts/HighLevel/Mapping/AutoMap.doc.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ public void OverridingAutoMappedAttributes()
583583
.Map<EmployeeWithAttributes>(m => m
584584
.AutoMap()
585585
.TtlField(ttl => ttl
586-
.Enable()
586+
.Enabled()
587587
.Default("10m")
588588
)
589589
.Properties(ps => ps

src/Tests/Indices/Monitoring/IndicesShardStores/IndicesShardStoresApiTests.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ [I] public Task AssertResponse() => AssertOnAllResponses(r =>
6666
shardStore.Id.Should().NotBeNullOrWhiteSpace();
6767
shardStore.Name.Should().NotBeNullOrWhiteSpace();
6868
shardStore.TransportAddress.Should().NotBeNullOrWhiteSpace();
69-
shardStore.Version.Should().BeGreaterThan(0);
69+
shardStore.LegacyVersion.Should().Be(null);
70+
shardStore.AllocationId.Should().NotBeNullOrWhiteSpace();
7071
shardStore.Allocation.Should().Be(ShardStoreAllocation.Primary);
7172
});
7273
}

src/Tests/Mapping/Metafields/Ttl/TypeMappingTestBase.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ public TtlMetafieldApiTest(ReadOnlyCluster cluster, EndpointUsage usage) : base(
2222
protected override Func<PutMappingDescriptor<Project>, IPutMappingRequest> Fluent => d => d.Index(CallIsolatedValue)
2323
.TtlField(ttl => ttl
2424
.Default("30m")
25-
.Enable()
25+
.Enabled()
2626
);
2727

2828
protected override PutMappingRequest<Project> Initializer => new PutMappingRequest<Project>(CallIsolatedValue, Type<Project>())
2929
{
30-
TtlField = new TtlField { Default = TimeSpan.FromMinutes(30), Enabled = true }
30+
TtlField = new TtlField { Default = TimeSpan.FromMinutes(30), Enabled = true }
3131
};
3232
}
3333
}

src/Tests/tests.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# mode either u (unit test), i (integration test) or m (mixed mode)
2-
mode: u
2+
mode: i
33
# the elasticsearch version that should be started
4-
elasticsearch_version: 5.0.0-alpha1-SNAPSHOT
4+
elasticsearch_version: 5.0.0-alpha1
55
# whether we want to forcefully reseed on the node, if you are starting the tests with a node already running
66
force_reseed: true
77
# do not spawn nodes as part of the test setup but rely on a manually started es node being up

0 commit comments

Comments
 (0)