From notifications-return-3866-apmail-ignite-notifications-archive=ignite.apache.org@ignite.apache.org Mon Jun 17 13:43:40 2019 Return-Path: X-Original-To: apmail-ignite-notifications-archive@minotaur.apache.org Delivered-To: apmail-ignite-notifications-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by minotaur.apache.org (Postfix) with SMTP id D1AB918FF4 for ; Mon, 17 Jun 2019 13:43:39 +0000 (UTC) Received: (qmail 64173 invoked by uid 500); 17 Jun 2019 13:43:39 -0000 Delivered-To: apmail-ignite-notifications-archive@ignite.apache.org Received: (qmail 64155 invoked by uid 500); 17 Jun 2019 13:43:39 -0000 Mailing-List: contact notifications-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list notifications@ignite.apache.org Received: (qmail 64141 invoked by uid 99); 17 Jun 2019 13:43:39 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Jun 2019 13:43:39 +0000 From: GitBox To: notifications@ignite.apache.org Subject: [GitHub] [ignite] anton-vinogradov commented on a change in pull request #5656: IGNITE-10663 Read Repair Message-ID: <156077901922.7344.5525419428509135897.gitbox@gitbox.apache.org> Date: Mon, 17 Jun 2019 13:43:39 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit anton-vinogradov commented on a change in pull request #5656: IGNITE-10663 Read Repair URL: https://github.com/apache/ignite/pull/5656#discussion_r294303953 ########## File path: modules/core/src/test/java/org/apache/ignite/internal/processors/cache/consistency/AbstractFullSetCacheConsistencyTest.java ########## @@ -0,0 +1,279 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.internal.processors.cache.consistency; + +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; +import java.util.function.Consumer; +import javax.cache.CacheException; +import org.apache.ignite.Ignite; +import org.apache.ignite.IgniteCache; +import org.apache.ignite.cache.CacheEntry; +import org.apache.ignite.internal.util.typedef.G; +import org.junit.Test; + +public abstract class AbstractFullSetCacheConsistencyTest extends AbstractCacheConsistencyTest { + /** + * + */ + protected static final Consumer GET_CHECK_AND_FIX = + (data) -> { + IgniteCache cache = data.cache; + Set keys = data.data.keySet(); + boolean raw = data.raw; + boolean async = data.async; + + assert keys.size() == 1; + + for (Map.Entry entry : data.data.entrySet()) { // Once. + try { + Integer key = entry.getKey(); + Integer latest = entry.getValue().latest; + + Integer res = + raw ? + async ? + cache.withReadRepair().getEntryAsync(key).get().getValue() : Review comment: Lets keep as is. Will be properly refactored in case such need happens. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org With regards, Apache Git Services