Package org.apache.blur.thrift.generated

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


  public void testMutationUpdateRowMissingRecordAppendColumns() throws Exception {
    Column c1 = newColumn("testcol1", "value999");
    Column c2 = newColumn("testcol2", "value9999");
    Column c3 = newColumn("testcol4", "hmm");
    String rec = "record-1B";
    RecordMutation rm = newRecordMutation(APPEND_COLUMN_VALUES, FAMILY, rec, c1, c2, c3);

    updateAndFetchRecord("row-1", rec, rm);
  }
View Full Code Here


  @Test(expected = BlurException.class)
  public void testMutationUpdateMissingRowAppendColumns() throws Exception {
    Column c1 = newColumn("testcol1", "value999");
    Column c2 = newColumn("testcol2", "value9999");
    String rec = "record-6";
    RecordMutation rm = newRecordMutation(APPEND_COLUMN_VALUES, FAMILY, rec, c1, c2);

    updateAndFetchRecord("row-6", rec, rm);
  }
View Full Code Here

    }
    return rowMutation;
  }

  public static RecordMutation toRecordMutation(Record record) {
    RecordMutation recordMutation = new RecordMutation();
    recordMutation.setRecord(record);
    recordMutation.setRecordMutationType(RecordMutationType.REPLACE_ENTIRE_RECORD);
    return recordMutation;
  }
View Full Code Here

    }
    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

    Iface client = getClient();
    int length = 100;
    List<RowMutation> mutations = new ArrayList<RowMutation>();
    for (int i = 0; i < length; i++) {
      String rowId = UUID.randomUUID().toString();
      RecordMutation mutation = BlurThriftHelper.newRecordMutation("test", rowId,
          BlurThriftHelper.newColumn("test", "value"));
      RowMutation rowMutation = BlurThriftHelper.newRowMutation("test", rowId, mutation);
      rowMutation.setWaitToBeVisible(true);
      mutations.add(rowMutation);
    }
View Full Code Here

    Record record = new Record();
    record.setRecordId(recordid);
    record.setFamily(columnfamily);
    record.setColumns(columns);

    RecordMutation recordMutation = new RecordMutation();
    recordMutation.setRecord(record);
    recordMutation.setRecordMutationType(RecordMutationType.REPLACE_ENTIRE_RECORD);

    List<RecordMutation> recordMutations = new ArrayList<RecordMutation>();
    recordMutations.add(recordMutation);

    RowMutation mutation = new RowMutation();
View Full Code Here

          Record record = new Record();
          record.setRecordId(UUID.randomUUID().toString());
          record.setFamily("cf1");
          record.setColumns(columns);

          RecordMutation recordMutation = new RecordMutation();
          recordMutation.setRecord(record);
          recordMutation.setRecordMutationType(RecordMutationType.REPLACE_ENTIRE_RECORD);

          List<RecordMutation> recordMutations = new ArrayList<RecordMutation>();
          recordMutations.add(recordMutation);

          RowMutation mutation = new RowMutation();
View Full Code Here

    }
    return rowMutation;
  }

  public static RecordMutation toRecordMutation(Record record) {
    RecordMutation recordMutation = new RecordMutation();
    recordMutation.setRecord(record);
    recordMutation.setRecordMutationType(RecordMutationType.REPLACE_ENTIRE_RECORD);
    return recordMutation;
  }
View Full Code Here

    record.setFamily("testing");
    record.setRecordId(Long.toString(random.nextLong()));
    for (int i = 0; i < 10; i++) {
      record.addToColumns(new Column("col" + i, Long.toString(random.nextLong())));
    }
    rowMutation.addToRecordMutations(new RecordMutation(RecordMutationType.REPLACE_ENTIRE_RECORD, record));
    return rowMutation;
  }
View Full Code Here

  private static String extractRecordId(SolrInputDocument doc) {
    return doc.getFieldValue(BlurConstants.RECORD_ID).toString();
  }

  private static RecordMutation createRecordMutation(SolrInputDocument doc, String id) {
    RecordMutation recordMutation = new RecordMutation();
    // TODO: what's solr default behavior?
    recordMutation.setRecordMutationType(RecordMutationType.REPLACE_ENTIRE_RECORD);
    Record record = new Record();
    record.setFamily(findFamily(doc));
    record.setRecordId(id);

    for (String fieldName : doc.getFieldNames()) {
      if (!fieldName.contains(".")) {
        continue;
      }
      SolrInputField field = doc.getField(fieldName);
      String rawColumnName = fieldName.substring(fieldName.indexOf(".") + 1, fieldName.length());

      if (field.getValueCount() > 1) {
        for (Object fieldVal : field.getValues()) {
          record.addToColumns(new Column(rawColumnName, fieldVal.toString()));
        }
      } else {
        record.addToColumns(new Column(rawColumnName, field.getFirstValue().toString()));
      }
    }
    recordMutation.setRecord(record);
    return recordMutation;
  }
View Full Code Here

TOP

Related Classes of org.apache.blur.thrift.generated.RecordMutation$RecordMutationStandardScheme

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.