Package org.apache.blur.thrift.generated

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


        recordCount = 0;
        totalTime = 0;
        calls = 0;
      }

      RowMutation mutation = new RowMutation();
      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


    return newRowMutation(RowMutationType.REPLACE_ROW, table, rowId, mutations);
  }

  public static RowMutation newRowMutation(RowMutationType type, String table, String rowId,
      RecordMutation... mutations) {
    RowMutation mutation = new RowMutation();
    mutation.setRowId(rowId);
    mutation.setTable(table);
    mutation.setRowMutationType(type);
    for (RecordMutation recordMutation : mutations) {
      mutation.addToRecordMutations(recordMutation);
    }
    return mutation;
  }
View Full Code Here

  public static boolean match(Record left, Record right) {
    return left.recordId.equals(right.recordId) && left.family.equals(right.family);
  }

  public static RowMutation newRowMutation(String table, Row row) {
    RowMutation rowMutation = new RowMutation();
    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

      String tableName = getTableName(store);
      for (Map.Entry<String, IndexMutation> entry : stores.getValue().entrySet()) {
        String rowId = entry.getKey();
        IndexMutation mutation = entry.getValue();

        RowMutation rowMutation = new RowMutation();
        rowMutation.setRowId(rowId);
        rowMutation.setTable(tableName);
        rowMutation.setWal(_wal);
        rowMutation.setWaitToBeVisible(_waitToBeVisible);
        mutationBatch.add(rowMutation);

        if (mutation.isDeleted()) {
          rowMutation.setRowMutationType(RowMutationType.DELETE_ROW);
          continue;
        }

        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

    Record record = new Record();
    record.setRecordId(Integer.toString(i));
    record.setFamily("test");
    record.addToColumns(new Column("test", Integer.toString(i)));
    row.addToRecords(record);
    RowMutation rowMutation = BlurUtil.toRowMutation(table, row);
    client.mutate(rowMutation);
  }
View Full Code Here

    }
  }

  private static RowMutation getRowMutation(String table, int numberRecordsPerRow, int numberOfColumns,
      int numberOfFamilies, int numberOfWords) {
    RowMutation mutation = new RowMutation();
    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;
  }
View Full Code Here

    System.exit(0);
  }

  @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>();
    joinTest.add("+cf1.col1:value1");
View Full Code Here

  public void loadupTable(int rows) throws BlurException, TException, IOException {

    long start = System.currentTimeMillis();

    long buildTotal = 0;
    RowMutation mutation = new RowMutation();

    for (int i = 1; i <= rows; i++) {
      long buildStart = System.currentTimeMillis();
      mutation.clear();
      mutation.table = table;
      mutation.rowId = UUID.randomUUID().toString();
      mutation.addToRecordMutations(newRecordMutation("test", "test-" + i, newColumn("uuidField", UUID.randomUUID().toString()), newColumn("numberField", i + ""),
          newColumn("fatTextField", randomString(1000))));
      mutation.rowMutationType = RowMutationType.REPLACE_ROW;

      if (i % 50 == 0) {
        System.out.println("loaded: " + i + " around " + df.format((i / ((System.currentTimeMillis() - start + 0.0) / 1000))) + " rows/s");
View Full Code Here

    }
    file.delete();
  }

  private void setupData() throws BlurException, IOException {
    RowMutation mutation1 = newRowMutation(
        TABLE,
        "row-1",
        newRecordMutation(FAMILY, "record-1", newColumn("testcol1", "value1"), newColumn("testcol2", "value2"),
            newColumn("testcol3", "value3")));
    RowMutation mutation2 = newRowMutation(
        TABLE,
        "row-2",
        newRecordMutation(FAMILY, "record-2", newColumn("testcol1", "value4"), newColumn("testcol2", "value5"),
            newColumn("testcol3", "value6")),
        newRecordMutation(FAMILY, "record-2B", newColumn("testcol2", "value234123"),
            newColumn("testcol3", "value234123")));
    RowMutation mutation3 = newRowMutation(
        TABLE,
        "row-3",
        newRecordMutation(FAMILY, "record-3", newColumn("testcol1", "value7"), newColumn("testcol2", "value8"),
            newColumn("testcol3", "value9")));
    RowMutation mutation4 = newRowMutation(
        TABLE,
        "row-4",
        newRecordMutation(FAMILY, "record-4", newColumn("testcol1", "value1"), newColumn("testcol2", "value5"),
            newColumn("testcol3", "value9")),
        newRecordMutation(FAMILY, "record-4B", newColumn("testcol2", "value234123"),
            newColumn("testcol3", "value234123")));
    RowMutation mutation5 = newRowMutation(
        TABLE,
        "row-5",
        newRecordMutation(FAMILY, "record-5A", newColumn("testcol1", "value13"), newColumn("testcol2", "value14"),
            newColumn("testcol3", "value15")),
        newRecordMutation(FAMILY, "record-5B", newColumn("testcol1", "value16"), newColumn("testcol2", "value17"),
            newColumn("testcol3", "value18"), newColumn("testcol3", "value19")));
    RowMutation mutation6 = newRowMutation(TABLE, "row-6",
        newRecordMutation(FAMILY, "record-6A", newColumn("testcol12", "value110"), newColumn("testcol13", "value102")),
        newRecordMutation(FAMILY, "record-6B", newColumn("testcol12", "value101"), newColumn("testcol13", "value104")),
        newRecordMutation(FAMILY2, "record-6C", newColumn("testcol18", "value501")));
    RowMutation mutation7 = newRowMutation(TABLE, "row-7",
        newRecordMutation(FAMILY, "record-7A", newColumn("testcol12", "value101"), newColumn("testcol13", "value102")),
        newRecordMutation(FAMILY2, "record-7B", newColumn("testcol18", "value501")));
    indexManager.mutate(mutation1);
    indexManager.mutate(mutation2);
    indexManager.mutate(mutation3);
View Full Code Here

    Trace.setStorage(oldReporter);

  }

  private RowMutation getLargeRow(String rowId) {
    RowMutation rowMutation = new RowMutation();
    rowMutation.setTable(TABLE);
    rowMutation.setRowId(rowId);
    rowMutation.setRecordMutations(getRecordMutations(10000));
    rowMutation.setRowMutationType(RowMutationType.REPLACE_ROW);
    return rowMutation;
  }
View Full Code Here

TOP

Related Classes of org.apache.blur.thrift.generated.RowMutation

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.