@Test public void testEquals(){ ShardMetaComparator comparator = new ShardMetaComparator(current, future); comparator.compare(); Assert.assertEquals(0, comparator.getAdded().size()); Assert.assertEquals(0, comparator.getRemoved().size()); Assert.assertEquals(0, comparator.getMofified().size()); }
@Override public void compare() { List<Redis> currentAll = getAll(current); List<Redis> futureAll = getAll(future); Pair<List<Redis>, List<Pair<Redis, Redis>>> subResult = sub(futureAll, currentAll); List<Redis> tAdded = subResult.getKey(); added.addAll(tAdded); List<Pair<Redis, Redis>> modified = subResult.getValue(); compareConfigConfig(modified); List<Redis> tRemoved = sub(currentAll, futureAll).getKey(); removed.addAll(tRemoved); }
ShardMetaComparator extends AbstractMetaComparator<Redis, ShardChange> { @Override public void compare() { List<Redis> currentAll = getAll(current); List<Redis> futureAll = getAll(future); Pair<List<Redis>, List<Pair<Redis, Redis>>> subResult = sub(futureAll, currentAll); List<Redis> tAdded = subResult.getKey(); added.addAll(tAdded); List<Pair<Redis, Redis>> modified = subResult.getValue(); compareConfigConfig(modified); List<Redis> tRemoved = sub(currentAll, futureAll).getKey(); removed.addAll(tRemoved); } }
ShardMetaComparator extends AbstractMetaComparator<Redis, ShardChange> { @Override public void compare() { List<Redis> currentAll = getAll(current); List<Redis> futureAll = getAll(future); Pair<List<Redis>, List<Pair<Redis, Redis>>> subResult = sub(futureAll, currentAll); List<Redis> tAdded = subResult.getKey(); added.addAll(tAdded); List<Pair<Redis, Redis>> modified = subResult.getValue(); compareConfigConfig(modified); List<Redis> tRemoved = sub(currentAll, futureAll).getKey(); removed.addAll(tRemoved); } ShardMetaComparator(ShardMeta current, ShardMeta future); }
ShardMetaComparator extends AbstractMetaComparator<Redis, ShardChange> { @Override public void compare() { List<Redis> currentAll = getAll(current); List<Redis> futureAll = getAll(future); Pair<List<Redis>, List<Pair<Redis, Redis>>> subResult = sub(futureAll, currentAll); List<Redis> tAdded = subResult.getKey(); added.addAll(tAdded); List<Pair<Redis, Redis>> modified = subResult.getValue(); compareConfigConfig(modified); List<Redis> tRemoved = sub(currentAll, futureAll).getKey(); removed.addAll(tRemoved); } ShardMetaComparator(ShardMeta current, ShardMeta future); @Override void compare(); ShardMeta getCurrent(); ShardMeta getFuture(); @Override String idDesc(); }
ShardMetaComparator extends AbstractMetaComparator<Redis, ShardChange> { @Override public void compare() { List<Redis> currentAll = getAll(current); List<Redis> futureAll = getAll(future); Pair<List<Redis>, List<Pair<Redis, Redis>>> subResult = sub(futureAll, currentAll); List<Redis> tAdded = subResult.getKey(); added.addAll(tAdded); List<Pair<Redis, Redis>> modified = subResult.getValue(); compareConfigConfig(modified); List<Redis> tRemoved = sub(currentAll, futureAll).getKey(); removed.addAll(tRemoved); } ShardMetaComparator(ShardMeta current, ShardMeta future); @Override void compare(); ShardMeta getCurrent(); ShardMeta getFuture(); @Override String idDesc();  }