Package com.linkedin.data.transform

Examples of com.linkedin.data.transform.DataComplexProcessor


      fail("expected DataProcessingException to be thrown");
  }

  @Test
  public void testDeleteAndSetSameField() throws JsonParseException, IOException, DataProcessingException {
    DataComplexProcessor processor = new DataComplexProcessor(new Patch(),
                                                      dataMapFromString(
                                                        "{ \"$set\": { \"b\": 1}, \"$delete\": [\"b\"] }")//command $set should be used
                                                      dataMapFromString("{\"a\": 1}"));
    boolean thrown = false;
    try
    {
      processor.run(false);
    }
    catch (DataProcessingException e)
    {
      thrown = true;
    }
View Full Code Here


      fail("expected DataProcessingException to be thrown");
  }

  @Test
  public void testDeleteAndBeBranchAtSameTime() throws JsonParseException, IOException, DataProcessingException {
    DataComplexProcessor processor = new DataComplexProcessor(new Patch(),
                                                      dataMapFromString(
                                                        "{ \"b\": { \"$set\": { \"b\": 1} }, \"$delete\": [\"b\"] }")//command $set should be used
                                                      dataMapFromString("{\"a\": 1}"));
    boolean thrown = false;
    try
    {
      processor.run(false);
    }
    catch (DataProcessingException e)
    {
      thrown = true;
    }
View Full Code Here

      fail("expected DataProcessingException to be thrown");
  }

  @Test
  public void testSetAndBeBranchAtSameTime() throws JsonParseException, IOException, DataProcessingException {
    DataComplexProcessor processor = new DataComplexProcessor(new Patch(),
                                                      dataMapFromString(
                                                        "{ \"b\": { \"$set\": { \"b\": 1} }, \"$set\": {\"b\": 1} }")//command $set should be used
                                                      dataMapFromString("{\"a\": 1}"));
    boolean thrown = false;
    try
    {
      processor.run(false);
    }
    catch (DataProcessingException e)
    {
      thrown = true;
    }
View Full Code Here

    {
      return EMPTY_DATAMAP;
    }
    try
    {
      new DataComplexProcessor(new Filter(), projection.getDataMap(), forProjection).run(false);
      return forProjection;
    }
    catch (Exception e)
    {
      throw new RuntimeException("Error projecting fields", e);
View Full Code Here

public class PatchApplier
{
  public static <T extends RecordTemplate> void applyPatch(T original,
                                                           PatchRequest<T> patch) throws DataProcessingException
  {
    DataComplexProcessor processor =
        new DataComplexProcessor(new Patch(), patch.getPatchDocument(), original.data());
    processor.run(false);
  }
View Full Code Here

TOP

Related Classes of com.linkedin.data.transform.DataComplexProcessor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.