use of org.apache.ignite.internal.schema.row.RowAssembler in project ignite-3 by apache.
the class RecordMarshallerImpl method marshalKey.
/**
* {@inheritDoc}
*/
@Override
public BinaryRow marshalKey(@NotNull R rec) throws MarshallerException {
assert recClass.isInstance(rec);
final RowAssembler asm = createAssembler(Objects.requireNonNull(rec), null);
keyMarsh.writeObject(rec, asm);
return new ByteBufferRow(asm.toBytes());
}
use of org.apache.ignite.internal.schema.row.RowAssembler in project ignite-3 by apache.
the class PartitionCommandListenerTest method getTestRow.
/**
* Prepares a test row which contains key and value fields.
*
* @return Row.
*/
@NotNull
private Row getTestRow(int key, int val) {
RowAssembler rowBuilder = new RowAssembler(SCHEMA, 0, 0);
rowBuilder.appendInt(key);
rowBuilder.appendInt(val);
return new Row(SCHEMA, rowBuilder.build());
}
use of org.apache.ignite.internal.schema.row.RowAssembler in project ignite-3 by apache.
the class KvMarshallerImpl method marshal.
/**
* {@inheritDoc}
*/
@Override
public BinaryRow marshal(@NotNull K key, V val) throws MarshallerException {
assert keyClass.isInstance(key);
assert val == null || valClass.isInstance(val);
final RowAssembler asm = createAssembler(key, val);
keyMarsh.writeObject(key, asm);
valMarsh.writeObject(val, asm);
return new ByteBufferRow(asm.toBytes());
}
use of org.apache.ignite.internal.schema.row.RowAssembler in project ignite-3 by apache.
the class RecordMarshallerImpl method marshal.
/**
* {@inheritDoc}
*/
@Override
public BinaryRow marshal(@NotNull R rec) throws MarshallerException {
assert recClass.isInstance(rec);
final RowAssembler asm = createAssembler(Objects.requireNonNull(rec), rec);
recMarsh.writeObject(rec, asm);
return new ByteBufferRow(asm.toBytes());
}
use of org.apache.ignite.internal.schema.row.RowAssembler in project ignite-3 by apache.
the class PartitionCommandListenerTest method getTestKey.
/**
* Prepares a test row which contains only key field.
*
* @return Row.
*/
@NotNull
private Row getTestKey(int key) {
RowAssembler rowBuilder = new RowAssembler(SCHEMA, 0, 0);
rowBuilder.appendInt(key);
return new Row(SCHEMA, rowBuilder.build());
}
Aggregations