Package com.youtube.vitess.vtgate

Examples of com.youtube.vitess.vtgate.QueryResult


      if (err.length > 0) {
        error = new String(err);
      }
    }

    QueryResult queryResult = null;
    BSONObject result = (BSONObject) reply.get("Result");
    if (result != null) {
      queryResult = bsonToQueryResult(result, null);
    }
View Full Code Here


      fields = bsonToFields(result);
    }
    List<Row> rows = bsonToRows(result, fields);
    long rowsAffected = ((UnsignedLong) result.get("RowsAffected")).longValue();
    long lastRowId = ((UnsignedLong) result.get("InsertId")).longValue();
    return new QueryResult(rows, fields, rowsAffected, lastRowId);
  }
View Full Code Here

    // nothing to do here.
    if (this.iterator.hasNext() || streamEnded) {
      return;
    }

    QueryResult qr;
    try {
      qr = client.streamNext(queryResult.getFields());
    } catch (ConnectionException e) {
      logger.error("connection exception while streaming", e);
      throw new RuntimeException(e);
    }

    // null reply indicates EndOfStream, mark stream as ended and return
    if (qr == null) {
      streamEnded = true;
      return;
    }

    // For scatter streaming queries, VtGate sends fields data from each
    // shard. Since fields has already been fetched, just ignore these and
    // fetch the next batch.
    if (qr.getRows().size() == 0) {
      fetchMoreIfNeeded();
    } else {
      // We got more rows, update the current buffer and iterator
      queryResult = qr;
      iterator = queryResult.getRows().iterator();
View Full Code Here

TOP

Related Classes of com.youtube.vitess.vtgate.QueryResult

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.