Commit 2caebf9cda1ab96b22c9b79a5be7eb1f5139df5c

Authored by Gethin James
1 parent 48d9a171ab
Exists in master

SEARCH-188: Added the enum for property based sharding

src/main/java/org/alfresco/repo/index/shard/ShardMethodEnum.java
... ... @@ -38,7 +38,8 @@ public enum ShardMethodEnum
38 38 DATE,//Time stamp
39 39 DATE_YEAR,
40 40 DATE_MONTH,
41   - UNKOWN;
  41 + UNKOWN,
  42 + PROPERTY;
42 43  
43 44 public static ShardMethodEnum getShardMethod(String shardMethod)
44 45 {
... ... @@ -69,6 +70,9 @@ public enum ShardMethodEnum
69 70 case "DATE_MONTH":
70 71 shardMethodEnum = DATE_MONTH;
71 72 break;
  73 + case "PROPERTY":
  74 + shardMethodEnum = PROPERTY;
  75 + break;
72 76 default:
73 77 shardMethodEnum = UNKOWN;
74 78 break;
... ...
src/test/java/org/alfresco/repo/index/ShardMethodEnumTest.java
... ... @@ -69,6 +69,11 @@ public class ShardMethodEnumTest
69 69 Assert.assertEquals(ShardMethodEnum.DATE_MONTH, ShardMethodEnum.getShardMethod("DATE_MONTH"));
70 70 }
71 71 @Test
  72 + public void testTypeProperty()
  73 + {
  74 + Assert.assertEquals(ShardMethodEnum.PROPERTY, ShardMethodEnum.getShardMethod("PROPERTY"));
  75 + }
  76 + @Test
72 77 public void testUnknown()
73 78 {
74 79 Assert.assertEquals(ShardMethodEnum.UNKOWN, ShardMethodEnum.getShardMethod("UNKOWN"));
... ...