Package org.tarantool.core.proto

Examples of org.tarantool.core.proto.Updates


    }
  }

  private void update(int spaceNum, ByteBuffer buffer, Tuple tuple) {
    int fieldNo = buffer.getInt();
    Updates up = Updates.valueOf((int) buffer.get());

    Tuple args = null;
    if (up.args > 0) {
      args = Tuple.createFromPackedFields(buffer, ByteOrder.LITTLE_ENDIAN, 1);
    }
View Full Code Here


  public static OperationImpl unpack(ByteBuffer buffer) {
    int fieldNo = buffer.getInt();
    byte type = buffer.get();
    Updates[] ups = Updates.values();
    Updates update = null;
    for (Updates up : ups) {
      if (up.type == (int) type) {
        update = up;
        break;
      }
    }
    if (update == null) {
      throw new IllegalStateException("Unknown update op type " + type);
    }
    if (update.args > 1) {
      int fields = Leb128.readUnsigned(buffer);
      if (fields != update.args) {
        throw new IllegalStateException("op " + update.name() + " should has " + update.args + " arguments, but has " + fields);
      }
    }
    Tuple opArgs = Tuple.createFromPackedFields(buffer, ByteOrder.LITTLE_ENDIAN, update.args);
    return new OperationImpl(update, fieldNo, opArgs);
  }
View Full Code Here

TOP

Related Classes of org.tarantool.core.proto.Updates

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.