Skip to content

Commit

Permalink
ignite-nio - Removing message clone
Browse files Browse the repository at this point in the history
  • Loading branch information
Valentin Kulichenko committed Feb 15, 2015
1 parent 3a05bf1 commit af8edc0
Show file tree
Hide file tree
Showing 93 changed files with 1,194 additions and 1,599 deletions.
Expand Up @@ -414,7 +414,7 @@ private void start(Collection<String> code, @Nullable String superMtd, boolean w

indent++;

returnFalseIfFailed(code, "writer.writeByte", "null", "directType()");
returnFalseIfFailed(code, "writer.writeMessageType", "directType()");

code.add(EMPTY);
code.add(builder().a("writer.onTypeWritten();").toString());
Expand Down
Expand Up @@ -114,27 +114,27 @@ public boolean system() {
writer.setBuffer(buf);

if (!writer.isTypeWritten()) {
if (!writer.writeByte(null, directType()))
if (!writer.writeMessageType(directType()))
return false;

writer.onTypeWritten();
}

switch (writer.state()) {
case 0:
if (!writer.writeIgniteUuid("jobId", jobId))
if (!writer.writeField("jobId", jobId, MessageFieldType.IGNITE_UUID))
return false;

writer.incrementState();

case 1:
if (!writer.writeIgniteUuid("sesId", sesId))
if (!writer.writeField("sesId", sesId, MessageFieldType.IGNITE_UUID))
return false;

writer.incrementState();

case 2:
if (!writer.writeBoolean("sys", sys))
if (!writer.writeField("sys", sys, MessageFieldType.BOOLEAN))
return false;

writer.incrementState();
Expand All @@ -150,23 +150,23 @@ public boolean system() {

switch (readState) {
case 0:
jobId = reader.readIgniteUuid("jobId");
jobId = reader.readField("jobId", MessageFieldType.IGNITE_UUID);

if (!reader.isLastRead())
return false;

readState++;

case 1:
sesId = reader.readIgniteUuid("sesId");
sesId = reader.readField("sesId", MessageFieldType.IGNITE_UUID);

if (!reader.isLastRead())
return false;

readState++;

case 2:
sys = reader.readBoolean("sys");
sys = reader.readField("sys", MessageFieldType.BOOLEAN);

if (!reader.isLastRead())
return false;
Expand Down

0 comments on commit af8edc0

Please sign in to comment.