@Override public Region updateRegion( RegionId regionId, String name, Region.Type type, List<Set<NodeId>> masterNodeIds) { return regionsRepo .compute( regionId, (id, region) -> { nullIsNotFound(region, NO_REGION); return new DefaultRegion(regionId, name, type, masterNodeIds); }) .value(); }
@Override public Region createRegion( RegionId regionId, String name, Region.Type type, List<Set<NodeId>> masterNodeIds) { return regionsRepo .compute( regionId, (id, region) -> { checkArgument(region == null, DUPLICATE_REGION); return new DefaultRegion(regionId, name, type, masterNodeIds); }) .value(); }