Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.apache.ignite.Ignition;
import org.apache.ignite.events.Event;
import org.apache.ignite.lang.IgnitePredicate;
import org.apache.ignite.yardstick.cache.model.SampleValue;
import org.yardstickframework.BenchmarkConfiguration;
import org.yardstickframework.BenchmarkDriverAdapter;
import org.yardstickframework.BenchmarkUtils;
Expand All @@ -48,6 +49,8 @@ public abstract class IgniteAbstractBenchmark extends BenchmarkDriverAdapter {

jcommander(cfg.commandLineArguments(), args, "<ignite-driver>");

SampleValue.sampleValueSize = cfg.valueSize();

if (Ignition.state() != IgniteState.STARTED) {
node = new IgniteNode(args.isClientOnly() && !args.isNearCache());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ public class SampleValue implements Externalizable, Binarylizable {
/** */
private int id;

public static int sampleValueSize=1001;
private byte[] value = new byte[sampleValueSize];

/** */
public SampleValue() {
// No-op.
Expand All @@ -59,24 +62,43 @@ public int getId() {
return id;
}

/**
* @param id value.
*/
public void setValue(byte[] value) {
this.value = value;
}

/**
* @return value.
*/
public byte[] getValue() {
return value;
}


/** {@inheritDoc} */
@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
id = in.readInt();
in.read(value);
}

/** {@inheritDoc} */
@Override public void writeExternal(ObjectOutput out) throws IOException {
out.writeInt(id);
out.write(value);
}

/** {@inheritDoc} */
@Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
writer.writeInt("id", id);
writer.writeByteArray("value", value);
}

/** {@inheritDoc} */
@Override public void readBinary(BinaryReader reader) throws BinaryObjectException {
id = reader.readInt("id");
value = reader.readByteArray("value");
}

/** {@inheritDoc} */
Expand Down