@Test public void createRecordTest() throws Exception { DirectTupleSchema schema = TupleSchema.builder(). addField("aByte", Byte.TYPE). addField("aChar", Character.TYPE). addField("aInt", Integer.TYPE). addField("aShort", Short.TYPE). addField("aFloat", Float.TYPE). addField("aLong", Long.TYPE). addField("aDouble", Double.TYPE). directMemory(). build(); long record = schema.createRecord(); schema.setByte(record, 0, (byte)6); schema.setChar(record, 1, (char)8); schema.setInt(record, 2, 50010); schema.setShort(record, 3, (short)2500); schema.setFloat(record, 4, 0.1f); schema.setLong(record, 5, 100000l); schema.setDouble(record, 6, 0.59403); assertEquals(6, schema.getByte(record, 0)); assertEquals(8, schema.getChar(record, 1)); assertEquals(50010, schema.getInt(record, 2)); assertEquals(2500, schema.getShort(record, 3)); assertEquals(0.1, schema.getFloat(record, 4), 0.00001); assertEquals(100000l, schema.getLong(record, 5)); assertEquals(0.59403, schema.getDouble(record, 6), 0.00001); }
public long createRecord() { return unsafe.allocateMemory(byteSize); }
DirectTupleSchema extends TupleSchema { public long createRecord() { return unsafe.allocateMemory(byteSize); } }
DirectTupleSchema extends TupleSchema { public long createRecord() { return unsafe.allocateMemory(byteSize); } DirectTupleSchema(Builder builder); }
DirectTupleSchema extends TupleSchema { public long createRecord() { return unsafe.allocateMemory(byteSize); } DirectTupleSchema(Builder builder); long getLong(long address, int index); int getInt(long address, int index); short getShort(long address, int index); char getChar(long address, int index); byte getByte(long address, int index); double getDouble(long address, int index); float getFloat(long address, int index); void setLong(long address, int index, long value); void setInt(long address, int index, int value); void setShort(long address, int index, short value); void setChar(long address, int index, char value); void setByte(long address, int index, byte value); void setFloat(long address, int index, float value); void setDouble(long address, int index, double value); int[] getLayout(); int getByteSize(); FastTuple createTuple(long address); long createRecord(); long createRecordArray(long size); FastTuple createTuple(); @Override FastTuple[] createTupleArray(int size); @Override void destroyTuple(FastTuple tuple); @Override void destroyTupleArray(FastTuple[] ary); void destroy(FastTuple tuple); void destroy(long address); }
DirectTupleSchema extends TupleSchema { public long createRecord() { return unsafe.allocateMemory(byteSize); } DirectTupleSchema(Builder builder); long getLong(long address, int index); int getInt(long address, int index); short getShort(long address, int index); char getChar(long address, int index); byte getByte(long address, int index); double getDouble(long address, int index); float getFloat(long address, int index); void setLong(long address, int index, long value); void setInt(long address, int index, int value); void setShort(long address, int index, short value); void setChar(long address, int index, char value); void setByte(long address, int index, byte value); void setFloat(long address, int index, float value); void setDouble(long address, int index, double value); int[] getLayout(); int getByteSize(); FastTuple createTuple(long address); long createRecord(); long createRecordArray(long size); FastTuple createTuple(); @Override FastTuple[] createTupleArray(int size); @Override void destroyTuple(FastTuple tuple); @Override void destroyTupleArray(FastTuple[] ary); void destroy(FastTuple tuple); void destroy(long address);  }