Examples of RecordMutation


Examples of org.apache.blur.thrift.generated.RecordMutation

    assertFalse("should not match with different family", BlurThriftHelper.match(r1, r4));
  }

  @Test
  public void testRecordMutationMatch() {
    RecordMutation rm1 = BlurThriftHelper.newRecordMutation("test-family", "record-1",
        BlurThriftHelper.newColumn("a", "b"));
    RecordMutation rm2 = BlurThriftHelper.newRecordMutation("test-family", "record-2",
        BlurThriftHelper.newColumn("c", "d"));
    RecordMutation rm3 = BlurThriftHelper.newRecordMutation("test-family-2", "record-1",
        BlurThriftHelper.newColumn("e", "f"));
    Record r = BlurThriftHelper.newRecord("test-family", "record-1", BlurThriftHelper.newColumn("g", "h"));

    assertTrue("should match with same family and record-id", BlurThriftHelper.match(rm1, r));
    assertFalse("should not match with different record-id", BlurThriftHelper.match(rm2, r));
View Full Code Here

Examples of org.apache.blur.thrift.generated.RecordMutation

    assertFalse("should not match with different family", BlurThriftHelper.match(rm3, r));
  }

  @Test
  public void testFindRecordMutation() {
    RecordMutation rm1 = BlurThriftHelper.newRecordMutation("test-family", "record-1",
        BlurThriftHelper.newColumn("a", "b"));
    RecordMutation rm2 = BlurThriftHelper.newRecordMutation("test-family", "record-2",
        BlurThriftHelper.newColumn("c", "d"));
    RecordMutation rm3 = BlurThriftHelper.newRecordMutation("test-family-2", "record-1",
        BlurThriftHelper.newColumn("e", "f"));
    RowMutation row = BlurThriftHelper.newRowMutation("test-table", "row-123", rm1, rm2, rm3);
    Record r = BlurThriftHelper.newRecord("test-family", "record-2", BlurThriftHelper.newColumn("g", "h"));
    Record r2 = BlurThriftHelper.newRecord("test-family", "record-99", BlurThriftHelper.newColumn("g", "h"));
View Full Code Here

Examples of org.apache.blur.thrift.generated.RecordMutation

    }
    reader.close();
  }

  protected static RecordMutation getRecordMutation(int numberOfColumns, int numberOfFamilies, int numberOfWords) {
    RecordMutation recordMutation = new RecordMutation();
    recordMutation.setRecord(getRecord(numberOfColumns, numberOfFamilies, numberOfWords));
    recordMutation.setRecordMutationType(RecordMutationType.REPLACE_ENTIRE_RECORD);
    return recordMutation;
  }
View Full Code Here

Examples of org.apache.blur.thrift.generated.RecordMutation

    }
    reader.close();
  }

  protected static RecordMutation getRecordMutation(int numberOfColumns, int numberOfFamilies, int numberOfWords) {
    RecordMutation recordMutation = new RecordMutation();
    recordMutation.setRecord(getRecord(numberOfColumns, numberOfFamilies, numberOfWords));
    recordMutation.setRecordMutationType(RecordMutationType.REPLACE_ENTIRE_RECORD);
    return recordMutation;
  }
View Full Code Here

Examples of org.apache.blur.thrift.generated.RecordMutation

    record.setFamily(family);
    for (Column column : columns) {
      record.addToColumns(column);
    }

    RecordMutation mutation = new RecordMutation();
    mutation.setRecordMutationType(type);
    mutation.setRecord(record);
    return mutation;
  }
View Full Code Here

Examples of org.apache.blur.thrift.generated.RecordMutation

    RowMutation mutationCopy = mutation.deepCopy();

    // Match existing records against record mutations. Once a record
    // mutation has been processed, remove it from our local copy.
    for (Record existingRecord : existingRow.records) {
      RecordMutation recordMutation = findRecordMutation(mutationCopy, existingRecord);
      if (recordMutation != null) {
        mutationCopy.recordMutations.remove(recordMutation);
        doUpdateRecordMutation(recordMutation, existingRecord, newRow);
      } else {
        // Copy existing records over to the new row unmodified if there
View Full Code Here

Examples of org.apache.blur.thrift.generated.RecordMutation

    }
    reader.close();
  }

  protected static RecordMutation getRecordMutation(int numberOfColumns, int numberOfFamilies, int numberOfWords) {
    RecordMutation recordMutation = new RecordMutation();
    recordMutation.setRecord(getRecord(numberOfColumns, numberOfFamilies, numberOfWords));
    recordMutation.setRecordMutationType(RecordMutationType.REPLACE_ENTIRE_RECORD);
    return recordMutation;
  }
View Full Code Here

Examples of org.apache.blur.thrift.generated.RecordMutation

  public void testMutationReplaceMissingRow() throws Exception {
    Column c1 = newColumn("testcol1", "value20");
    Column c2 = newColumn("testcol2", "value21");
    Column c3 = newColumn("testcol3", "value22");
    String rec = "record-6";
    RecordMutation rm = newRecordMutation(FAMILY, rec, c1, c2, c3);
    RowMutation mutation = newRowMutation(TABLE, "row-6", rm);
    mutation.waitToBeVisible = true;
    indexManager.mutate(mutation);

    Selector selector = new Selector().setRowId("row-6");
View Full Code Here

Examples of org.apache.blur.thrift.generated.RecordMutation

    assertNull("row should not exist", fetchResult.rowResult);
  }

  @Test
  public void testMutationUpdateRowDeleteLastRecord() throws Exception {
    RecordMutation rm = newRecordMutation(DELETE_ENTIRE_RECORD, FAMILY, "record-3");

    RowMutation rowMutation = newRowMutation(UPDATE_ROW, TABLE, "row-3", rm);

    rowMutation.waitToBeVisible = true;
    indexManager.mutate(rowMutation);
View Full Code Here

Examples of org.apache.blur.thrift.generated.RecordMutation

    assertNull("row should not exist", fetchResult.rowResult);
  }

  @Test
  public void testMutationUpdateRowDeleteRecord() throws Exception {
    RecordMutation rm = newRecordMutation(DELETE_ENTIRE_RECORD, FAMILY, "record-5A");

    RowMutation rowMutation = newRowMutation(UPDATE_ROW, TABLE, "row-5", rm);
    rowMutation.waitToBeVisible = true;
    indexManager.mutate(rowMutation);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.