Package org.tarantool.core

Examples of org.tarantool.core.Tuple.pack()


      }
      stored = get(spaceNum, 0, new Tuple(1).setBytes(0, tuple.getBytes(0))).get(0);
    }

    if ((dmlRequest.getFlags() & Flags.RETURN_TUPLE) > 0) {
      byte[] responseBody = stored.pack();
      Response response = new Response(op, responseBody.length + 8, request.getId());
      response.setBody(ByteBuffer.allocate(responseBody.length + 8).order(ByteOrder.LITTLE_ENDIAN).putInt(1).putInt(responseBody.length)
          .put(responseBody).array());
      return response;
    } else {
View Full Code Here


    TupleSupport ts = new TupleSupport();
    SnapshotReader snapShotReader = new SnapshotReader(readableByteChannel);
    for (int i = 0; i < 10; i++) {
      Tuple tuple = ts.create(i, Long.parseLong("98765432" + i), "Hello world " + i + "!");
      Row row = snapShotReader.nextRow();
      Assert.assertTrue(Arrays.equals(tuple.pack(), row.data.pack()));
    }
    snapShotReader.close();
    Assert.assertTrue(closed.get());

  }
View Full Code Here

    TupleSupport ts = new TupleSupport();
    XLogReader xlogReader = new XLogReader(readableByteChannel);
    for (int i = 0; i < 10; i++) {
      Tuple tuple = ts.create(i, Long.parseLong("98765432" + i), "Hello world " + i + "!");
      XLogEntry entry = xlogReader.nextEntry();
      Assert.assertTrue(Arrays.equals(tuple.pack(), entry.tuple.pack()));
    }
    xlogReader.close();
    Assert.assertTrue(closed.get());

  }
View Full Code Here

      }
    }, "id", "phone", "point", "iq", "height", "lifeFormId", "salary", "birthday", "name", "sign", "male", "site");
    User user = new User();
    Tuple tuple = mapping.toTuple(user);
    User userCopy = mapping.fromTuple(tuple);
    assertArrayEquals(tuple.pack(), mapping.toTuple(userCopy).pack());
    assertEquals(user.getSite(), userCopy.getSite());
  }

  @org.tarantool.facade.annotation.Tuple(space = 0)
  public static class Tester {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.