accumulo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From joshelser <>
Subject [GitHub] accumulo pull request: 4148 inmemorymap counter
Date Mon, 28 Mar 2016 16:16:30 GMT
Github user joshelser commented on a diff in the pull request:
    --- Diff: test/src/test/java/org/apache/accumulo/test/ ---
    @@ -0,0 +1,319 @@
    + * 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
    + *
    + *
    + *
    + * 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.accumulo.test;
    +import java.util.ArrayList;
    +import java.util.Arrays;
    +import java.util.Collections;
    +import java.util.HashMap;
    +import java.util.HashSet;
    +import java.util.List;
    +import java.util.Map;
    +import java.util.Set;
    +import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
    +import org.apache.accumulo.test.functional.NativeMapIT;
    +import org.apache.accumulo.tserver.InMemoryMap;
    +import org.apache.accumulo.tserver.MemKey;
    +import org.apache.accumulo.tserver.NativeMap;
    +import static org.junit.Assert.assertEquals;
    +import static;
    +import org.junit.BeforeClass;
    +import org.junit.Rule;
    +import org.junit.Test;
    +import org.junit.rules.TemporaryFolder;
    +import org.slf4j.Logger;
    +import org.slf4j.LoggerFactory;
    + * Integration Test for
    + * <p>
    + * User had problem writing one Mutation with multiple KV pairs that had the same key.
Doing so should write out all pairs in all mutations with a unique id. In
    + * typical operation, you would only see the last one when scanning. User had a combiner
on the table, and they noticed that when using InMemoryMap with
    + * NativeMapWrapper, only the last KV pair was ever written. When InMemoryMap used DefaultMap,
all KV pairs were added and the behavior worked as expected.
    + *
    + * This IT inserts a variety of Mutations with and without the same KV pairs and then
inspects result of InMemoryMap mutate, looking for unique id stored with
    + * each key. This unique id, shown as mc= in the MemKey toString, was originally used
for scan Isolation. Writing the same key multiple times in the same
    + * mutation is a secondary use case, discussed in
In addition to NativeMapWrapper and DefaultMap,
    + * LocalityGroupMap was add in
    + *
    + * This test has to be an IT in accumulo-test, because libaccumulo is built in 'integration-test'
phase of accumulo-native, which currently runs right before
    + * accumulo-test. The tests for DefaultMap could move to a unit test in tserver, but
they are here for convenience of viewing both at the same time.
    + */
    +public class InMemoryMapIT {
    +  private static final Logger log = LoggerFactory.getLogger(InMemoryMapIT.class);
    +  @Rule
    +  public TemporaryFolder tempFolder = new TemporaryFolder(new File(System.getProperty("user.dir")
+ "/target"));
    +  @BeforeClass
    +  public static void ensureNativeLibrary() throws FileNotFoundException {
    +    File nativeMapLocation = NativeMapIT.nativeMapLocation();
    +    log.debug("Native map location " + nativeMapLocation);
    +    NativeMap.loadNativeLib(Collections.singletonList(nativeMapLocation));
    +    if (!NativeMap.isLoaded()) {
    +      fail("Missing the native library from " + nativeMapLocation.getAbsolutePath() +
"\nYou need to build the libaccumulo binary first. "
    +          + "\nTry running 'mvn clean install -Dit.test=InMemoryMapIT -Dtest=foo -DfailIfNoTests=false
-Dfindbugs.skip -Dcheckstyle.skip'");
    +      // afterwards, you can run the following
    +      // mvn clean verify -Dit.test=InMemoryMapIT -Dtest=foo -DfailIfNoTests=false -Dfindbugs.skip
-Dcheckstyle.skip -pl :accumulo-test
    --- End diff --
    Ahh, I didn't read far enough to the end of the line :) to see you also provided `-pl`.
I just checked what `NativeMapIT` does and this seems to be consistent, so it's probably OK
as-is. Thanks.

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

View raw message