You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by vanzin <gi...@git.apache.org> on 2017/06/06 20:54:57 UTC

[GitHub] spark pull request #18221: [SPARK-20655][core] In-memory KVStore implementat...

GitHub user vanzin opened a pull request:

    https://github.com/apache/spark/pull/18221

    [SPARK-20655][core] In-memory KVStore implementation.

    This change adds an in-memory implementation of KVStore that can be
    used by the live UI.
    
    The implementation is not fully optimized, neither for speed nor
    space, but should be fast enough for using in the listener bus.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/vanzin/spark shs-ng/M1.2

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/18221.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #18221
    
----
commit 7b43ac31128507b8e19e1d8e8db1e5649ce85c13
Author: Marcelo Vanzin <va...@cloudera.com>
Date:   2017-04-26T18:37:43Z

    SHS-NG M1.2: In-memory KVStore implementation.
    
    This change adds an in-memory implementation of KVStore that can be
    used by the live UI.
    
    The implementation is not fully optimized, neither for speed nor
    space, but should be fast enough for using in the listener bus.

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #18221: [SPARK-20655][core] In-memory KVStore implementation.

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/18221
  
    **[Test build #77801 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/77801/testReport)** for PR 18221 at commit [`46c7245`](https://github.com/apache/spark/commit/46c7245e79dd3db67e062bfe2ebb43bbda8fdff5).


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #18221: [SPARK-20655][core] In-memory KVStore implementation.

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on the issue:

    https://github.com/apache/spark/pull/18221
  
    > Question: why are these files written in Java?
    
    Because my initial goal was to also use these in modules that are Java-only such as the shuffle service. I haven't done that yet, but having the library in Java leaves that option open.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #18221: [SPARK-20655][core] In-memory KVStore implementation.

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/18221
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/77947/
    Test FAILed.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #18221: [SPARK-20655][core] In-memory KVStore implementation.

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on the issue:

    https://github.com/apache/spark/pull/18221
  
    retest this please



---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #18221: [SPARK-20655][core] In-memory KVStore implementation.

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/18221
  
    Merged build finished. Test PASSed.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #18221: [SPARK-20655][core] In-memory KVStore implementation.

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/18221
  
    **[Test build #77801 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/77801/testReport)** for PR 18221 at commit [`46c7245`](https://github.com/apache/spark/commit/46c7245e79dd3db67e062bfe2ebb43bbda8fdff5).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #18221: [SPARK-20655][core] In-memory KVStore implementation.

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/18221
  
    **[Test build #77947 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/77947/testReport)** for PR 18221 at commit [`cb96ac1`](https://github.com/apache/spark/commit/cb96ac16f17c2abc788c2e3ba7ccf3acb22ea785).


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #18221: [SPARK-20655][core] In-memory KVStore implementat...

Posted by tejasapatil <gi...@git.apache.org>.
Github user tejasapatil commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18221#discussion_r120539837
  
    --- Diff: common/kvstore/src/main/java/org/apache/spark/kvstore/ArrayWrappers.java ---
    @@ -0,0 +1,214 @@
    +/*
    + * 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.spark.kvstore;
    +
    +import java.util.Arrays;
    +
    +import com.google.common.base.Preconditions;
    +import com.google.common.base.Objects;
    +
    +/**
    + * A factory for array wrappers so that arrays can be used as a key in a map, sorted or not.
    + *
    + * The comparator implementation makes two assumptions:
    + * - All elements are instances of Comparable
    + * - When comparing two arrays, they both contain elements of the same type in corresponding
    + *   indices.
    + *
    + * Otherwise, ClassCastExceptions may occur. The equality method can compare any two arrays.
    + *
    + * This class is not efficient and is mostly meant to compare really small arrays, like those
    + * generally used as indices and keys in a KVStore.
    + */
    +class ArrayWrappers {
    +
    +  @SuppressWarnings("unchecked")
    +  public static Comparable<Object> forArray(Object a) {
    +    Preconditions.checkArgument(a.getClass().isArray());
    +    Comparable<?> ret;
    +    if (a instanceof int[]) {
    +      ret = new ComparableIntArray((int[]) a);
    +    } else if (a instanceof long[]) {
    +      ret = new ComparableLongArray((long[]) a);
    +    } else if (a instanceof byte[]) {
    +      ret = new ComparableByteArray((byte[]) a);
    +    } else {
    +      Preconditions.checkArgument(!a.getClass().getComponentType().isPrimitive());
    +      ret = new ComparableObjectArray((Object[]) a);
    +    }
    +    return (Comparable<Object>) ret;
    +  }
    +
    +  private static class ComparableIntArray implements Comparable<ComparableIntArray> {
    +
    +    private final int[] array;
    +
    +    ComparableIntArray(int[] array) {
    +      this.array = array;
    +    }
    +
    +    @Override
    +    public boolean equals(Object other) {
    +      if (!(other instanceof ComparableIntArray)) {
    +        return false;
    +      }
    +      return Arrays.equals(array, ((ComparableIntArray) other).array);
    +    }
    +
    +    @Override
    +    public int hashCode() {
    +      int code = 0;
    +      for (int i = 0; i < array.length; i++) {
    +        code += array[i];
    --- End diff --
    
    For input array with same data but different ordering, this will produce the same hash. Honestly I am not able to see how this will fit in the bigger picture so not sure if that will happen. Would recommend doing `code = (code * 31) + array[i];`


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #18221: [SPARK-20655][core] In-memory KVStore implementat...

Posted by tejasapatil <gi...@git.apache.org>.
Github user tejasapatil commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18221#discussion_r120536351
  
    --- Diff: project/SparkBuild.scala ---
    @@ -240,7 +240,8 @@ object SparkBuild extends PomBuild {
     
         javacOptions in Compile ++= Seq(
           "-encoding", "UTF-8",
    -      "-source", javacJVMVersion.value
    +      "-source", javacJVMVersion.value,
    +      "-Xlint:unchecked"
    --- End diff --
    
    is it possible to address / suppress warning at specific sections in the code and not do it for the entire repo ?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #18221: [SPARK-20655][core] In-memory KVStore implementat...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin closed the pull request at:

    https://github.com/apache/spark/pull/18221


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #18221: [SPARK-20655][core] In-memory KVStore implementation.

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/18221
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/77783/
    Test PASSed.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #18221: [SPARK-20655][core] In-memory KVStore implementation.

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/18221
  
    Merged build finished. Test PASSed.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #18221: [SPARK-20655][core] In-memory KVStore implementation.

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/18221
  
    **[Test build #77783 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/77783/testReport)** for PR 18221 at commit [`7b43ac3`](https://github.com/apache/spark/commit/7b43ac31128507b8e19e1d8e8db1e5649ce85c13).


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #18221: [SPARK-20655][core] In-memory KVStore implementation.

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/18221
  
    **[Test build #77784 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/77784/testReport)** for PR 18221 at commit [`6eb3ffe`](https://github.com/apache/spark/commit/6eb3ffe5afb18fe20290a1757f6836ba84db787f).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #18221: [SPARK-20655][core] In-memory KVStore implementat...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18221#discussion_r120677370
  
    --- Diff: common/kvstore/src/main/java/org/apache/spark/kvstore/ArrayWrappers.java ---
    @@ -0,0 +1,214 @@
    +/*
    + * 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.spark.kvstore;
    +
    +import java.util.Arrays;
    +
    +import com.google.common.base.Preconditions;
    +import com.google.common.base.Objects;
    +
    +/**
    + * A factory for array wrappers so that arrays can be used as a key in a map, sorted or not.
    + *
    + * The comparator implementation makes two assumptions:
    + * - All elements are instances of Comparable
    + * - When comparing two arrays, they both contain elements of the same type in corresponding
    + *   indices.
    + *
    + * Otherwise, ClassCastExceptions may occur. The equality method can compare any two arrays.
    + *
    + * This class is not efficient and is mostly meant to compare really small arrays, like those
    --- End diff --
    
    I think the largest array used by the listeners that capture app data is 3 elements.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #18221: [SPARK-20655][core] In-memory KVStore implementation.

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/18221
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/77801/
    Test PASSed.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #18221: [SPARK-20655][core] In-memory KVStore implementation.

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on the issue:

    https://github.com/apache/spark/pull/18221
  
    For context:
    
    - Project link: https://issues.apache.org/jira/browse/SPARK-18085
    - Upcoming PRs that build on this code: https://github.com/vanzin/spark/pulls



---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #18221: [SPARK-20655][core] In-memory KVStore implementation.

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/18221
  
    **[Test build #77783 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/77783/testReport)** for PR 18221 at commit [`7b43ac3`](https://github.com/apache/spark/commit/7b43ac31128507b8e19e1d8e8db1e5649ce85c13).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds the following public classes _(experimental)_:
      * `class ArrayWrappers `
      * `public class InMemoryStore implements KVStore `


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #18221: [SPARK-20655][core] In-memory KVStore implementat...

Posted by tejasapatil <gi...@git.apache.org>.
Github user tejasapatil commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18221#discussion_r120535432
  
    --- Diff: common/kvstore/src/main/java/org/apache/spark/kvstore/ArrayWrappers.java ---
    @@ -0,0 +1,214 @@
    +/*
    + * 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.spark.kvstore;
    +
    +import java.util.Arrays;
    +
    +import com.google.common.base.Preconditions;
    +import com.google.common.base.Objects;
    +
    +/**
    + * A factory for array wrappers so that arrays can be used as a key in a map, sorted or not.
    + *
    + * The comparator implementation makes two assumptions:
    + * - All elements are instances of Comparable
    + * - When comparing two arrays, they both contain elements of the same type in corresponding
    + *   indices.
    + *
    + * Otherwise, ClassCastExceptions may occur. The equality method can compare any two arrays.
    + *
    + * This class is not efficient and is mostly meant to compare really small arrays, like those
    --- End diff --
    
    > meant to compare really small arrays
    
    can you quantify how much "small" are we talking about here ?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #18221: [SPARK-20655][core] In-memory KVStore implementation.

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on the issue:

    https://github.com/apache/spark/pull/18221
  
    I moved this over to #18395 since jenkins is not triggering tests on this PR.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #18221: [SPARK-20655][core] In-memory KVStore implementation.

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/18221
  
    **[Test build #77784 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/77784/testReport)** for PR 18221 at commit [`6eb3ffe`](https://github.com/apache/spark/commit/6eb3ffe5afb18fe20290a1757f6836ba84db787f).


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #18221: [SPARK-20655][core] In-memory KVStore implementation.

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/18221
  
    **[Test build #77947 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/77947/testReport)** for PR 18221 at commit [`cb96ac1`](https://github.com/apache/spark/commit/cb96ac16f17c2abc788c2e3ba7ccf3acb22ea785).
     * This patch **fails Spark unit tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #18221: [SPARK-20655][core] In-memory KVStore implementation.

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on the issue:

    https://github.com/apache/spark/pull/18221
  
    retest this please



---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #18221: [SPARK-20655][core] In-memory KVStore implementation.

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/18221
  
    Merged build finished. Test PASSed.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #18221: [SPARK-20655][core] In-memory KVStore implementat...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18221#discussion_r120677922
  
    --- Diff: project/SparkBuild.scala ---
    @@ -240,7 +240,8 @@ object SparkBuild extends PomBuild {
     
         javacOptions in Compile ++= Seq(
           "-encoding", "UTF-8",
    -      "-source", javacJVMVersion.value
    +      "-source", javacJVMVersion.value,
    +      "-Xlint:unchecked"
    --- End diff --
    
    This is enabling the unchecked checks, not suppressing them. I don't think you can enable the checks in source code.  And if I read things correctly, it's enabled in the maven build (`-Xlint:all,-serial,-path`).
    
    I can remove the flag if it really bothers people, though (I didn't notice much extra noise from enabling it, and it helped me spot these occurrences in the code I'm adding.)


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #18221: [SPARK-20655][core] In-memory KVStore implementation.

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/18221
  
    Merged build finished. Test FAILed.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #18221: [SPARK-20655][core] In-memory KVStore implementat...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18221#discussion_r120677421
  
    --- Diff: common/kvstore/src/main/java/org/apache/spark/kvstore/ArrayWrappers.java ---
    @@ -0,0 +1,214 @@
    +/*
    + * 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.spark.kvstore;
    +
    +import java.util.Arrays;
    +
    +import com.google.common.base.Preconditions;
    +import com.google.common.base.Objects;
    +
    +/**
    + * A factory for array wrappers so that arrays can be used as a key in a map, sorted or not.
    + *
    + * The comparator implementation makes two assumptions:
    + * - All elements are instances of Comparable
    + * - When comparing two arrays, they both contain elements of the same type in corresponding
    + *   indices.
    + *
    + * Otherwise, ClassCastExceptions may occur. The equality method can compare any two arrays.
    + *
    + * This class is not efficient and is mostly meant to compare really small arrays, like those
    + * generally used as indices and keys in a KVStore.
    + */
    +class ArrayWrappers {
    +
    +  @SuppressWarnings("unchecked")
    +  public static Comparable<Object> forArray(Object a) {
    +    Preconditions.checkArgument(a.getClass().isArray());
    +    Comparable<?> ret;
    +    if (a instanceof int[]) {
    +      ret = new ComparableIntArray((int[]) a);
    +    } else if (a instanceof long[]) {
    +      ret = new ComparableLongArray((long[]) a);
    +    } else if (a instanceof byte[]) {
    +      ret = new ComparableByteArray((byte[]) a);
    +    } else {
    +      Preconditions.checkArgument(!a.getClass().getComponentType().isPrimitive());
    +      ret = new ComparableObjectArray((Object[]) a);
    +    }
    +    return (Comparable<Object>) ret;
    +  }
    +
    +  private static class ComparableIntArray implements Comparable<ComparableIntArray> {
    +
    +    private final int[] array;
    +
    +    ComparableIntArray(int[] array) {
    +      this.array = array;
    +    }
    +
    +    @Override
    +    public boolean equals(Object other) {
    +      if (!(other instanceof ComparableIntArray)) {
    +        return false;
    +      }
    +      return Arrays.equals(array, ((ComparableIntArray) other).array);
    +    }
    +
    +    @Override
    +    public int hashCode() {
    +      int code = 0;
    +      for (int i = 0; i < array.length; i++) {
    +        code += array[i];
    --- End diff --
    
    Sure, that's easy enough.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #18221: [SPARK-20655][core] In-memory KVStore implementation.

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/18221
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/77784/
    Test PASSed.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #18221: [SPARK-20655][core] In-memory KVStore implementation.

Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on the issue:

    https://github.com/apache/spark/pull/18221
  
    Question: why are these files written in Java? 


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #18221: [SPARK-20655][core] In-memory KVStore implementat...

Posted by tejasapatil <gi...@git.apache.org>.
Github user tejasapatil commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18221#discussion_r120997057
  
    --- Diff: project/SparkBuild.scala ---
    @@ -240,7 +240,8 @@ object SparkBuild extends PomBuild {
     
         javacOptions in Compile ++= Seq(
           "-encoding", "UTF-8",
    -      "-source", javacJVMVersion.value
    +      "-source", javacJVMVersion.value,
    +      "-Xlint:unchecked"
    --- End diff --
    
    Thanks for explanation. Lets keep it


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org