Example #1
0
 /* (non-Javadoc)
  * @see cn.com.rebirth.commons.io.stream.Streamable#writeTo(cn.com.rebirth.commons.io.stream.StreamOutput)
  */
 @Override
 public void writeTo(StreamOutput out) throws IOException {
   out.writeVInt(1);
   out.writeUTF(uid.field());
   out.writeUTF(uid.text());
   out.writeLong(version);
 }
 /* (non-Javadoc)
  * @see cn.com.rebirth.commons.io.stream.Streamable#writeTo(cn.com.rebirth.commons.io.stream.StreamOutput)
  */
 @Override
 public void writeTo(StreamOutput out) throws IOException {
   out.writeVInt(facets.size());
   for (Facet facet : facets) {
     InternalFacet internalFacet = (InternalFacet) facet;
     out.writeUTF(internalFacet.streamType());
     internalFacet.writeTo(out);
   }
 }
 /* (non-Javadoc)
  * @see cn.com.rebirth.commons.io.stream.Streamable#writeTo(cn.com.rebirth.commons.io.stream.StreamOutput)
  */
 @Override
 public void writeTo(StreamOutput out) throws IOException {
   clusterName.writeTo(out);
   out.writeVInt(nodes.length);
   for (DiscoveryNode node : nodes) {
     node.writeTo(out);
   }
 }
Example #4
0
 /* (non-Javadoc)
  * @see cn.com.rebirth.commons.io.stream.Streamable#writeTo(cn.com.rebirth.commons.io.stream.StreamOutput)
  */
 @Override
 public void writeTo(StreamOutput out) throws IOException {
   out.writeVInt(2);
   out.writeBytesHolder(source);
   out.writeVInt(types.length);
   for (String type : types) {
     out.writeUTF(type);
   }
   if (filteringAliases != null) {
     out.writeVInt(filteringAliases.length);
     for (String alias : filteringAliases) {
       out.writeUTF(alias);
     }
   } else {
     out.writeVInt(0);
   }
 }
 /* (non-Javadoc)
  * @see cn.com.rebirth.commons.io.stream.Streamable#writeTo(cn.com.rebirth.commons.io.stream.StreamOutput)
  */
 @Override
 public void writeTo(StreamOutput out) throws IOException {
   out.writeBoolean(acknowledged);
 }
Example #6
0
 /* (non-Javadoc)
  * @see cn.com.rebirth.commons.io.stream.Streamable#writeTo(cn.com.rebirth.commons.io.stream.StreamOutput)
  */
 @Override
 public void writeTo(StreamOutput out) throws IOException {
   out.writeVInt(5);
   out.writeUTF(id);
   out.writeUTF(type);
   out.writeBytesHolder(source);
   if (routing == null) {
     out.writeBoolean(false);
   } else {
     out.writeBoolean(true);
     out.writeUTF(routing);
   }
   if (parent == null) {
     out.writeBoolean(false);
   } else {
     out.writeBoolean(true);
     out.writeUTF(parent);
   }
   out.writeLong(version);
   out.writeLong(timestamp);
   out.writeLong(ttl);
 }