Skip to content

Commit

Permalink
feat: remove useless class
Browse files Browse the repository at this point in the history
  • Loading branch information
AElfBourneShi committed Sep 20, 2024
1 parent c6301ec commit de4153a
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 33 deletions.
26 changes: 13 additions & 13 deletions src/AElf.EntityMapping.Elasticsearch/Sharding/RouteKeyCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@

namespace AElf.EntityMapping.Elasticsearch.Sharding;

public class RouteKeyCollection:Entity,IEntity<string>,IEntityMappingEntity,IRouteKeyCollection
{
[Keyword]public string Id { get; set; }

[Keyword]public string CollectionName { get; set; }
//can only support string type
[Keyword]public string CollectionRouteKey { get; set; }

public override object[] GetKeys()
{
return new object[] {Id};
}
}
// public class RouteKeyCollection:Entity,IEntity<string>,IEntityMappingEntity,IRouteKeyCollection
// {
// [Keyword]public string Id { get; set; }
//
// [Keyword]public string CollectionName { get; set; }
// //can only support string type
// [Keyword]public string CollectionRouteKey { get; set; }
//
// public override object[] GetKeys()
// {
// return new object[] {Id};
// }
// }
16 changes: 6 additions & 10 deletions src/AElf.EntityMapping/Sharding/CollectionRouteKeyItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@

namespace AElf.EntityMapping.Sharding;

public class CollectionRouteKeyItem<TEntity>
{
public string FieldName { get; set; }
// public Type FieldValueType { get; set; }
// public string FieldValueType { get; set; }
public string CollectionName { get; set; }
// public bool IsShardKey { get; set; }
// public bool IsRouteKey { get; set; }
public Func<TEntity, string> GetRouteKeyValueFunc { get; set; }
}
// public class CollectionRouteKeyItem<TEntity>
// {
// public string FieldName { get; set; }
// public string CollectionName { get; set; }
// public Func<TEntity, string> GetRouteKeyValueFunc { get; set; }
// }
16 changes: 8 additions & 8 deletions src/AElf.EntityMapping/Sharding/IRouteKeyCollection.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
namespace AElf.EntityMapping.Sharding;

public interface IRouteKeyCollection
{
string Id { get; set; }

string CollectionName { get; set; }
//can only support string type
string CollectionRouteKey { get; set; }
}
// public interface IRouteKeyCollection
// {
// string Id { get; set; }
//
// string CollectionName { get; set; }
// //can only support string type
// string CollectionRouteKey { get; set; }
// }
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ namespace AElf.EntityMapping.Elasticsearch;
public class ElasticIndexServiceTests: AElfElasticsearchTestBase
{
private readonly IElasticIndexService _elasticIndexService;
private readonly IDistributedCache<List<CollectionRouteKeyItem<BlockIndex>>> _indexMarkFieldCache;
// private readonly IDistributedCache<List<CollectionRouteKeyItem<BlockIndex>>> _indexMarkFieldCache;

public ElasticIndexServiceTests()
{
_elasticIndexService = GetRequiredService<IElasticIndexService>();
_indexMarkFieldCache= GetRequiredService<IDistributedCache<List<CollectionRouteKeyItem<BlockIndex>>>>();
// _indexMarkFieldCache= GetRequiredService<IDistributedCache<List<CollectionRouteKeyItem<BlockIndex>>>>();
}

// [Fact]
Expand Down

0 comments on commit de4153a

Please sign in to comment.