Package org.apache.blur.thrift.generated

Examples of org.apache.blur.thrift.generated.RowMutation.addToRecordMutations()


    rowMutation.setRowId(row.getId());
    rowMutation.setTable(table);
    rowMutation.setRowMutationType(RowMutationType.REPLACE_ROW);
    List<Record> records = row.getRecords();
    for (Record record : records) {
      rowMutation.addToRecordMutations(toRecordMutation(record));
    }
    return rowMutation;
  }

  public static RecordMutation toRecordMutation(Record record) {
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

    RowMutation mutation = new RowMutation();
    mutation.setTable(table);
    mutation.setRowId(Integer.toString(rowid));
    mutation.setRowMutationType(RowMutationType.REPLACE_ROW);
    for (int j = 0; j < numberRecordsPerRow; j++) {
      mutation.addToRecordMutations(getRecordMutation(numberOfColumns, numberOfFamilies, numberOfWords));
    }
    return mutation;
  }

  private static void loadWords() throws IOException {
View Full Code Here

      mutation.setTable(table);
      String rowId = getRowId();
      mutation.setRowId(rowId);
      mutation.setRowMutationType(RowMutationType.REPLACE_ROW);
      for (int j = 0; j < numberRecordsPerRow; j++) {
        mutation.addToRecordMutations(getRecordMutation(numberOfColumns, numberOfFamilies, numberOfWords));
      }
      batch.add(mutation);
      if (batch.size() >= batchSize) {
        long sm = System.nanoTime();
        client.mutateBatch(batch);
View Full Code Here

    RowMutation mutation = new RowMutation();
    mutation.setRowId(rowId);
    mutation.setTable(table);
    mutation.setRowMutationType(type);
    for (RecordMutation recordMutation : mutations) {
      mutation.addToRecordMutations(recordMutation);
    }
    return mutation;
  }

  public static Record newRecord(String family, String recordId, Column... columns) {
View Full Code Here

    rowMutation.setTable(table);
    rowMutation.setRowMutationType(RowMutationType.REPLACE_ROW);
    rowMutation.setRowId(row.getId());
    List<Record> records = row.getRecords();
    for (Record record : records) {
      rowMutation.addToRecordMutations(new RecordMutation(RecordMutationType.REPLACE_ENTIRE_RECORD, record));
    }
    return rowMutation;
  }

}
View Full Code Here

        }

        RecordMutation recordMutation = new RecordMutation().setRecordMutationType(RecordMutationType.REPLACE_COLUMNS);
        Record record = new Record().setFamily(getFamily(store)).setRecordId(rowId);

        rowMutation.addToRecordMutations(recordMutation);
        rowMutation.setRowMutationType(RowMutationType.UPDATE_ROW);

        if (mutation.hasAdditions()) {
          for (IndexEntry indexEntry : mutation.getAdditions()) {
            record.addToColumns(new Column(indexEntry.key, getValue(indexEntry.value)));
View Full Code Here

    mutation.setTable(table);
    String rowId = getRowId();
    mutation.setRowId(rowId);
    mutation.setRowMutationType(RowMutationType.REPLACE_ROW);
    for (int j = 0; j < numberRecordsPerRow; j++) {
      mutation.addToRecordMutations(getRecordMutation(numberOfColumns, numberOfFamilies, numberOfWords));
    }
    return mutation;
  }

  private static void loadWords() throws IOException {
View Full Code Here

  @SuppressWarnings("unused")
  private void testJoin() throws BlurException, TException {
    RowMutation mutation = new RowMutation();
    mutation.table = table;
    mutation.rowId = "row1";
    mutation.addToRecordMutations(newRecordMutation("cf1", "recordid1", newColumn("col1", "value1")));
    mutation.addToRecordMutations(newRecordMutation("cf1", "recordid2", newColumn("col2", "value2")));
    mutation.rowMutationType = RowMutationType.REPLACE_ROW;
    client.mutate(mutation);

    List<String> joinTest = new ArrayList<String>();
View Full Code Here

  private void testJoin() throws BlurException, TException {
    RowMutation mutation = new RowMutation();
    mutation.table = table;
    mutation.rowId = "row1";
    mutation.addToRecordMutations(newRecordMutation("cf1", "recordid1", newColumn("col1", "value1")));
    mutation.addToRecordMutations(newRecordMutation("cf1", "recordid2", newColumn("col2", "value2")));
    mutation.rowMutationType = RowMutationType.REPLACE_ROW;
    client.mutate(mutation);

    List<String> joinTest = new ArrayList<String>();
    joinTest.add("+cf1.col1:value1");
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.