Package org.apache.blur.thrift.generated

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


    recordMutation.setRecordMutationType(RecordMutationType.REPLACE_ENTIRE_RECORD);
    return recordMutation;
  }

  private static Record getRecord(int numberOfColumns, int numberOfFamilies, int numberOfWords) {
    Record record = new Record();
    record.setRecordId(getRowId());
    record.setFamily(getFamily(numberOfFamilies));
    for (int i = 0; i < numberOfColumns; i++) {
      record.addToColumns(new Column("col" + i, getWords(numberOfWords)));
    }
    return record;
  }
View Full Code Here


  @Test
  public void testFieldManagerWithNullFamily() throws IOException {
    BaseFieldManager memoryFieldManager = newFieldManager(true);
    memoryFieldManager.addColumnDefinition(null, "col1", null, true, "text", false, null);

    Record record = new Record();
    record.setRecordId("1213");
    record.addToColumns(new Column("col1", "value1"));

    List<Field> fields = getFields(null, "1", "1213", newFieldsNoStore(BlurConstants.FIELDS, "_default_.col1"),
        newTextField(memoryFieldManager.resolveField("col1"), "value1"), newTextFieldNoStore(_fieldLessField, "value1"));

    int c = 0;
View Full Code Here

  @Test
  public void testFieldManagerMultipleColumnsSameName() throws IOException {
    BaseFieldManager memoryFieldManager = newFieldManager(true);
    memoryFieldManager.addColumnDefinition("fam1", "col1", null, false, "text", false, null);

    Record record = new Record();
    record.setFamily("fam1");
    record.setRecordId("1213");
    record.addToColumns(new Column("col1", "value1"));
    record.addToColumns(new Column("col1", "value2"));

    List<Field> fields = getFields("fam1", "1", "1213", newFieldsNoStore(BlurConstants.FIELDS, "fam1.col1"),
        newFieldsNoStore(BlurConstants.FIELDS, "fam1.col1"), newTextField("fam1.col1", "value1"),
        newTextField("fam1.col1", "value2"));
View Full Code Here

  public void testFieldManagerMultipleColumnsDifferentNames() throws IOException {
    BaseFieldManager memoryFieldManager = newFieldManager(true);
    memoryFieldManager.addColumnDefinition("fam1", "col1", null, false, "text", false, null);
    memoryFieldManager.addColumnDefinition("fam1", "col2", null, true, "text", false, null);

    Record record = new Record();
    record.setFamily("fam1");
    record.setRecordId("1213");
    record.addToColumns(new Column("col1", "value1"));
    record.addToColumns(new Column("col2", "value2"));

    List<Field> fields = getFields("fam1", "1", "1213", newFieldsNoStore(BlurConstants.FIELDS, "fam1.col1"),
        newFieldsNoStore(BlurConstants.FIELDS, "fam1.col2"), newTextField("fam1.col1", "value1"),
        newTextField("fam1.col2", "value2"), newTextFieldNoStore(BlurConstants.SUPER, "value2"));
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

  public void testFieldManagerMultipleColumnsDifferentNamesDifferentFamilies() throws IOException {
    BaseFieldManager memoryFieldManager = newFieldManager(true);
    memoryFieldManager.addColumnDefinition("fam1", "col1", null, false, "text", false, null);
    memoryFieldManager.addColumnDefinition("fam2", "col2", null, false, "text", false, null);

    Record record1 = new Record();
    record1.setFamily("fam1");
    record1.setRecordId("1213");
    record1.addToColumns(new Column("col1", "value1"));

    List<Field> fields1 = getFields("fam1", "1", "1213", newFieldsNoStore(BlurConstants.FIELDS, "fam1.col1"),
        newTextField("fam1.col1", "value1"));
    int c1 = 0;
    for (Field field : memoryFieldManager.getFields("1", record1)) {
      assertFieldEquals(fields1.get(c1++), field);
    }

    Record record2 = new Record();
    record2.setFamily("fam2");
    record2.setRecordId("1213");
    record2.addToColumns(new Column("col2", "value1"));

    List<Field> fields2 = getFields("fam2", "1", "1213", newFieldsNoStore(BlurConstants.FIELDS, "fam2.col2"),
        newTextField("fam2.col2", "value1"));
    int c2 = 0;
    for (Field field : memoryFieldManager.getFields("1", record2)) {
View Full Code Here

  public void testFieldManagerMultipleColumnsDifferentNamesNullFamilies() throws IOException {
    BaseFieldManager memoryFieldManager = newFieldManager(true);
    memoryFieldManager.addColumnDefinition(null, "col1", null, false, "text", false, null);
    memoryFieldManager.addColumnDefinition(null, "col2", null, false, "text", false, null);

    Record record1 = new Record();
    record1.setRecordId("1213");
    record1.addToColumns(new Column("col1", "value1"));

    List<Field> fields1 = getFields(null, "1", "1213",
        newFieldsNoStore(BlurConstants.FIELDS, BlurConstants.DEFAULT_FAMILY + ".col1"),
        newTextField(memoryFieldManager.resolveField("col1"), "value1"));
    int c1 = 0;
    for (Field field : memoryFieldManager.getFields("1", record1)) {
      assertFieldEquals(fields1.get(c1++), field);
    }

    Record record2 = new Record();
    record2.setRecordId("1213");
    record2.addToColumns(new Column("col2", "value1"));

    List<Field> fields2 = getFields(null, "1", "1213",
        newFieldsNoStore(BlurConstants.FIELDS, BlurConstants.DEFAULT_FAMILY + ".col2"),
        newTextField(memoryFieldManager.resolveField("col2"), "value1"));
    int c2 = 0;
View Full Code Here

  public void testFieldManagerSubName() throws IOException {
    BaseFieldManager memoryFieldManager = newFieldManager(true);
    memoryFieldManager.addColumnDefinition("fam1", "col1", null, false, "text", false, null);
    memoryFieldManager.addColumnDefinition("fam1", "col1", "sub1", false, "text", false, null);

    Record record = new Record();
    record.setRecordId("1213");
    record.setFamily("fam1");
    record.addToColumns(new Column("col1", "value1"));

    List<Field> fields = getFields("fam1", "1", "1213", newFieldsNoStore(BlurConstants.FIELDS, "fam1.col1"),
        newTextField("fam1.col1", "value1"), newTextFieldNoStore("fam1.col1.sub1", "value1"));
    int c = 0;
    for (Field field : memoryFieldManager.getFields("1", record)) {
View Full Code Here

    String lastValue = null;
    long totalFetched = 0;
    do {
      for (BlurResult blurResult : resultsRow.getResults()) {
        FetchResult fetchResult = blurResult.getFetchResult();
        Record record = fetchResult.getRecordResult().getRecord();
        if (lastValue == null) {
          lastValue = getColumnValue(record, "facet");
        } else {
          String currentValue = getColumnValue(record, "facet");
          if (currentValue.compareTo(lastValue) < 0) {
View Full Code Here

TOP

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

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.