Пример #1
0
 /* (non-Javadoc)
  * @see cn.com.rebirth.commons.io.stream.Streamable#readFrom(cn.com.rebirth.commons.io.stream.StreamInput)
  */
 @Override
 public void readFrom(StreamInput in) throws IOException {
   int version = in.readVInt();
   uid = new Term(in.readUTF(), in.readUTF());
   if (version >= 1) {
     this.version = in.readLong();
   }
 }
Пример #2
0
    /* (non-Javadoc)
     * @see cn.com.rebirth.commons.io.stream.Streamable#readFrom(cn.com.rebirth.commons.io.stream.StreamInput)
     */
    @Override
    public void readFrom(StreamInput in) throws IOException {
      int version = in.readVInt();
      source = in.readBytesReference();
      if (version < 2) {

        if (in.readBoolean()) {
          in.readUTF();
        }
      }
      int typesSize = in.readVInt();
      if (typesSize > 0) {
        types = new String[typesSize];
        for (int i = 0; i < typesSize; i++) {
          types[i] = in.readUTF();
        }
      }
      if (version >= 1) {
        int aliasesSize = in.readVInt();
        if (aliasesSize > 0) {
          filteringAliases = new String[aliasesSize];
          for (int i = 0; i < aliasesSize; i++) {
            filteringAliases[i] = in.readUTF();
          }
        }
      }
    }
 /* (non-Javadoc)
  * @see cn.com.rebirth.commons.io.stream.Streamable#readFrom(cn.com.rebirth.commons.io.stream.StreamInput)
  */
 @Override
 public void readFrom(StreamInput in) throws IOException {
   int size = in.readVInt();
   if (size == 0) {
     facets = ImmutableList.of();
     facetsAsMap = ImmutableMap.of();
   } else {
     facets = Lists.newArrayListWithCapacity(size);
     for (int i = 0; i < size; i++) {
       String type = in.readUTF();
       Facet facet = InternalFacet.Streams.stream(type).readFacet(type, in);
       facets.add(facet);
     }
   }
 }
 /* (non-Javadoc)
  * @see cn.com.rebirth.commons.io.stream.Streamable#readFrom(cn.com.rebirth.commons.io.stream.StreamInput)
  */
 @Override
 public void readFrom(StreamInput in) throws IOException {
   clusterName = ClusterName.readClusterName(in);
   nodes = new DiscoveryNode[in.readVInt()];
   for (int i = 0; i < nodes.length; i++) {
     nodes[i] = DiscoveryNode.readNode(in);
   }
 }
 /* (non-Javadoc)
  * @see cn.com.rebirth.commons.io.stream.Streamable#readFrom(cn.com.rebirth.commons.io.stream.StreamInput)
  */
 @Override
 public void readFrom(StreamInput in) throws IOException {
   acknowledged = in.readBoolean();
 }
Пример #6
0
 /* (non-Javadoc)
  * @see cn.com.rebirth.commons.io.stream.Streamable#readFrom(cn.com.rebirth.commons.io.stream.StreamInput)
  */
 @Override
 public void readFrom(StreamInput in) throws IOException {
   int version = in.readVInt();
   id = in.readUTF();
   type = in.readUTF();
   source = in.readBytesReference();
   if (version >= 1) {
     if (in.readBoolean()) {
       routing = in.readUTF();
     }
   }
   if (version >= 2) {
     if (in.readBoolean()) {
       parent = in.readUTF();
     }
   }
   if (version >= 3) {
     this.version = in.readLong();
   }
   if (version >= 4) {
     this.timestamp = in.readLong();
   }
   if (version >= 5) {
     this.ttl = in.readLong();
   }
 }