Examples of FetchRowResult


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

        fetchResult.deleted = false;
        String rowId = getRowId(reader, docId);
        Term term = new Term(ROW_ID, rowId);
        if (returnIdsOnly) {
          int recordCount = BlurUtil.countDocuments(reader, term);
          fetchResult.rowResult = new FetchRowResult();
          fetchResult.rowResult.row = new Row(rowId, null, recordCount);
        } else {
          List<Document> docs;
          if (highlightQuery != null && fieldManager != null) {
            HighlightOptions highlightOptions = selector.getHighlightOptions();
            String preTag = highlightOptions.getPreTag();
            String postTag = highlightOptions.getPostTag();
            docs = HighlightHelper.highlightDocuments(reader, term, fieldVisitor, selector, highlightQuery,
                fieldManager, preTag, postTag);
          } else {
            docs = BlurUtil.fetchDocuments(reader, term, fieldVisitor, selector, maxHeap, table + "/" + shard);
          }
          fetchResult.rowResult = new FetchRowResult(getRow(docs));
        }
        return;
      }
    }
  }
View Full Code Here

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

      if (Main.debug) {
        out.println("deleted : " + fetchResult.isDeleted());
        out.println("exists  : " + fetchResult.isExists());
        out.println("table   : " + fetchResult.getTable());
      }
      FetchRowResult rowResult = fetchResult.getRowResult();
      if (rowResult != null) {
        Row row = rowResult.getRow();
        if (row != null) {
          GetRowCommand.format(out, row, maxWidth);
        }
      }
      lineBreak(out, maxWidth);
View Full Code Here

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

    String rowId = args[2];

    Selector selector = new Selector(Main.selector);
    selector.setRowId(rowId);
    FetchResult fetchRow = client.fetchRow(tablename, selector);
    FetchRowResult rowResult = fetchRow.getRowResult();
    if (rowResult == null) {
      out.println("Row [" + rowId + "] not found.");
      return;
    }
    Row row = rowResult.getRow();
    if (row == null) {
      out.println("Row [" + rowId + "] not found.");
      return;
    }
    int maxWidth = 100;
View Full Code Here

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

    String rowId = args[2];

    Selector selector = new Selector(Main.selector);
    selector.setRowId(rowId);
    FetchResult fetchRow = client.fetchRow(tablename, selector);
    FetchRowResult rowResult = fetchRow.getRowResult();
    if (rowResult == null) {
      out.println("Row [" + rowId + "] not found.");
      return;
    }
    Row row = rowResult.getRow();
    if (row == null) {
      out.println("Row [" + rowId + "] not found.");
      return;
    }
    int maxWidth = 100;
View Full Code Here

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

      if (Main.debug) {
        out.println("deleted : " + fetchResult.isDeleted());
        out.println("exists  : " + fetchResult.isExists());
        out.println("table   : " + fetchResult.getTable());
      }
      FetchRowResult rowResult = fetchResult.getRowResult();
      if (rowResult != null) {
        Row row = rowResult.getRow();
        if (row != null) {
          GetRowCommand.format(out, rowResult, maxWidth);
        }
      }
      lineBreak(out, maxWidth);
View Full Code Here

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

      FetchRecordResult recordResult = fetchResult.getRecordResult();
      if (recordResult != null) {
        Record record = recordResult.getRecord();
        count(record, recordCount, columnCount, columnSize);
      }
      FetchRowResult rowResult = fetchResult.getRowResult();
      if (rowResult != null) {
        Row row = rowResult.getRow();
        count(row, rowCount, recordCount, columnCount, columnSize);
      }
    }

    StringBuilder builder = new StringBuilder();
View Full Code Here

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

    return RenderType.ROW_SINGLE_FAMILY;
  }

  private Set<String> getFamily(FetchResult fetchResult) {
    Set<String> result = new HashSet<String>();
    FetchRowResult rowResult = fetchResult.getRowResult();
    if (rowResult == null) {
      FetchRecordResult recordResult = fetchResult.getRecordResult();
      Record record = recordResult.getRecord();
      result.add(record.getFamily());
    } else {
      Row row = rowResult.getRow();
      List<Record> records = row.getRecords();
      if (records != null) {
        for (Record record : records) {
          result.add(record.getFamily());
        }
View Full Code Here

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

    tableDisplay.setHeader(2, highlight(getTruncatedVersion("recordid")));
    List<String> columnsLabels = new ArrayList<String>();
    int result = 0;
    for (BlurResult blurResult : blurResults.getResults()) {
      FetchResult fetchResult = blurResult.getFetchResult();
      FetchRowResult rowResult = fetchResult.getRowResult();
      if (rowResult == null) {
        FetchRecordResult recordResult = fetchResult.getRecordResult();
        String rowid = recordResult.getRowid();
        Record record = recordResult.getRecord();
        String family = record.getFamily();
        if (record.getColumns() != null) {
          for (Column column : record.getColumns()) {
            addToTableDisplay(result, columnsLabels, tableDisplay, line, rowid, family, record.getRecordId(), column);
          }
        }
        line++;
      } else {
        Row row = rowResult.getRow();
        List<Record> records = row.getRecords();
        if (records != null) {
          for (Record record : records) {
            if (record.getColumns() != null) {
              for (Column column : record.getColumns()) {
View Full Code Here

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

    tableDisplay.setHeader(2, highlight(getTruncatedVersion("recordid")));
    Map<String, List<String>> columnOrder = new HashMap<String, List<String>>();
    int result = 0;
    for (BlurResult blurResult : blurResults.getResults()) {
      FetchResult fetchResult = blurResult.getFetchResult();
      FetchRowResult rowResult = fetchResult.getRowResult();
      if (rowResult != null) {
        Row row = rowResult.getRow();
        String id = row.getId();
        tableDisplay.set(1, line.get(), white(getTruncatedVersion(toStringBinary(id))));
        List<Record> records = order(row.getRecords());
        String currentFamily = "#";
        for (Record record : records) {
View Full Code Here

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

            if (returnIdsOnly) {
              String rowId = selector.getRowId();
              if (rowId == null) {
                rowId = getRowId(reader, docId);
              }
              fetchResult.rowResult = new FetchRowResult();
              fetchResult.rowResult.row = new Row(rowId, null);
            } else {
              List<Document> docs;
              AtomicBoolean moreDocsToFetch = new AtomicBoolean(false);
              AtomicInteger totalRecords = new AtomicInteger();
              BlurHighlighter highlighter = new BlurHighlighter(highlightQuery, fieldManager, selector);
              Tracer docTrace = Trace.trace("fetchRow - Document read");
              docs = BlurUtil.fetchDocuments(reader, fieldVisitor, selector, maxHeap, table + "/" + shard,
                  tableContext.getDefaultPrimeDocTerm(), filter, moreDocsToFetch, totalRecords, highlighter);
              docTrace.done();
              Tracer rowTrace = Trace.trace("fetchRow - Row create");
              Row row = getRow(docs);
              if (row == null) {
                String rowId = selector.getRowId();
                if (rowId == null) {
                  rowId = getRowId(reader, docId);
                }
                row = new Row(rowId, null);
              }
              fetchResult.rowResult = new FetchRowResult(row, selector.getStartRecord(),
                  selector.getMaxRecordsToFetch(), moreDocsToFetch.get(), totalRecords.get());
              rowTrace.done();
            }
            return;
          }
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.