Package org.tarantool.core.cmd

Examples of org.tarantool.core.cmd.Insert


      }
    };
    TupleSupport ts = new TupleSupport();
    for (int i = 0; i < 10; i++) {
      Tuple tuple = ts.create(i, Long.parseLong("98765432" + i), "Hello world " + i + "!");
      xlog.writeXLog(new Insert(0, tuple).flags(2));
    }

    xlog.close();
    Assert.assertTrue(closed.get());
    DataInputStream is = new DataInputStream(ClassLoader.getSystemResourceAsStream("test.xlog"));
View Full Code Here


  /** {@inheritDoc} */
  @Override
  public Tuple insertAndGet(int space, Tuple tuple) {
    try {
      Response response = transport.execute(new Insert(id.incrementAndGet(), tuple.pack()).space(space).flags(Flags.RETURN_TUPLE | Flags.ADD_TUPLE));
      return response.readSingleTuple();
    } finally {
      returnConnection();
    }

View Full Code Here

  /** {@inheritDoc} */
  @Override
  public Integer insert(int space, Tuple tuple) {
    try {
      Response response = transport.execute(new Insert(id.incrementAndGet(), tuple.pack()).space(space).flags(Flags.ADD_TUPLE));
      return response.getCount();
    } finally {
      returnConnection();
    }

View Full Code Here

  /** {@inheritDoc} */
  @Override
  public Integer replace(int space, Tuple tuple) {
    try {
      Response response = transport.execute(new Insert(id.incrementAndGet(), tuple.pack()).space(space).flags(Flags.REPLACE_TUPLE));
      return response.getCount();
    } finally {
      returnConnection();
    }

View Full Code Here

  /** {@inheritDoc} */
  @Override
  public Tuple replaceAndGet(int space, Tuple tuple) {
    try {
      Response response = transport.execute(new Insert(id.incrementAndGet(), tuple.pack()).space(space).flags(Flags.REPLACE_TUPLE | Flags.RETURN_TUPLE));
      return response.readSingleTuple();
    } finally {
      returnConnection();
    }

View Full Code Here

  /** {@inheritDoc} */
  @Override
  public Tuple insertOrReplaceAndGet(int space, Tuple tuple) {
    try {
      Response response = transport.execute(new Insert(id.incrementAndGet(), tuple.pack()).space(space).flags(Flags.RETURN_TUPLE));
      return response.readSingleTuple();
    } finally {
      returnConnection();
    }

View Full Code Here

  /** {@inheritDoc} */
  @Override
  public Integer insertOrReplace(int space, Tuple tuple) {
    try {
      Response response = transport.execute(new Insert(id.incrementAndGet(), tuple.pack()).space(space));
      return response.getCount();
    } finally {
      returnConnection();
    }
  }
View Full Code Here

TOP

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

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.