Package org.tarantool.core.cmd

Examples of org.tarantool.core.cmd.Select


    Tuple args = Tuple.create(ByteBuffer.wrap(call.getBody()).order(ByteOrder.LITTLE_ENDIAN), ByteOrder.LITTLE_ENDIAN);
    return packResult(request, callStub.call(this, call.getProcName(), call.getFlags(), args), Call.OP_CODE);
  }

  private Response executeSelect(Request request) {
    Select select = ((Select) request);
    List<Tuple> result = new ArrayList<Tuple>();
    for (int i = 0; i < select.getBody().length; i++) {
      Tuple key = Tuple.create(ByteBuffer.wrap(select.getBody()[i]).order(ByteOrder.LITTLE_ENDIAN), ByteOrder.LITTLE_ENDIAN);
      result.addAll(get(select.getSpace(), select.getIndex(), key));
    }
    shiftAndLimit(select.getOffset(), select.getLimit(), result);
    return packResult(request, result, Select.OP_CODE);
  }
View Full Code Here


  /** {@inheritDoc} */
  @Override
  public List<Tuple> find(int space, int index, int offset, int limit, Tuple... keys) {
    try {
      Response response = transport.execute(new Select(id.incrementAndGet(), keys).space(space).index(index).offset(offset).limit(limit));
      return response.readTuples();
    } finally {
      returnConnection();
    }

View Full Code Here

  /** {@inheritDoc} */
  @Override
  public Tuple findOne(int space, int index, int offset, Tuple... keys) {
    try {
      Response response = transport.execute(new Select(id.incrementAndGet(), keys).space(space).index(index).offset(offset).limit(1));
      List<Tuple> tuples = response.readTuples();
      return tuples == null || tuples.isEmpty() ? null : tuples.get(0);
    } finally {
      returnConnection();
    }
View Full Code Here

TOP

Related Classes of org.tarantool.core.cmd.Select

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.