Exemplo n.º 1
0
  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();

    sb.append("ReplyMessage{responseTo=")
        .append(responseTo)
        .append(", cursorNotFound=")
        .append(cursorNotFound)
        .append(", queryFailure=")
        .append(queryFailure)
        .append(", shardConfigStale=")
        .append(shardConfigStale)
        .append(", awaitCapable=")
        .append(awaitCapable)
        .append(", cursorId=")
        .append(cursorId)
        .append(", startingFrom=")
        .append(startingFrom);

    if (dataContext.isValid()) {
      // TODO: This must be changed to preserve privacy on logs
      int docsLimit = 10;
      sb.append(", documents (limited to ")
          .append(docsLimit)
          .append(")=")
          .append(Iterables.toString(documents.getIterable(AllocationType.HEAP).limit(docsLimit)));
    } else {
      sb.append(", documents=<not available>");
    }
    return sb.append('}').toString();
  }
Exemplo n.º 2
0
 public Builder(
     @Nonnull BsonContext dataContext,
     int requestId,
     long cursorId,
     int startingFrom,
     @Ethereal("dataContext") BsonDocument document) {
   this(dataContext, requestId, cursorId, startingFrom, IterableDocumentProvider.of(document));
 }