Loading shared/src/main/java/com/inteligr8/alfresco/asie/model/Shard.java +8 −4 Original line number Diff line number Diff line Loading @@ -19,7 +19,7 @@ public class Shard implements Serializable { private final String spec; protected Shard(ShardSet shardSet, int shardId) { this.spec = shardSet.getCore() + "~" + shardId; this.spec = shardSet.getCore() + "-" + shardId; } protected Shard(String spec) { Loading @@ -34,16 +34,20 @@ public class Shard implements Serializable { } public String getSpec() { return spec; return this.spec; } public String getCoreName() { return this.spec; } public String extractShardSetCore() { int pos = this.spec.indexOf('~'); int pos = this.spec.lastIndexOf('-'); return this.spec.substring(0, pos); } public int extractShardId() { int pos = this.spec.indexOf('~'); int pos = this.spec.lastIndexOf('-'); return Integer.parseInt(this.spec.substring(pos+1)); } Loading shared/src/main/java/com/inteligr8/alfresco/asie/model/ShardInstance.java +5 −5 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ public class ShardInstance implements Serializable { private final String spec; protected ShardInstance(Shard shard, SolrHost node) { this.spec = shard.getSpec() + "~" + node.getSpec(); this.spec = node.getSpec() + "~" + shard.getSpec(); } public org.alfresco.repo.index.shard.ShardInstance toAlfrescoModel(org.alfresco.repo.index.shard.Shard shard) { Loading @@ -33,14 +33,14 @@ public class ShardInstance implements Serializable { return spec; } public Shard extractShard() { public SolrHost extractNode() { int pos = this.spec.indexOf('~'); return Shard.from(this.spec.substring(0, pos)); return SolrHost.from(this.spec.substring(0, pos)); } public SolrHost extractNode() { public Shard extractShard() { int pos = this.spec.indexOf('~'); return SolrHost.from(this.spec.substring(pos+1)); return Shard.from(this.spec.substring(pos+1)); } @Override Loading shared/src/main/java/com/inteligr8/alfresco/asie/model/SolrHost.java +2 −0 Original line number Diff line number Diff line Loading @@ -41,6 +41,8 @@ public class SolrHost implements Serializable { this.spec = spec; Matcher matcher = PATTERN.matcher(spec); if (!matcher.find()) throw new IllegalArgumentException(); this.hostname = matcher.group(1); this.port = Integer.parseInt(matcher.group(2)); this.path = matcher.group(3); Loading Loading
shared/src/main/java/com/inteligr8/alfresco/asie/model/Shard.java +8 −4 Original line number Diff line number Diff line Loading @@ -19,7 +19,7 @@ public class Shard implements Serializable { private final String spec; protected Shard(ShardSet shardSet, int shardId) { this.spec = shardSet.getCore() + "~" + shardId; this.spec = shardSet.getCore() + "-" + shardId; } protected Shard(String spec) { Loading @@ -34,16 +34,20 @@ public class Shard implements Serializable { } public String getSpec() { return spec; return this.spec; } public String getCoreName() { return this.spec; } public String extractShardSetCore() { int pos = this.spec.indexOf('~'); int pos = this.spec.lastIndexOf('-'); return this.spec.substring(0, pos); } public int extractShardId() { int pos = this.spec.indexOf('~'); int pos = this.spec.lastIndexOf('-'); return Integer.parseInt(this.spec.substring(pos+1)); } Loading
shared/src/main/java/com/inteligr8/alfresco/asie/model/ShardInstance.java +5 −5 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ public class ShardInstance implements Serializable { private final String spec; protected ShardInstance(Shard shard, SolrHost node) { this.spec = shard.getSpec() + "~" + node.getSpec(); this.spec = node.getSpec() + "~" + shard.getSpec(); } public org.alfresco.repo.index.shard.ShardInstance toAlfrescoModel(org.alfresco.repo.index.shard.Shard shard) { Loading @@ -33,14 +33,14 @@ public class ShardInstance implements Serializable { return spec; } public Shard extractShard() { public SolrHost extractNode() { int pos = this.spec.indexOf('~'); return Shard.from(this.spec.substring(0, pos)); return SolrHost.from(this.spec.substring(0, pos)); } public SolrHost extractNode() { public Shard extractShard() { int pos = this.spec.indexOf('~'); return SolrHost.from(this.spec.substring(pos+1)); return Shard.from(this.spec.substring(pos+1)); } @Override Loading
shared/src/main/java/com/inteligr8/alfresco/asie/model/SolrHost.java +2 −0 Original line number Diff line number Diff line Loading @@ -41,6 +41,8 @@ public class SolrHost implements Serializable { this.spec = spec; Matcher matcher = PATTERN.matcher(spec); if (!matcher.find()) throw new IllegalArgumentException(); this.hostname = matcher.group(1); this.port = Integer.parseInt(matcher.group(2)); this.path = matcher.group(3); Loading