Package org.apache.blur.thrift.generated

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


    FileSystem fileSystem = FileSystem.get(tablePath.toUri(), new Configuration());
    fileSystem.delete(tablePath, true);
  }

  public static RowMutation toRowMutation(String table, Row row) {
    RowMutation rowMutation = new RowMutation();
    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;
  }
View Full Code Here


    System.exit(0);
  }

  @SuppressWarnings("unused")
  private void testJoin() throws BlurException, TException {
    RowMutation mutation = new RowMutation();
    mutation.table = table;
    mutation.waitToBeVisible = true;
    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.waitToBeVisible = false;
      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

        countRecord = 0;
        s = System.currentTimeMillis();
        ts = System.nanoTime();
      }

      RowMutation mutation = new RowMutation();
      mutation.setTable(table);
      String rowId = getRowId();
      mutation.setRowId(rowId);
      mutation.setWal(wal);
      mutation.setRowMutationType(RowMutationType.REPLACE_ROW);
      for (int j = 0; j < numberRecordsPerRow; j++) {
        mutation.addToRecordMutations(getRecordMutation(numberOfColumns, numberOfFamilies, numberOfWords));
        countRecord++;
      }
      if (batch == 1) {
        client.mutate(mutation);
      } else {
View Full Code Here

    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);
    }
    long s = System.nanoTime();
    client.mutateBatch(mutations);
    long e = System.nanoTime();
View Full Code Here

    recordMutation.setRecordMutationType(RecordMutationType.REPLACE_ENTIRE_RECORD);

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

    RowMutation mutation = new RowMutation();
    mutation.setTable(tablename);
    mutation.setRowId(rowid);
    mutation.setRowMutationType(RowMutationType.UPDATE_ROW);
    mutation.setRecordMutations(recordMutations);

    client.mutate(mutation);
  }
View Full Code Here

          recordMutation.setRecordMutationType(RecordMutationType.REPLACE_ENTIRE_RECORD);

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

          RowMutation mutation = new RowMutation();
          mutation.setTable(tablename);
          mutation.setRowId(UUID.randomUUID().toString());
          mutation.setRowMutationType(RowMutationType.REPLACE_ROW);
          mutation.setRecordMutations(recordMutations);

          mutations.add(mutation);

          if (mutations.size() == batchSize) {
            client.mutateBatch(mutations);
View Full Code Here

      throw new CommandException("Invalid args: " + help());
    }
    String tablename = args[1];
    String rowId = args[2];

    RowMutation mutation = new RowMutation();
    mutation.setRowId(rowId);
    mutation.setTable(tablename);
    mutation.setRowMutationType(RowMutationType.DELETE_ROW);
    client.mutate(mutation);
  }
View Full Code Here

  }

  public static String getArgsStr(Object[] args, String methodName, LoggerArgsState loggerArgsState) {
    String argsStr;
    if (methodName.equals("mutate")) {
      RowMutation rowMutation = (RowMutation) args[0];
      if (rowMutation == null) {
        argsStr = "[null]";
      } else {
        String table = rowMutation.getTable();
        String rowId = rowMutation.getRowId();
        if (table != null) {
          table = "\"" + table + "\"";
        }
        if (rowId != null) {
          rowId = "\"" + rowId + "\"";
View Full Code Here

    FileSystem fileSystem = FileSystem.get(tablePath.toUri(), new Configuration());
    fileSystem.delete(tablePath, true);
  }

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