Apache Gora
  1. Apache Gora
  2. GORA-153

gora-cassandra does not correctly handle DELETED State for MAP

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.2
    • Fix Version/s: 0.2.1
    • Component/s: gora-cassandra
    • Labels:
      None

      Description

      gora-cassandra does not correctly handle State.DELETED.

      It makes gora-cassandra test fail.

      Tests run: 28, Failures: 2, Errors: 9, Skipped: 0, Time elapsed: 18.081 sec <<< FAILURE!
      testUpdate(org.apache.gora.cassandra.store.TestCassandraStore) Time elapsed: 0.889 sec <<< FAILURE!
      junit.framework.AssertionFailedError: expected:<3> but was:<7>
      at junit.framework.Assert.fail(Assert.java:50)
      at junit.framework.Assert.failNotEquals(Assert.java:287)
      at junit.framework.Assert.assertEquals(Assert.java:67)
      at junit.framework.Assert.assertEquals(Assert.java:199)
      at junit.framework.Assert.assertEquals(Assert.java:205)
      at org.apache.gora.store.DataStoreTestUtil.testUpdateWebPage(DataStoreTestUtil.java:310)
      at org.apache.gora.store.DataStoreTestBase.testUpdate(DataStoreTestBase.java:267)

      for (int j = 0; j < urls.length; j += 2)

      { webPage.putToOutlinks(new Utf8(anchor + j), new Utf8(urls[j])); } // webPage.getOutlinks().size() is 4.

      webPage.getOutlinks().clear(); // webPage.getOutlinks().size() should be 0.

      for (int j = 1; j < urls.length; j += 2) { webPage.putToOutlinks(new Utf8(anchor + j), new Utf8(urls[j])); }

      // webPage.getOutlinks().size() should be 3.

      dataStore.flush(); // It ignores DELETED State, so 7 are written.
      WebPage webPage = dataStore.get(urls[i]);

      Assert.assertEquals(count, webPage.getOutlinks().size()); // 3 != 7 .. ERROR

      1. GORA-153.patch
        6 kB
        Kazuomi Kashii

        Issue Links

          Activity

          Hide
          Kazuomi Kashii added a comment -

          Correctly handle DELETE State for MAP.

          Show
          Kazuomi Kashii added a comment - Correctly handle DELETE State for MAP.
          Hide
          Kazuomi Kashii added a comment -

          $ svn commit --username kazk --message "Fixes GORA-153 to correctly handle DELETED State for MAP"
          Sending CHANGES.txt
          Sending gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/StatefulHashMapSerializer.java
          Sending gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraClient.java
          Sending gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraStore.java
          Sending gora-cassandra/src/main/java/org/apache/gora/cassandra/store/HectorUtils.java
          Sending pom.xml
          Transmitting file data ......
          Committed revision 1363667.
          $

          Show
          Kazuomi Kashii added a comment - $ svn commit --username kazk --message "Fixes GORA-153 to correctly handle DELETED State for MAP" Sending CHANGES.txt Sending gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/StatefulHashMapSerializer.java Sending gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraClient.java Sending gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraStore.java Sending gora-cassandra/src/main/java/org/apache/gora/cassandra/store/HectorUtils.java Sending pom.xml Transmitting file data ...... Committed revision 1363667. $
          Hide
          Hudson added a comment -

          Integrated in gora-trunk #360 (See https://builds.apache.org/job/gora-trunk/360/)
          Fixes GORA-153 to correctly handle DELETED State for MAP (Revision 1363667)

          Result = UNSTABLE
          kazk :
          Files :

          • /gora/trunk/CHANGES.txt
          • /gora/trunk/gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/StatefulHashMapSerializer.java
          • /gora/trunk/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraClient.java
          • /gora/trunk/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraStore.java
          • /gora/trunk/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/HectorUtils.java
          • /gora/trunk/pom.xml
          Show
          Hudson added a comment - Integrated in gora-trunk #360 (See https://builds.apache.org/job/gora-trunk/360/ ) Fixes GORA-153 to correctly handle DELETED State for MAP (Revision 1363667) Result = UNSTABLE kazk : Files : /gora/trunk/CHANGES.txt /gora/trunk/gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/StatefulHashMapSerializer.java /gora/trunk/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraClient.java /gora/trunk/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraStore.java /gora/trunk/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/HectorUtils.java /gora/trunk/pom.xml
          Hide
          Hazem Taji added a comment -

          Even though the unit test passes, this modification will fail to properly function. Since we are keeping the reference to the StatefulHashMap instead of duplicating it in the CassandraStore put method, whenever Gora decides to re-use it before flushing we are losing all data. Please correct me if I am wrong.

          Show
          Hazem Taji added a comment - Even though the unit test passes, this modification will fail to properly function. Since we are keeping the reference to the StatefulHashMap instead of duplicating it in the CassandraStore put method, whenever Gora decides to re-use it before flushing we are losing all data. Please correct me if I am wrong.
          Hide
          Lewis John McGibbney added a comment -

          I never ever saw or acknowledged the last comment from Hazem. Kaz, opened GORA-182 to address the concerns and subsequent findings.

          Show
          Lewis John McGibbney added a comment - I never ever saw or acknowledged the last comment from Hazem. Kaz, opened GORA-182 to address the concerns and subsequent findings.
          Hide
          Kazuomi Kashii added a comment -

          Hazem, thanks for your pointing out the issue.
          Unfortunately, I had not had time since mid August, and I had not noticed your important comment until Lewis mentioned today as above.
          I think GORA-182 should fix the issue.

          Show
          Kazuomi Kashii added a comment - Hazem, thanks for your pointing out the issue. Unfortunately, I had not had time since mid August, and I had not noticed your important comment until Lewis mentioned today as above. I think GORA-182 should fix the issue.
          Hide
          Renato Javier Marroquín Mogrovejo added a comment - - edited

          Hi all,

          Has this been solved? I mean is it integrated into trunk? or is GORA-182 going to solve this as well? I have some time now and I can try taking a swing at it.

          Show
          Renato Javier Marroquín Mogrovejo added a comment - - edited Hi all, Has this been solved? I mean is it integrated into trunk? or is GORA-182 going to solve this as well? I have some time now and I can try taking a swing at it.
          Hide
          Kazuomi Kashii added a comment -

          GORA-182.patch has not been integrated into trunk yet, but I think GORA-182.patch should fix the trouble that Hazem mentioned on 2012-08-25.
          GORA-182.patch should fix the original GORA-153 as well.

          Show
          Kazuomi Kashii added a comment - GORA-182 .patch has not been integrated into trunk yet, but I think GORA-182 .patch should fix the trouble that Hazem mentioned on 2012-08-25. GORA-182 .patch should fix the original GORA-153 as well.
          Hide
          Hudson added a comment -

          Integrated in goraOracle #6 (See https://builds.apache.org/job/goraOracle/6/)
          Fixes GORA-153 to correctly handle DELETED State for MAP (Revision 36dfd5b95a854d36845621fd8f98228ab8d18064)

          Result = FAILURE
          kazk :
          Files :

          • CHANGES.txt
          • pom.xml
          • gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraStore.java
          • gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraClient.java
          • gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/StatefulHashMapSerializer.java
          • gora-cassandra/src/main/java/org/apache/gora/cassandra/store/HectorUtils.java
          Show
          Hudson added a comment - Integrated in goraOracle #6 (See https://builds.apache.org/job/goraOracle/6/ ) Fixes GORA-153 to correctly handle DELETED State for MAP (Revision 36dfd5b95a854d36845621fd8f98228ab8d18064) Result = FAILURE kazk : Files : CHANGES.txt pom.xml gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraStore.java gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraClient.java gora-cassandra/src/main/java/org/apache/gora/cassandra/serializers/StatefulHashMapSerializer.java gora-cassandra/src/main/java/org/apache/gora/cassandra/store/HectorUtils.java

            People

            • Assignee:
              Unassigned
              Reporter:
              Kazuomi Kashii
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development