Package org.apache.blur.thrift.generated

Examples of org.apache.blur.thrift.generated.Record$RecordStandardScheme


      String name = namePlusValue.substring(0, index);
      String value = namePlusValue.substring(index + 1);
      columns.add(new Column(name, value));
    }

    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);
View Full Code Here


          List<Column> columns = new ArrayList<Column>();
          for (int i = 5; i < args.length; i++) {
            columns.add(new Column(args[i], m.group(i - 4)));
          }

          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);
View Full Code Here

    }
  }

  private void add(BlurMutate value) throws IOException {
    BlurRecord blurRecord = value.getRecord();
    Record record = getRecord(blurRecord);
    String recordId = record.getRecordId();
    if (value.getMutateType() == MUTATE_TYPE.DELETE) {
      _deletedRowId = blurRecord.getRowId();
      return;
    }
    if (_countersSetup) {
      _columnCount.increment(record.getColumns().size());
    }
    List<Field> document = RowDocumentUtil.getDoc(_fieldManager, blurRecord.getRowId(), record);
    List<Field> dup = _documentBufferStrategy.add(recordId, document);
    if (_countersSetup) {
      if (dup != null) {
View Full Code Here

    rm(_localTmpPath);
    _localTmpPath = null;
  }

  private Record getRecord(BlurRecord value) {
    Record record = new Record();
    record.setRecordId(value.getRecordId());
    record.setFamily(value.getFamily());
    for (BlurColumn col : value.getColumns()) {
      record.addToColumns(new Column(col.getName(), col.getValue()));
    }
    return record;
  }
View Full Code Here

    return getRecordValues(field, mutate).get(0);
  }

  private List<Object> getRecordValues(String field, RowMutation mutate) {
    List<Object> vals = Lists.newArrayList();
    Record rec = getFirstRecord(mutate);

    for (Column col : rec.getColumns()) {

      if (col.getName().equals(field)) {
        vals.add(col.getValue());
      }
    }
View Full Code Here

  }

  private Row genRow() {
    Row row = new Row();
    row.setId(Long.toString(random.nextLong()));
    Record record = new Record();
    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())));
    }
    row.addToRecords(record);
    return row;
  }
View Full Code Here

  private RowMutation genRowMutation(String table) {
    RowMutation rowMutation = new RowMutation();
    rowMutation.setRowId(Long.toString(random.nextLong()));
    rowMutation.setTable(table);
    rowMutation.setRowMutationType(RowMutationType.REPLACE_ROW);
    Record record = new Record();
    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

    assertFalse(_fileSystem.exists(_inUsePath));
    validateIndex();
  }

  private Record genRecord(String recordId) {
    Record record = new Record();
    record.setFamily("testing");
    record.setRecordId(recordId);
    for (int i = 0; i < 10; i++) {
      record.addToColumns(new Column("col" + i, Long.toString(_random.nextLong())));
    }
    return record;
  }
View Full Code Here

  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

  }

  private static SolrDocument convertRecord(FetchRecordResult recResult) {
    SolrDocument doc = new SolrDocument();
    Record record = recResult.getRecord();

    doc.addField(BlurConstants.RECORD_ID, record.getRecordId());

    for (Column col : record.getColumns()) {
      doc.addField(joinColumnFamily(record.getFamily(), col.getName()), col.getValue());
    }

    return doc;
  }
View Full Code Here

TOP

Related Classes of org.apache.blur.thrift.generated.Record$RecordStandardScheme

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.