Exemple #1
0
 @Override
 public void writeObject(BufferOutput buffer, Serializer serializer) {
   buffer.writeByte(status.id());
   if (status == Response.Status.OK) {
     buffer.writeLong(term).writeBoolean(voted);
   } else {
     buffer.writeByte(error.id());
   }
 }
 @Override
 public void writeObject(BufferOutput<?> buffer, Serializer serializer) {
   buffer.writeByte(status.id());
   if (status == Status.OK) {
     buffer.writeLong(session);
     buffer.writeLong(timeout);
     serializer.writeObject(members, buffer);
   } else {
     buffer.writeByte(error.id());
   }
 }
Exemple #3
0
 @Override
 public void writeObject(BufferOutput<?> buffer, Serializer serializer) {
   buffer.writeByte(status.id());
   if (status == Status.ERROR) {
     if (error != null) {
       buffer.writeBoolean(true).writeByte(error.id());
     } else {
       buffer.writeBoolean(false);
     }
   }
   buffer.writeLong(version);
 }
 @Override
 public void write(Calendar calendar, BufferOutput buffer, Serializer serializer) {
   buffer.writeUTF8(calendar.getTimeZone().getID());
   buffer.writeLong(calendar.getTimeInMillis());
 }
Exemple #5
0
 @Override
 public void writeObject(BufferOutput<?> buffer, Serializer serializer) {
   super.writeObject(buffer, serializer);
   buffer.writeLong(ttl);
 }
Exemple #6
0
 @Override
 public void writeObject(BufferOutput<?> buffer, Serializer serializer) {
   buffer.writeLong(term).writeBoolean(tombstone);
 }
 @Override
 public void write(Float object, BufferOutput buffer, Serializer serializer) {
   buffer.writeFloat(object);
 }
Exemple #8
0
 @Override
 public void writeObject(BufferOutput<?> buffer, Serializer serializer) {
   buffer.writeLong(term).writeInt(candidate).writeLong(logIndex).writeLong(logTerm);
 }