metron-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nickal...@apache.org
Subject metron git commit: METRON-1867 Remove `/api/v1/update/replace` endpoint (nickwallen) closes apache/metron#1284
Date Fri, 07 Dec 2018 21:19:20 GMT
Repository: metron
Updated Branches:
  refs/heads/master d749961da -> 285ba5eb6


METRON-1867 Remove `/api/v1/update/replace` endpoint (nickwallen) closes apache/metron#1284


Project: http://git-wip-us.apache.org/repos/asf/metron/repo
Commit: http://git-wip-us.apache.org/repos/asf/metron/commit/285ba5eb
Tree: http://git-wip-us.apache.org/repos/asf/metron/tree/285ba5eb
Diff: http://git-wip-us.apache.org/repos/asf/metron/diff/285ba5eb

Branch: refs/heads/master
Commit: 285ba5eb604f2e286f72641308a1424234739402
Parents: d749961
Author: nickwallen <nick@nickallen.org>
Authored: Fri Dec 7 16:17:48 2018 -0500
Committer: nickallen <nickallen@apache.org>
Committed: Fri Dec 7 16:17:48 2018 -0500

----------------------------------------------------------------------
 .../src/app/model/replace-request.ts            |  24 --
 metron-interface/metron-rest/README.md          |  26 --
 .../rest/controller/UpdateController.java       |  12 -
 .../metron/rest/service/UpdateService.java      |   2 -
 .../rest/service/impl/UpdateServiceImpl.java    |  10 -
 .../UpdateControllerIntegrationTest.java        | 116 +++---
 .../elasticsearch/dao/ElasticsearchDao.java     |  17 +-
 .../indexing/dao/update/ReplaceRequest.java     |  77 ----
 .../metron/indexing/dao/update/UpdateDao.java   |  22 +-
 .../indexing/dao/InMemoryMetaAlertDao.java      |  23 +-
 .../indexing/dao/UpdateIntegrationTest.java     | 369 +++++++++----------
 .../integration/HBaseDaoIntegrationTest.java    |   7 -
 12 files changed, 229 insertions(+), 476 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/metron/blob/285ba5eb/metron-interface/metron-alerts/src/app/model/replace-request.ts
----------------------------------------------------------------------
diff --git a/metron-interface/metron-alerts/src/app/model/replace-request.ts b/metron-interface/metron-alerts/src/app/model/replace-request.ts
deleted file mode 100644
index d7c18b2..0000000
--- a/metron-interface/metron-alerts/src/app/model/replace-request.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-/**
- * 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.
- */
-
-export class ReplaceRequest {
-  replacement: {[key: string]: any};
-  guid: string;
-  sensorType: string;
-  index: string;
-}

http://git-wip-us.apache.org/repos/asf/metron/blob/285ba5eb/metron-interface/metron-rest/README.md
----------------------------------------------------------------------
diff --git a/metron-interface/metron-rest/README.md b/metron-interface/metron-rest/README.md
index f85707f..a3cbad7 100644
--- a/metron-interface/metron-rest/README.md
+++ b/metron-interface/metron-rest/README.md
@@ -373,7 +373,6 @@ Request and Response objects are JSON formatted.  The JSON schemas are
available
 | [ `GET /api/v1/storm/{name}`](#get-apiv1stormname)|
 | [ `GET /api/v1/storm/supervisors`](#get-apiv1stormsupervisors)|
 | [ `PATCH /api/v1/update/patch`](#patch-apiv1updatepatch)|
-| [ `PUT /api/v1/update/replace`](#put-apiv1updatereplace)|
 | [ `POST /api/v1/update/add/comment`](#put-apiv1updateaddcomment)|
 | [ `POST /api/v1/update/remove/comment`](#put-apiv1updateremovecomment)|
 | [ `GET /api/v1/user`](#get-apiv1user)|
@@ -978,31 +977,6 @@ Request and Response objects are JSON formatted.  The JSON schemas are
available
   * Returns:
     * 200 - Nothing
     * 404 - Document not found
-
-### `PUT /api/v1/update/replace`
-  * Description: Replace a document
-  * Input:
-    * request - Replacement request
-      * guid - The Patch UUID
-      * sensorType - The sensor type
-      * replacement - A Map representing the replaced document
-    * Example replacing a `bro` message with guid of `000-000-0000` :
-        ```
-        {
-          "guid" : "000-000-0000",
-          "sensorType" : "bro",
-          "replacement" : {
-            "source:type": "bro",
-            "guid" : "bro_index_2017.01.01.01:1",
-            "ip_src_addr":"192.168.1.2",
-            "ip_src_port": 8009,
-            "timestamp":200,
-            "rejected":false
-          }
-        }
-        ```
-  * Returns:
-    * 200 - Current user
     
 ### `POST /api/v1/update/add/comment`
   * Description: Add a comment to an alert

http://git-wip-us.apache.org/repos/asf/metron/blob/285ba5eb/metron-interface/metron-rest/src/main/java/org/apache/metron/rest/controller/UpdateController.java
----------------------------------------------------------------------
diff --git a/metron-interface/metron-rest/src/main/java/org/apache/metron/rest/controller/UpdateController.java
b/metron-interface/metron-rest/src/main/java/org/apache/metron/rest/controller/UpdateController.java
index 5550358..f16b6cd 100644
--- a/metron-interface/metron-rest/src/main/java/org/apache/metron/rest/controller/UpdateController.java
+++ b/metron-interface/metron-rest/src/main/java/org/apache/metron/rest/controller/UpdateController.java
@@ -24,7 +24,6 @@ import org.apache.metron.indexing.dao.update.CommentAddRemoveRequest;
 import org.apache.metron.indexing.dao.update.Document;
 import org.apache.metron.indexing.dao.update.OriginalNotFoundException;
 import org.apache.metron.indexing.dao.update.PatchRequest;
-import org.apache.metron.indexing.dao.update.ReplaceRequest;
 import org.apache.metron.rest.RestException;
 import org.apache.metron.rest.service.UpdateService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -57,17 +56,6 @@ public class UpdateController {
     }
   }
 
-  @ApiOperation(value = "Replace a document with a full replacement")
-  @ApiResponse(message = "Returns the complete replaced document.", code = 200)
-  @RequestMapping(value = "/replace", method = RequestMethod.POST)
-  ResponseEntity<Document> replace(
-          final @ApiParam(name = "request", value = "Replacement request", required = true)
-                @RequestBody
-          ReplaceRequest request
-  ) throws RestException {
-    return new ResponseEntity<>(service.replace(request), HttpStatus.OK);
-  }
-
   @ApiOperation(value = "Add a comment to an alert")
   @ApiResponse(message = "Returns the complete alert document with comments added.", code
= 200)
   @RequestMapping(value = "/add/comment", method = RequestMethod.POST)

http://git-wip-us.apache.org/repos/asf/metron/blob/285ba5eb/metron-interface/metron-rest/src/main/java/org/apache/metron/rest/service/UpdateService.java
----------------------------------------------------------------------
diff --git a/metron-interface/metron-rest/src/main/java/org/apache/metron/rest/service/UpdateService.java
b/metron-interface/metron-rest/src/main/java/org/apache/metron/rest/service/UpdateService.java
index 19b3485..c3729c3 100644
--- a/metron-interface/metron-rest/src/main/java/org/apache/metron/rest/service/UpdateService.java
+++ b/metron-interface/metron-rest/src/main/java/org/apache/metron/rest/service/UpdateService.java
@@ -21,13 +21,11 @@ import org.apache.metron.indexing.dao.update.CommentAddRemoveRequest;
 import org.apache.metron.indexing.dao.update.Document;
 import org.apache.metron.indexing.dao.update.OriginalNotFoundException;
 import org.apache.metron.indexing.dao.update.PatchRequest;
-import org.apache.metron.indexing.dao.update.ReplaceRequest;
 import org.apache.metron.rest.RestException;
 
 public interface UpdateService {
 
   Document patch(PatchRequest request) throws RestException, OriginalNotFoundException;
-  Document replace(ReplaceRequest request) throws RestException;
   Document addComment(CommentAddRemoveRequest request) throws RestException;
   Document removeComment(CommentAddRemoveRequest request) throws RestException;
 }

http://git-wip-us.apache.org/repos/asf/metron/blob/285ba5eb/metron-interface/metron-rest/src/main/java/org/apache/metron/rest/service/impl/UpdateServiceImpl.java
----------------------------------------------------------------------
diff --git a/metron-interface/metron-rest/src/main/java/org/apache/metron/rest/service/impl/UpdateServiceImpl.java
b/metron-interface/metron-rest/src/main/java/org/apache/metron/rest/service/impl/UpdateServiceImpl.java
index 63dd4c0..8b159da 100644
--- a/metron-interface/metron-rest/src/main/java/org/apache/metron/rest/service/impl/UpdateServiceImpl.java
+++ b/metron-interface/metron-rest/src/main/java/org/apache/metron/rest/service/impl/UpdateServiceImpl.java
@@ -22,7 +22,6 @@ import org.apache.metron.indexing.dao.update.CommentAddRemoveRequest;
 import org.apache.metron.indexing.dao.update.Document;
 import org.apache.metron.indexing.dao.update.OriginalNotFoundException;
 import org.apache.metron.indexing.dao.update.PatchRequest;
-import org.apache.metron.indexing.dao.update.ReplaceRequest;
 import org.apache.metron.rest.RestException;
 import org.apache.metron.rest.service.UpdateService;
 import org.slf4j.Logger;
@@ -53,15 +52,6 @@ public class UpdateServiceImpl implements UpdateService {
   }
 
   @Override
-  public Document replace(ReplaceRequest request) throws RestException {
-    try {
-      return dao.replace(request, Optional.of(System.currentTimeMillis()));
-    } catch (Exception e) {
-      throw new RestException(e.getMessage(), e);
-    }
-  }
-
-  @Override
   public Document addComment(CommentAddRemoveRequest request) throws RestException {
     try {
       return dao.addCommentToAlert(request);

http://git-wip-us.apache.org/repos/asf/metron/blob/285ba5eb/metron-interface/metron-rest/src/test/java/org/apache/metron/rest/controller/UpdateControllerIntegrationTest.java
----------------------------------------------------------------------
diff --git a/metron-interface/metron-rest/src/test/java/org/apache/metron/rest/controller/UpdateControllerIntegrationTest.java
b/metron-interface/metron-rest/src/test/java/org/apache/metron/rest/controller/UpdateControllerIntegrationTest.java
index 6b8d5d3..7995557 100644
--- a/metron-interface/metron-rest/src/test/java/org/apache/metron/rest/controller/UpdateControllerIntegrationTest.java
+++ b/metron-interface/metron-rest/src/test/java/org/apache/metron/rest/controller/UpdateControllerIntegrationTest.java
@@ -17,28 +17,15 @@
  */
 package org.apache.metron.rest.controller;
 
-import static org.apache.metron.rest.MetronRestConstants.TEST_PROFILE;
-import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.csrf;
-import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.httpBasic;
-import static org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers.springSecurity;
-import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.patch;
-import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
-import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
-import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
-import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
-
 import com.google.common.collect.ImmutableMap;
-import java.util.NavigableMap;
 import org.adrianwalker.multilinestring.Multiline;
 import org.apache.curator.framework.CuratorFramework;
 import org.apache.hadoop.hbase.client.Get;
 import org.apache.hadoop.hbase.client.Result;
-import org.apache.metron.common.utils.JSONUtils;
 import org.apache.metron.hbase.mock.MockHBaseTableProvider;
 import org.apache.metron.hbase.mock.MockHTable;
 import org.apache.metron.indexing.dao.HBaseDao;
 import org.apache.metron.indexing.dao.SearchIntegrationTest;
-import org.apache.metron.indexing.dao.search.AlertComment;
 import org.apache.metron.indexing.dao.update.CommentAddRemoveRequest;
 import org.apache.metron.rest.service.UpdateService;
 import org.junit.Assert;
@@ -51,11 +38,23 @@ import org.springframework.http.MediaType;
 import org.springframework.test.context.ActiveProfiles;
 import org.springframework.test.context.junit4.SpringRunner;
 import org.springframework.test.web.servlet.MockMvc;
-import org.springframework.test.web.servlet.MvcResult;
 import org.springframework.test.web.servlet.ResultActions;
+import org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder;
 import org.springframework.test.web.servlet.setup.MockMvcBuilders;
 import org.springframework.web.context.WebApplicationContext;
 
+import java.util.NavigableMap;
+
+import static org.apache.metron.rest.MetronRestConstants.TEST_PROFILE;
+import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.csrf;
+import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.httpBasic;
+import static org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers.springSecurity;
+import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.patch;
+import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
+import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
+import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
+import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
+
 @RunWith(SpringRunner.class)
 @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
 @ActiveProfiles(TEST_PROFILE)
@@ -105,23 +104,6 @@ public class UpdateControllerIntegrationTest extends DaoControllerTest
{
    {
      "guid" : "bro_2",
      "sensorType" : "bro",
-     "replacement" : {
-       "source:type": "bro",
-       "guid" : "bro_2",
-       "ip_src_addr":"192.168.1.2",
-       "ip_src_port": 8009,
-       "timestamp":200,
-       "rejected":false
-      }
-   }
-   */
-  @Multiline
-  public static String replace;
-
-  /**
-   {
-     "guid" : "bro_2",
-     "sensorType" : "bro",
      "comment": "test_comment",
      "username" : "test_username",
      "timestamp":0
@@ -154,38 +136,50 @@ public class UpdateControllerIntegrationTest extends DaoControllerTest
{
   }
 
   @Test
-  public void test() throws Exception {
+  public void shouldPatchDocument() throws Exception {
     String guid = "bro_2";
-    ResultActions result =   this.mockMvc.perform(post(searchUrl + "/findOne").with(httpBasic(user,
password)).with(csrf()).contentType(MediaType.parseMediaType("application/json;charset=UTF-8")).content(findMessage0));
-    try {
-     result.andExpect(status().isOk())
+
+    // request used to find the message
+    MockHttpServletRequestBuilder findOneRequest = post(searchUrl + "/findOne")
+            .with(httpBasic(user, password))
+            .with(csrf())
+            .contentType(MediaType.parseMediaType("application/json;charset=UTF-8"))
+            .content(findMessage0);
+
+    // request used to patch the document
+    MockHttpServletRequestBuilder patchRequest = patch(updateUrl + "/patch")
+            .with(httpBasic(user, password))
+            .with(csrf())
+            .contentType(MediaType.parseMediaType("application/json;charset=UTF-8"))
+            .content(patch);
+
+    // the document should exist, but without the 'project' field defined
+    this.mockMvc.perform(findOneRequest)
+            .andExpect(status().isOk())
             .andExpect(content().contentType(MediaType.parseMediaType("application/json;charset=UTF-8")))
             .andExpect(jsonPath("$.source:type").value("bro"))
             .andExpect(jsonPath("$.guid").value(guid))
             .andExpect(jsonPath("$.project").doesNotExist())
-            .andExpect(jsonPath("$.timestamp").value(2))
-      ;
-    }
-    catch(Throwable t) {
-      System.err.println(result.andReturn().getResponse().getContentAsString());
-      throw t;
-    }
+            .andExpect(jsonPath("$.timestamp").value(2));
+
+    // nothing is recorded in HBase
     MockHTable table = (MockHTable) MockHBaseTableProvider.getFromCache(TABLE);
     Assert.assertEquals(0,table.size());
-    this.mockMvc.perform(patch(updateUrl+ "/patch").with(httpBasic(user, password))
-                                                   .with(csrf())
-                                                   .contentType(MediaType.parseMediaType("application/json;charset=UTF-8"))
-                                                   .content(patch)
-                        )
+
+    // patch the document
+    this.mockMvc.perform(patchRequest)
             .andExpect(status().isOk());
-    this.mockMvc.perform(post(searchUrl + "/findOne").with(httpBasic(user, password)).with(csrf()).contentType(MediaType.parseMediaType("application/json;charset=UTF-8")).content(findMessage0))
+
+    // the document should now have the 'project' field
+    this.mockMvc.perform(findOneRequest)
             .andExpect(status().isOk())
             .andExpect(content().contentType(MediaType.parseMediaType("application/json;charset=UTF-8")))
             .andExpect(jsonPath("$.source:type").value("bro"))
             .andExpect(jsonPath("$.guid").value(guid))
             .andExpect(jsonPath("$.project").value("metron"))
-            .andExpect(jsonPath("$.timestamp").value(2))
-            ;
+            .andExpect(jsonPath("$.timestamp").value(2));
+
+    // the change should be recorded in HBase
     Assert.assertEquals(1,table.size());
     {
         //ensure hbase is up to date
@@ -194,28 +188,6 @@ public class UpdateControllerIntegrationTest extends DaoControllerTest
{
         NavigableMap<byte[], byte[]> columns = r.getFamilyMap(CF.getBytes());
         Assert.assertEquals(1, columns.size());
     }
-    this.mockMvc.perform(post(updateUrl+ "/replace").with(httpBasic(user, password))
-                                                   .with(csrf())
-                                                   .contentType(MediaType.parseMediaType("application/json;charset=UTF-8"))
-                                                   .content(replace)
-                        )
-    .andExpect(status().isOk());
-    this.mockMvc.perform(post(searchUrl + "/findOne").with(httpBasic(user, password)).with(csrf()).contentType(MediaType.parseMediaType("application/json;charset=UTF-8")).content(findMessage0))
-            .andExpect(status().isOk())
-            .andExpect(content().contentType(MediaType.parseMediaType("application/json;charset=UTF-8")))
-            .andExpect(jsonPath("$.source:type").value("bro"))
-            .andExpect(jsonPath("$.guid").value(guid))
-            .andExpect(jsonPath("$.project").doesNotExist())
-            .andExpect(jsonPath("$.timestamp").value(200))
-            ;
-    Assert.assertEquals(1,table.size());
-    {
-        //ensure hbase is up to date
-        Get g = new Get(new HBaseDao.Key(guid, "bro").toBytes());
-        Result r = table.get(g);
-        NavigableMap<byte[], byte[]> columns = r.getFamilyMap(CF.getBytes());
-        Assert.assertEquals(2, columns.size());
-    }
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/metron/blob/285ba5eb/metron-platform/metron-elasticsearch/src/main/java/org/apache/metron/elasticsearch/dao/ElasticsearchDao.java
----------------------------------------------------------------------
diff --git a/metron-platform/metron-elasticsearch/src/main/java/org/apache/metron/elasticsearch/dao/ElasticsearchDao.java
b/metron-platform/metron-elasticsearch/src/main/java/org/apache/metron/elasticsearch/dao/ElasticsearchDao.java
index dcd6fdb..675d22f 100644
--- a/metron-platform/metron-elasticsearch/src/main/java/org/apache/metron/elasticsearch/dao/ElasticsearchDao.java
+++ b/metron-platform/metron-elasticsearch/src/main/java/org/apache/metron/elasticsearch/dao/ElasticsearchDao.java
@@ -17,11 +17,6 @@
  */
 package org.apache.metron.elasticsearch.dao;
 
-import java.io.IOException;
-import java.lang.invoke.MethodHandles;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
 import org.apache.metron.elasticsearch.client.ElasticsearchClient;
 import org.apache.metron.elasticsearch.client.ElasticsearchClientFactory;
 import org.apache.metron.indexing.dao.AccessConfig;
@@ -38,12 +33,17 @@ import org.apache.metron.indexing.dao.update.CommentAddRemoveRequest;
 import org.apache.metron.indexing.dao.update.Document;
 import org.apache.metron.indexing.dao.update.OriginalNotFoundException;
 import org.apache.metron.indexing.dao.update.PatchRequest;
-import org.apache.metron.indexing.dao.update.ReplaceRequest;
 import org.elasticsearch.action.support.WriteRequest;
 import org.elasticsearch.index.query.QueryBuilder;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.io.IOException;
+import java.lang.invoke.MethodHandles;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+
 public class ElasticsearchDao implements IndexDao {
 
   private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
@@ -156,11 +156,6 @@ public class ElasticsearchDao implements IndexDao {
   }
 
   @Override
-  public Document replace(ReplaceRequest request, Optional<Long> timestamp) throws
IOException {
-    return updateDao.replace(request, timestamp);
-  }
-
-  @Override
   public Document addCommentToAlert(CommentAddRemoveRequest request) throws IOException {
     return updateDao.addCommentToAlert(request);
   }

http://git-wip-us.apache.org/repos/asf/metron/blob/285ba5eb/metron-platform/metron-indexing/src/main/java/org/apache/metron/indexing/dao/update/ReplaceRequest.java
----------------------------------------------------------------------
diff --git a/metron-platform/metron-indexing/src/main/java/org/apache/metron/indexing/dao/update/ReplaceRequest.java
b/metron-platform/metron-indexing/src/main/java/org/apache/metron/indexing/dao/update/ReplaceRequest.java
deleted file mode 100644
index 96bca30..0000000
--- a/metron-platform/metron-indexing/src/main/java/org/apache/metron/indexing/dao/update/ReplaceRequest.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/**
- * 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.metron.indexing.dao.update;
-
-import com.fasterxml.jackson.databind.JsonNode;
-
-import java.util.Map;
-
-public class ReplaceRequest {
-  Map<String, Object> replacement;
-  String guid;
-  String sensorType;
-  String index;
-
-  /**
-   * Return the index of the request.  This is optional, but could result in better performance
if specified.
-   * @return
-   */
-  public String getIndex() {
-    return index;
-  }
-
-  public void setIndex(String index) {
-    this.index = index;
-  }
-
-  /**
-   * The sensor type of the request. This is mandatory.
-   * @return
-   */
-  public String getSensorType() {
-    return sensorType;
-  }
-
-  public void setSensorType(String sensorType) {
-    this.sensorType = sensorType;
-  }
-
-  /**
-   * The replacement document.  This is mandatory.
-   * @return
-   */
-  public Map<String, Object> getReplacement() {
-    return replacement;
-  }
-
-  public void setReplacement(Map<String, Object> replacement) {
-    this.replacement = replacement;
-  }
-
-  /**
-   * The GUID of the document to replace.  This is mandatory.
-   * @return
-   */
-  public String getGuid() {
-    return guid;
-  }
-
-  public void setGuid(String guid) {
-    this.guid = guid;
-  }
-}

http://git-wip-us.apache.org/repos/asf/metron/blob/285ba5eb/metron-platform/metron-indexing/src/main/java/org/apache/metron/indexing/dao/update/UpdateDao.java
----------------------------------------------------------------------
diff --git a/metron-platform/metron-indexing/src/main/java/org/apache/metron/indexing/dao/update/UpdateDao.java
b/metron-platform/metron-indexing/src/main/java/org/apache/metron/indexing/dao/update/UpdateDao.java
index 8f6f6b0..82f0a49 100644
--- a/metron-platform/metron-indexing/src/main/java/org/apache/metron/indexing/dao/update/UpdateDao.java
+++ b/metron-platform/metron-indexing/src/main/java/org/apache/metron/indexing/dao/update/UpdateDao.java
@@ -17,11 +17,12 @@
  */
 package org.apache.metron.indexing.dao.update;
 
+import org.apache.metron.common.utils.JSONUtils;
+import org.apache.metron.indexing.dao.RetrieveLatestDao;
+
 import java.io.IOException;
 import java.util.Map;
 import java.util.Optional;
-import org.apache.metron.common.utils.JSONUtils;
-import org.apache.metron.indexing.dao.RetrieveLatestDao;
 
 public interface UpdateDao {
 
@@ -91,21 +92,4 @@ public interface UpdateDao {
         request.getSensorType(),
         timestamp.orElse(System.currentTimeMillis()));
   }
-
-  /**
-   * Replace a document in an index.
-   * @param request The replacement request.
-   * @param timestamp The timestamp (optional) of the update.  If not specified, then current
time will be used.
-   * @return The replaced document.
-   * @throws IOException If an error occurs during replacement.
-   */
-  default Document replace(ReplaceRequest request, Optional<Long> timestamp)
-      throws IOException {
-    Document d = new Document(request.getReplacement(),
-        request.getGuid(),
-        request.getSensorType(),
-        timestamp.orElse(System.currentTimeMillis())
-    );
-    return update(d, Optional.ofNullable(request.getIndex()));
-  }
 }

http://git-wip-us.apache.org/repos/asf/metron/blob/285ba5eb/metron-platform/metron-indexing/src/test/java/org/apache/metron/indexing/dao/InMemoryMetaAlertDao.java
----------------------------------------------------------------------
diff --git a/metron-platform/metron-indexing/src/test/java/org/apache/metron/indexing/dao/InMemoryMetaAlertDao.java
b/metron-platform/metron-indexing/src/test/java/org/apache/metron/indexing/dao/InMemoryMetaAlertDao.java
index dbd3cb6..5dbefdd 100644
--- a/metron-platform/metron-indexing/src/test/java/org/apache/metron/indexing/dao/InMemoryMetaAlertDao.java
+++ b/metron-platform/metron-indexing/src/test/java/org/apache/metron/indexing/dao/InMemoryMetaAlertDao.java
@@ -18,14 +18,6 @@
 
 package org.apache.metron.indexing.dao;
 
-import static org.apache.metron.common.Constants.SENSOR_TYPE;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-import java.util.function.Supplier;
 import org.adrianwalker.multilinestring.Multiline;
 import org.apache.metron.common.utils.JSONUtils;
 import org.apache.metron.indexing.InMemoryMetaAlertRetrieveLatestDao;
@@ -48,7 +40,15 @@ import org.apache.metron.indexing.dao.update.CommentAddRemoveRequest;
 import org.apache.metron.indexing.dao.update.Document;
 import org.apache.metron.indexing.dao.update.OriginalNotFoundException;
 import org.apache.metron.indexing.dao.update.PatchRequest;
-import org.apache.metron.indexing.dao.update.ReplaceRequest;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.function.Supplier;
+
+import static org.apache.metron.common.Constants.SENSOR_TYPE;
 
 public class InMemoryMetaAlertDao implements MetaAlertDao {
 
@@ -175,11 +175,6 @@ public class InMemoryMetaAlertDao implements MetaAlertDao {
   }
 
   @Override
-  public Document replace(ReplaceRequest request, Optional<Long> timestamp) throws
IOException {
-    return indexDao.replace(request, timestamp);
-  }
-
-  @Override
   public SearchResponse getAllMetaAlertsForAlert(String guid) throws InvalidSearchException
{
     SearchRequest request;
     try {

http://git-wip-us.apache.org/repos/asf/metron/blob/285ba5eb/metron-platform/metron-indexing/src/test/java/org/apache/metron/indexing/dao/UpdateIntegrationTest.java
----------------------------------------------------------------------
diff --git a/metron-platform/metron-indexing/src/test/java/org/apache/metron/indexing/dao/UpdateIntegrationTest.java
b/metron-platform/metron-indexing/src/test/java/org/apache/metron/indexing/dao/UpdateIntegrationTest.java
index ef9714e..b15895a 100644
--- a/metron-platform/metron-indexing/src/test/java/org/apache/metron/indexing/dao/UpdateIntegrationTest.java
+++ b/metron-platform/metron-indexing/src/test/java/org/apache/metron/indexing/dao/UpdateIntegrationTest.java
@@ -14,32 +14,30 @@
  */
 package org.apache.metron.indexing.dao;
 
-import static org.apache.metron.indexing.dao.IndexDao.COMMENTS_FIELD;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.NavigableMap;
-import java.util.Optional;
-import java.util.stream.Collectors;
 import org.adrianwalker.multilinestring.Multiline;
 import org.apache.commons.collections.MapUtils;
-import org.apache.hadoop.hbase.client.Get;
-import org.apache.hadoop.hbase.client.Result;
 import org.apache.metron.common.Constants;
-import org.apache.metron.common.utils.JSONUtils;
 import org.apache.metron.hbase.mock.MockHTable;
 import org.apache.metron.indexing.dao.search.AlertComment;
 import org.apache.metron.indexing.dao.update.CommentAddRemoveRequest;
 import org.apache.metron.indexing.dao.update.Document;
 import org.apache.metron.indexing.dao.update.OriginalNotFoundException;
 import org.apache.metron.indexing.dao.update.PatchRequest;
-import org.apache.metron.indexing.dao.update.ReplaceRequest;
 import org.junit.Assert;
 import org.junit.Test;
 
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.UUID;
+import java.util.stream.Collectors;
+
+import static org.apache.metron.indexing.dao.IndexDao.COMMENTS_FIELD;
+import static org.hamcrest.CoreMatchers.hasItem;
+
 public abstract class UpdateIntegrationTest {
 
   /**
@@ -62,215 +60,147 @@ public abstract class UpdateIntegrationTest {
   @Multiline
   protected String commentTwo;
 
-  private static final int MAX_RETRIES = 10;
-  private static final int SLEEP_MS = 500;
+  protected static final int MAX_RETRIES = 10;
+  protected static final int SLEEP_MS = 500;
   protected static final String SENSOR_NAME = "test";
   private static final String CF = "p";
 
   private MultiIndexDao dao;
 
   @Test
-  public void test() throws Exception {
-    List<Map<String, Object>> inputData = new ArrayList<>();
-    for(int i = 0; i < 10;++i) {
-      final String name = "message" + i;
-      inputData.add(
-          new HashMap<String, Object>() {{
-            put("source.type", SENSOR_NAME);
-            put("name" , name);
-            put("timestamp", System.currentTimeMillis());
-            put(Constants.GUID, name);
-          }}
-      );
-    }
-    addTestData(getIndexName(), SENSOR_NAME, inputData);
-    List<Map<String,Object>> docs = null;
-    for(int t = 0;t < MAX_RETRIES;++t, Thread.sleep(SLEEP_MS)) {
-      docs = getIndexedTestData(getIndexName(), SENSOR_NAME);
-      if(docs.size() >= 10) {
-        break;
-      }
-    }
-    Assert.assertEquals(10, docs.size());
-    //modify the first message and add a new field
+  public void testUpdate() throws Exception {
+    // create a document to update
+    final String guid = UUID.randomUUID().toString();
+    final Long timestamp = 1526306463050L;
+    Document toUpdate = createDocument(guid, timestamp);
     {
-      Map<String, Object> message0 = new HashMap<String, Object>(inputData.get(0))
{{
-        put("new-field", "metron");
-      }};
-      String guid = "" + message0.get(Constants.GUID);
-      Document update = getDao().replace(new ReplaceRequest(){{
-        setReplacement(message0);
-        setGuid(guid);
-        setSensorType(SENSOR_NAME);
-        setIndex(getIndexName());
-      }}, Optional.empty());
-
-      Assert.assertEquals(message0, update.getDocument());
-      Assert.assertEquals(1, getMockHTable().size());
-      findUpdatedDoc(message0, guid, SENSOR_NAME);
-      {
-        //ensure hbase is up to date
-        Get g = new Get(HBaseDao.Key.toBytes(new HBaseDao.Key(guid, SENSOR_NAME)));
-        Result r = getMockHTable().get(g);
-        NavigableMap<byte[], byte[]> columns = r.getFamilyMap(CF.getBytes());
-        Assert.assertEquals(1, columns.size());
-        Assert.assertEquals(message0
-            , JSONUtils.INSTANCE.load(new String(columns.lastEntry().getValue())
-                , JSONUtils.MAP_SUPPLIER)
-        );
-      }
-      {
-        //ensure ES is up-to-date
-        long cnt = 0;
-        for (int t = 0; t < MAX_RETRIES && cnt == 0; ++t, Thread.sleep(SLEEP_MS))
{
-          docs = getIndexedTestData(getIndexName(), SENSOR_NAME);
-          cnt = docs
-              .stream()
-              .filter(d -> message0.get("new-field").equals(d.get("new-field")))
-              .count();
-        }
-        Assert.assertNotEquals("Data store is not updated!", cnt, 0);
-      }
+      // update the document and validate
+      Document updated = getDao().update(toUpdate, Optional.of(SENSOR_NAME));
+      Assert.assertEquals(toUpdate, updated);
     }
-    //modify the same message and modify the new field
     {
-      Map<String, Object> message0 = new HashMap<String, Object>(inputData.get(0))
{{
-        put("new-field", "metron2");
-      }};
-      String guid = "" + message0.get(Constants.GUID);
-      Document update = getDao().replace(new ReplaceRequest(){{
-        setReplacement(message0);
-        setGuid(guid);
-        setSensorType(SENSOR_NAME);
-        setIndex(getIndexName());
-      }}, Optional.empty());
-      Assert.assertEquals(message0, update.getDocument());
-      Assert.assertEquals(1, getMockHTable().size());
-      Document doc = getDao().getLatest(guid, SENSOR_NAME);
-      Assert.assertEquals(message0, doc.getDocument());
-      findUpdatedDoc(message0, guid, SENSOR_NAME);
-      {
-        //ensure hbase is up to date
-        Get g = new Get(HBaseDao.Key.toBytes(new HBaseDao.Key(guid, SENSOR_NAME)));
-        Result r = getMockHTable().get(g);
-        NavigableMap<byte[], byte[]> columns = r.getFamilyMap(CF.getBytes());
-        Assert.assertEquals(2, columns.size());
-        Assert.assertEquals(message0, JSONUtils.INSTANCE.load(new String(columns.lastEntry().getValue())
-            , JSONUtils.MAP_SUPPLIER)
-        );
-        Assert.assertNotEquals(message0, JSONUtils.INSTANCE.load(new String(columns.firstEntry().getValue())
-            , JSONUtils.MAP_SUPPLIER)
-        );
-      }
-      {
-        //ensure ES is up-to-date
-        long cnt = 0;
-        for (int t = 0; t < MAX_RETRIES && cnt == 0; ++t,Thread.sleep(SLEEP_MS))
{
-          docs = getIndexedTestData(getIndexName(), SENSOR_NAME);
-          cnt = docs
-              .stream()
-              .filter(d -> message0.get("new-field").equals(d.get("new-field")))
-              .count();
-        }
-
-        Assert.assertNotEquals("Data store is not updated!", cnt, 0);
-      }
+      // ensure the document is updated in the index
+      Document indexed = findUpdatedDoc(toUpdate.getDocument(), guid, SENSOR_NAME);
+      Assert.assertEquals(toUpdate, indexed);
     }
   }
 
   @Test
-  public void testAddCommentAndPatch() throws Exception {
-    Map<String, Object> fields = new HashMap<>();
-    fields.put("guid", "add_comment");
-    fields.put("source.type", SENSOR_NAME);
+  public void testBatchUpdate() throws Exception {
+    Map<Document, Optional<String>> toUpdate = new HashMap<>();
 
-    Document document = new Document(fields, "add_comment", SENSOR_NAME, 1526306463050L);
-    {
-      Document update = getDao().update(document, Optional.of(SENSOR_NAME));
-      Assert.assertEquals(document, update);
-      findUpdatedDoc(document.getDocument(), "add_comment", SENSOR_NAME);
-    }
-    ArrayList<AlertComment> comments = new ArrayList<>();
+    // create the first document to update
+    final String guid1 = UUID.randomUUID().toString();
+    final Long timestamp1 = 1526306463050L;
+    Document document1 = createDocument(guid1, timestamp1);
+    toUpdate.put(document1, Optional.of(SENSOR_NAME));
+
+    // create the second document to update
+    final String guid2 = UUID.randomUUID().toString();
+    final Long timestamp2 = 1526306463100L;
+    Document document2 = createDocument(guid2, timestamp2);
+    toUpdate.put(document2, Optional.of(SENSOR_NAME));
+
+    // create the third document to update
+    final String guid3 = UUID.randomUUID().toString();
+    final Long timestamp3 = 1526306463300L;
+    Document document3 = createDocument(guid3, timestamp3);
+    toUpdate.put(document3, Optional.of(SENSOR_NAME));
+
+    // update the documents as a batch and validate
+    Map<Document, Optional<String>> updated = getDao().batchUpdate(toUpdate);
+    Assert.assertThat(updated.keySet(), hasItem(document1));
+    Assert.assertThat(updated.keySet(), hasItem(document2));
+    Assert.assertThat(updated.keySet(), hasItem(document3));
+
+    // ensure the documents were written to the index
+    Assert.assertEquals(document1, findUpdatedDoc(document1.getDocument(), guid1, SENSOR_NAME));
+    Assert.assertEquals(document2, findUpdatedDoc(document2.getDocument(), guid2, SENSOR_NAME));
+    Assert.assertEquals(document3, findUpdatedDoc(document3.getDocument(), guid3, SENSOR_NAME));
+  }
+
+  @Test
+  public void testAddComment() throws Exception {
+    Document document = createAndIndexDocument("testAddCommentAndPatch");
+
+    // comment on the document
+    String commentText = "New Comment";
+    String commentUser = "test_user";
+    long commentTimestamp = 152630493050L;
+    Document withComment = addAlertComment(document.getGuid(), commentText, commentUser,
commentTimestamp);
     {
-      Document update = addAlertComment("add_comment", "New Comment", "test_user", 1526306463050L);
-      // Ensure we have the first comment
-      comments.add(new AlertComment("New Comment", "test_user", 1526306463050L));
-      document.getDocument().put(COMMENTS_FIELD, comments.stream().map(AlertComment::asMap).collect(
-              Collectors.toList()));
-      Assert.assertEquals(document, update);
-      findUpdatedDoc(document.getDocument(), "add_comment", SENSOR_NAME);
+      // validate that the comment was made on the returned document
+      List<AlertComment> comments = getComments(withComment);
+      Assert.assertEquals(1, comments.size());
+      Assert.assertEquals(commentText, comments.get(0).getComment());
+      Assert.assertEquals(commentUser, comments.get(0).getUsername());
+      Assert.assertEquals(commentTimestamp, comments.get(0).getTimestamp());
     }
     {
-      List<Map<String, Object>> patchList = new ArrayList<>();
-      Map<String, Object> patch = new HashMap<>();
-      patch.put("op", "add");
-      patch.put("path", "/project");
-      patch.put("value", "metron");
-      patchList.add(patch);
-
-      PatchRequest pr = new PatchRequest();
-      pr.setGuid("add_comment");
-      pr.setIndex(SENSOR_NAME);
-      pr.setSensorType(SENSOR_NAME);
-      pr.setPatch(patchList);
-      Document update = getDao().patch(getDao(), pr, Optional.of(1526306463050L));
-
-      document.getDocument().put("project", "metron");
-      Assert.assertEquals(document, update);
-      findUpdatedDoc(document.getDocument(), "add_comment", SENSOR_NAME);
+      // validate that the comment was made on the indexed document
+      Document indexed = findUpdatedDoc(withComment.getDocument(), withComment.getGuid(),
SENSOR_NAME);
+      List<AlertComment> comments = getComments(indexed);
+      Assert.assertEquals(1, comments.size());
+      Assert.assertEquals(commentText, comments.get(0).getComment());
+      Assert.assertEquals(commentUser, comments.get(0).getUsername());
+      Assert.assertEquals(commentTimestamp, comments.get(0).getTimestamp());
     }
   }
 
   @Test
-  @SuppressWarnings("unchecked")
+  public void testPatchDocumentThatHasComment() throws Exception {
+    Document document = createAndIndexDocument("testPatchDocumentWithComment");
+
+    // comment on the document
+    String commentText = "New Comment";
+    String commentUser = "test_user";
+    long commentTimestamp = 152630493050L;
+    Document withComment = addAlertComment(document.getGuid(), commentText, commentUser,
commentTimestamp);
+
+    // create a patch
+    List<Map<String, Object>> patches = new ArrayList<>();
+    Map<String, Object> patch = new HashMap<>();
+    patch.put("op", "add");
+    patch.put("path", "/project");
+    patch.put("value", "metron");
+    patches.add(patch);
+
+    PatchRequest pr = new PatchRequest();
+    pr.setGuid(withComment.getGuid());
+    pr.setIndex(SENSOR_NAME);
+    pr.setSensorType(SENSOR_NAME);
+    pr.setPatch(patches);
+
+    // patch the document that has been commented on
+    Document patched = getDao().patch(getDao(), pr, Optional.of(withComment.getTimestamp()));
+    Assert.assertEquals("metron", patched.getDocument().get("project"));
+
+    // ensure the patch was made on the indexed document
+    Document indexed = findUpdatedDoc(patched.getDocument(), patched.getGuid(), SENSOR_NAME);
+    Assert.assertEquals("metron", indexed.getDocument().get("project"));
+  }
+
+  @Test
   public void testRemoveComments() throws Exception {
-    Map<String, Object> fields = new HashMap<>();
-    fields.put("guid", "add_comment");
-    fields.put("source.type", SENSOR_NAME);
+    String guid = "testRemoveComments";
+    createAndIndexDocument(guid);
 
-    Document document = new Document(fields, "add_comment", SENSOR_NAME, 1526401584951L);
-    {
-      Document update = getDao().update(document, Optional.of(SENSOR_NAME));
-      Assert.assertEquals(document, update);
-      findUpdatedDoc(document.getDocument(), "add_comment", SENSOR_NAME);
-    }
-    ArrayList<AlertComment> comments = new ArrayList<>();
-    {
-      Document update = addAlertComment("add_comment", "New Comment", "test_user", 1526401584951L);
-      // Ensure we have the first comment
-
-      comments.add(new AlertComment("New Comment", "test_user", 1526401584951L));
-      document.getDocument().put(COMMENTS_FIELD, comments.stream().map(AlertComment::asMap).collect(
-              Collectors.toList()));
-      Assert.assertEquals(document, update);
-      findUpdatedDoc(document.getDocument(), "add_comment", SENSOR_NAME);
-    }
-    {
-      Document update = addAlertComment("add_comment", "New Comment 2", "test_user_2", 1526401584952L);
-      // Ensure we have the second comment
-      comments.add(new AlertComment("New Comment 2", "test_user_2", 1526401584952L));
-      document.getDocument().put(COMMENTS_FIELD, comments.stream().map(AlertComment::asMap).collect(
-              Collectors.toList()));
-      Assert.assertEquals(document, update);
-      findUpdatedDoc(document.getDocument(), "add_comment", SENSOR_NAME);
-    }
-    {
-      Document update = removeAlertComment("add_comment", "New Comment 2", "test_user_2",
1526401584952L);
-      // Ensure we only have the first comments
-      comments = new ArrayList<>();
-      comments.add(new AlertComment(commentOne));
-      document.getDocument().put(COMMENTS_FIELD, comments.stream().map(AlertComment::asMap).collect(
-              Collectors.toList()));
-      Assert.assertEquals(document, update);
-      findUpdatedDoc(document.getDocument(), "add_comment", SENSOR_NAME);
-    }
-    {
-      Document update = removeAlertComment("add_comment", "New Comment", "test_user", 1526401584951L);
-      // Ensure we have no comments
-      document.getDocument().remove(COMMENTS_FIELD);
-      Assert.assertEquals(document, update);
-      findUpdatedDoc(document.getDocument(), "add_comment", SENSOR_NAME);
-    }
+    // add a comment on the document
+    Document withComments = addAlertComment(guid, "comment", "user1", 1526401584951L);
+    Assert.assertEquals(1, getComments(withComments).size());
+
+    // ensure the comment was added to the document in the index
+    Document indexedWithComments = findUpdatedDoc(withComments.getDocument(), withComments.getGuid(),
withComments.getSensorType());
+    Assert.assertEquals(1, getComments(indexedWithComments).size());
+
+    // remove a comment from the document
+    AlertComment toRemove = getComments(withComments).get(0);
+    Document noComments = removeAlertComment(guid, toRemove.getComment(), toRemove.getUsername(),
toRemove.getTimestamp());
+    Assert.assertEquals(0, getComments(noComments).size());
+
+    // ensure the comment was removed from the index
+    Document indexedNoComments = findUpdatedDoc(noComments.getDocument(), withComments.getGuid(),
withComments.getSensorType());
+    Assert.assertEquals(0, getComments(indexedNoComments).size());
   }
 
   protected Document addAlertComment(String guid, String comment, String username, long timestamp)
@@ -296,12 +226,47 @@ public abstract class UpdateIntegrationTest {
     return request;
   }
 
-  protected void findUpdatedDoc(Map<String, Object> message0, String guid, String sensorType)
+  private Document createAndIndexDocument(String guid) throws Exception {
+    // create the document
+    Long timestamp = 1526306463050L;
+    Document toCreate = createDocument(guid, timestamp);
+
+    // index the document
+    Document created = getDao().update(toCreate, Optional.of(SENSOR_NAME));
+    Assert.assertEquals(toCreate, created);
+
+    // ensure the document is indexed
+    return findUpdatedDoc(toCreate.getDocument(), guid, SENSOR_NAME);
+  }
+
+  protected Document createDocument(String guid, Long timestamp) {
+    Map<String, Object> message1 = new HashMap<>();
+    message1.put(Constants.GUID, guid);
+    message1.put(Constants.SENSOR_TYPE, SENSOR_NAME);
+    message1.put(Constants.Fields.TIMESTAMP.getName(), timestamp);
+
+    return new Document(message1, guid, SENSOR_NAME, timestamp);
+  }
+
+  private List<AlertComment> getComments(Document withComment) {
+    List<Map<String, Object>> commentsField = List.class.cast(withComment.getDocument().get(COMMENTS_FIELD));
+    List<AlertComment> comments = new ArrayList<>();
+    if(commentsField != null) {
+      comments = commentsField
+              .stream()
+              .map(map -> new AlertComment(map))
+              .collect(Collectors.toList());
+    }
+
+    return comments;
+  }
+
+  protected Document findUpdatedDoc(Map<String, Object> message0, String guid, String
sensorType)
       throws InterruptedException, IOException, OriginalNotFoundException {
     for (int t = 0; t < MAX_RETRIES; ++t, Thread.sleep(SLEEP_MS)) {
       Document doc = getDao().getLatest(guid, sensorType);
       if (doc != null && message0.equals(doc.getDocument())) {
-        return;
+        return doc;
       }
       if (t == MAX_RETRIES -1) {
         MapUtils.debugPrint(System.out, "Expected", message0);

http://git-wip-us.apache.org/repos/asf/metron/blob/285ba5eb/metron-platform/metron-indexing/src/test/java/org/apache/metron/indexing/integration/HBaseDaoIntegrationTest.java
----------------------------------------------------------------------
diff --git a/metron-platform/metron-indexing/src/test/java/org/apache/metron/indexing/integration/HBaseDaoIntegrationTest.java
b/metron-platform/metron-indexing/src/test/java/org/apache/metron/indexing/integration/HBaseDaoIntegrationTest.java
index 8eaa8f4..8148b69 100644
--- a/metron-platform/metron-indexing/src/test/java/org/apache/metron/indexing/integration/HBaseDaoIntegrationTest.java
+++ b/metron-platform/metron-indexing/src/test/java/org/apache/metron/indexing/integration/HBaseDaoIntegrationTest.java
@@ -169,13 +169,6 @@ public class HBaseDaoIntegrationTest extends UpdateIntegrationTest  {
     Assert.assertFalse("Result size should be 12 but was greater", results.hasNext());
   }
 
-  @Override
-  public void test() {
-    // The main test ensures a variety of things not implemented by HBase run alongside
-    // HBaseDao itself.
-    // Therefore, just don't do anything for this test.
-  }
-
   protected List<Document> buildAlerts(int count) throws IOException {
     List<Document> alerts = new ArrayList<>();
     for (int i = 0; i < count; ++i) {


Mime
View raw message