Examples of FetchResult


Examples of freenet.client.FetchResult

        return;
      }
    }

    if(!block.isMetadata()) {
      onSuccess(new FetchResult(clientMetadata, data), context);
    } else {
      handleMetadata(data, context);
    }
  }
View Full Code Here

Examples of freenet.client.FetchResult

              throw new FetchException(FetchExceptionMode.NOT_ENOUGH_DISK_SPACE);
          } catch (IOException e) {
            throw new FetchException(FetchExceptionMode.BUCKET_ERROR);
          }
          // Return the data
          onSuccess(new FetchResult(clientMetadata, out), context);
         
          return;
        } else {
          if(logMINOR) Logger.minor(this, "Fetching archive (thisKey="+thisKey+ ')');
          // Metadata cannot contain pointers to files which don't exist.
          // We enforce this in ArchiveHandler.
          // Therefore, the archive needs to be fetched.
          final boolean persistent = this.persistent;
          fetchArchive(true, archiveMetadata, filename, new ArchiveExtractCallback() {
                        private static final long serialVersionUID = 1L;
                        @Override
            public void gotBucket(Bucket data, ClientContext context) {
              if(logMINOR) Logger.minor(this, "Returning data");
              // Because this will be processed immediately, and because the callback uses a StreamGenerator,
              // we can simply pass in the output bucket, even if it is not persistent.
              // If we ever change it so a StreamGenerator can be saved, we'll have to copy here.
              // Transient buckets should throw if attempted to store.
              onSuccess(new FetchResult(clientMetadata, data), context);
            }
            @Override
            public void notInArchive(ClientContext context) {
              onFailure(new FetchException(FetchExceptionMode.NOT_IN_ARCHIVE), false, context);
            }
View Full Code Here

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

    }
    return row;
  }

  private void doUpdateRowMutation(RowMutation mutation, BlurIndex blurIndex) throws BlurException, IOException {
    FetchResult fetchResult = new FetchResult();
    Selector selector = new Selector();
    selector.setRowId(mutation.rowId);
    fetchRow(mutation.table, selector, fetchResult);
    Row existingRow;
    if (fetchResult.exists) {
View Full Code Here

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

  private FetchResult getFetchResult(String resolveId) throws BlurException {
    if (_selector == null) {
      return null;
    }
    FetchResult fetchResult = new FetchResult();
    _selector.setLocationId(resolveId);
    IndexManager.validSelector(_selector);
    try {

      IndexManager.fetchRow(_searcher.getIndexReader(), _table, _shard, _selector, fetchResult, null,
View Full Code Here

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

    HighlightOptions highlightOptions = new HighlightOptions();
    Query query = new Query();
    query.setQuery(FAMILY2 + ".testcol13:value105 " + FAMILY + ".testcol12:value101");
    highlightOptions.setQuery(query);
    selector.setHighlightOptions(highlightOptions);
    FetchResult fetchResult = new FetchResult();
    indexManager.fetchRow(TABLE, selector, fetchResult);

    assertNotNull(fetchResult.rowResult.row);
    Row row = newRow("row-6", newRecord(FAMILY, "record-6B", newColumn("testcol12", "<<<value101>>>")));
    row.recordCount = 3;
View Full Code Here

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

    HighlightOptions highlightOptions = new HighlightOptions();
    Query query = new Query();
    query.setQuery("cool value101");
    highlightOptions.setQuery(query);
    selector.setHighlightOptions(highlightOptions);
    FetchResult fetchResult = new FetchResult();
    indexManager.fetchRow(TABLE, selector, fetchResult);

    assertNotNull(fetchResult.rowResult.row);
    Row row = newRow("row-6", newRecord(FAMILY, "record-6B", newColumn("testcol12", "<<<value101>>>")));
    row.recordCount = 3;
View Full Code Here

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

    HighlightOptions highlightOptions = new HighlightOptions();
    Query query = new Query();
    query.setQuery("cool ?alue101");
    highlightOptions.setQuery(query);
    selector.setHighlightOptions(highlightOptions);
    FetchResult fetchResult = new FetchResult();
    indexManager.fetchRow(TABLE, selector, fetchResult);

    assertNotNull(fetchResult.rowResult.row);
    Row row = newRow("row-6", newRecord(FAMILY, "record-6B", newColumn("testcol12", "<<<value101>>>")));
    row.recordCount = 3;
View Full Code Here

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

    Query query = new Query();
    query.setQuery(FAMILY + ".testcol1:value1");
    query.setRowQuery(false);
    highlightOptions.setQuery(query);
    selector.setHighlightOptions(highlightOptions);
    FetchResult fetchResult = new FetchResult();
    indexManager.fetchRow(TABLE, selector, fetchResult);
    assertNull(fetchResult.rowResult);
    assertNotNull(fetchResult.recordResult.record);

    assertEquals("row-1", fetchResult.recordResult.rowid);
View Full Code Here

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

    assertEquals(iterable.getTotalResults(), 1);
    BlurIterator<BlurResult, BlurException> iterator = iterable.iterator();
    while (iterator.hasNext()) {
      BlurResult result = iterator.next();
      Selector selector = new Selector().setLocationId(result.getLocationId());
      FetchResult fetchResult = new FetchResult();
      indexManager.fetchRow(TABLE, selector, fetchResult);
      assertNotNull(fetchResult.rowResult);
      assertNull(fetchResult.recordResult);
    }
  }
View Full Code Here

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

    assertEquals(iterable.getTotalResults(), 1);
    BlurIterator<BlurResult, BlurException> iterator = iterable.iterator();
    while (iterator.hasNext()) {
      BlurResult result = iterator.next();
      Selector selector = new Selector().setLocationId(result.getLocationId());
      FetchResult fetchResult = new FetchResult();
      indexManager.fetchRow(TABLE, selector, fetchResult);
      assertNotNull(fetchResult.rowResult);
      assertNull(fetchResult.recordResult);
    }
  }
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.