Java Code Examples for org.apache.thrift.protocol.TTupleProtocol.writeI32()

The following are Jave code examples for showing how to use writeI32() of the org.apache.thrift.protocol.TTupleProtocol class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: ditb   File: Hbase.java   View Source Code Vote up 6 votes
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, get_result struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetSuccess()) {
    optionals.set(0);
  }
  if (struct.isSetIo()) {
    optionals.set(1);
  }
  oprot.writeBitSet(optionals, 2);
  if (struct.isSetSuccess()) {
    {
      oprot.writeI32(struct.success.size());
      for (TCell _iter98 : struct.success)
      {
        _iter98.write(oprot);
      }
    }
  }
  if (struct.isSetIo()) {
    struct.io.write(oprot);
  }
}
 
Example 2
Project: ditb   File: TAuthorization.java   View Source Code Vote up 6 votes
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, TAuthorization struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetLabels()) {
    optionals.set(0);
  }
  oprot.writeBitSet(optionals, 1);
  if (struct.isSetLabels()) {
    {
      oprot.writeI32(struct.labels.size());
      for (String _iter12 : struct.labels)
      {
        oprot.writeString(_iter12);
      }
    }
  }
}
 
Example 3
Project: ditb   File: BatchMutation.java   View Source Code Vote up 6 votes
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, BatchMutation struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetRow()) {
    optionals.set(0);
  }
  if (struct.isSetMutations()) {
    optionals.set(1);
  }
  oprot.writeBitSet(optionals, 2);
  if (struct.isSetRow()) {
    oprot.writeBinary(struct.row);
  }
  if (struct.isSetMutations()) {
    {
      oprot.writeI32(struct.mutations.size());
      for (Mutation _iter4 : struct.mutations)
      {
        _iter4.write(oprot);
      }
    }
  }
}
 
Example 4
Project: fresco_floodlight   File: Store.java   View Source Code Vote up 6 votes
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, Store struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  oprot.writeString(struct.storeName);
  BitSet optionals = new BitSet();
  if (struct.isSetScope()) {
    optionals.set(0);
  }
  if (struct.isSetPersist()) {
    optionals.set(1);
  }
  oprot.writeBitSet(optionals, 2);
  if (struct.isSetScope()) {
    oprot.writeI32(struct.scope.getValue());
  }
  if (struct.isSetPersist()) {
    oprot.writeBool(struct.persist);
  }
}
 
Example 5
Project: drift   File: scribe.java   View Source Code Vote up 6 votes
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, Log_args struct)
        throws TException
{
    TTupleProtocol oprot = (TTupleProtocol) prot;
    BitSet optionals = new BitSet();
    if (struct.isSetMessages()) {
        optionals.set(0);
    }
    oprot.writeBitSet(optionals, 1);
    if (struct.isSetMessages()) {
        {
            oprot.writeI32(struct.messages.size());
            for (LogEntry _iter4 : struct.messages) {
                _iter4.write(oprot);
            }
        }
    }
}
 
Example 6
Project: ditb   File: THBaseService.java   View Source Code Vote up 6 votes
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, getScannerResults_result struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetSuccess()) {
    optionals.set(0);
  }
  if (struct.isSetIo()) {
    optionals.set(1);
  }
  oprot.writeBitSet(optionals, 2);
  if (struct.isSetSuccess()) {
    {
      oprot.writeI32(struct.success.size());
      for (TResult _iter184 : struct.success)
      {
        _iter184.write(oprot);
      }
    }
  }
  if (struct.isSetIo()) {
    struct.io.write(oprot);
  }
}
 
Example 7
Project: fresco_floodlight   File: CursorResponseMessage.java   View Source Code Vote up 6 votes
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, CursorResponseMessage struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  struct.header.write(oprot);
  oprot.writeI32(struct.cursorId);
  BitSet optionals = new BitSet();
  if (struct.isSetValues()) {
    optionals.set(0);
  }
  oprot.writeBitSet(optionals, 1);
  if (struct.isSetValues()) {
    {
      oprot.writeI32(struct.values.size());
      for (KeyedValues _iter60 : struct.values)
      {
        _iter60.write(oprot);
      }
    }
  }
}
 
Example 8
Project: ditb   File: Hbase.java   View Source Code Vote up 6 votes
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, scannerOpenWithPrefix_result struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetSuccess()) {
    optionals.set(0);
  }
  if (struct.isSetIo()) {
    optionals.set(1);
  }
  oprot.writeBitSet(optionals, 2);
  if (struct.isSetSuccess()) {
    oprot.writeI32(struct.success);
  }
  if (struct.isSetIo()) {
    struct.io.write(oprot);
  }
}
 
Example 9
Project: ditb   File: TResult.java   View Source Code Vote up 6 votes
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, TResult struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  {
    oprot.writeI32(struct.columnValues.size());
    for (TColumnValue _iter4 : struct.columnValues)
    {
      _iter4.write(oprot);
    }
  }
  BitSet optionals = new BitSet();
  if (struct.isSetRow()) {
    optionals.set(0);
  }
  oprot.writeBitSet(optionals, 1);
  if (struct.isSetRow()) {
    oprot.writeBinary(struct.row);
  }
}
 
Example 10
Project: fresco_floodlight   File: SyncOfferMessage.java   View Source Code Vote up 6 votes
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, SyncOfferMessage struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  struct.header.write(oprot);
  struct.store.write(oprot);
  BitSet optionals = new BitSet();
  if (struct.isSetVersions()) {
    optionals.set(0);
  }
  oprot.writeBitSet(optionals, 1);
  if (struct.isSetVersions()) {
    {
      oprot.writeI32(struct.versions.size());
      for (KeyedVersions _iter44 : struct.versions)
      {
        _iter44.write(oprot);
      }
    }
  }
}
 
Example 11
Project: fresco_floodlight   File: PacketStreamer.java   View Source Code Vote up 6 votes
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, getPackets_result struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetSuccess()) {
    optionals.set(0);
  }
  oprot.writeBitSet(optionals, 1);
  if (struct.isSetSuccess()) {
    {
      oprot.writeI32(struct.success.size());
      for (ByteBuffer _iter12 : struct.success)
      {
        oprot.writeBinary(_iter12);
      }
    }
  }
}
 
Example 12
Project: fresco_floodlight   File: SyncValueMessage.java   View Source Code Vote up 6 votes
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, SyncValueMessage struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  struct.header.write(oprot);
  struct.store.write(oprot);
  BitSet optionals = new BitSet();
  if (struct.isSetValues()) {
    optionals.set(0);
  }
  if (struct.isSetResponseTo()) {
    optionals.set(1);
  }
  oprot.writeBitSet(optionals, 2);
  if (struct.isSetValues()) {
    {
      oprot.writeI32(struct.values.size());
      for (KeyedValues _iter36 : struct.values)
      {
        _iter36.write(oprot);
      }
    }
  }
  if (struct.isSetResponseTo()) {
    oprot.writeI32(struct.responseTo);
  }
}
 
Example 13
Project: iTAP-controller   File: ErrorMessage.java   View Source Code Vote up 6 votes
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, ErrorMessage struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  struct.header.write(oprot);
  BitSet optionals = new BitSet();
  if (struct.isSetError()) {
    optionals.set(0);
  }
  if (struct.isSetType()) {
    optionals.set(1);
  }
  oprot.writeBitSet(optionals, 2);
  if (struct.isSetError()) {
    struct.error.write(oprot);
  }
  if (struct.isSetType()) {
    oprot.writeI32(struct.type.getValue());
  }
}
 
Example 14
Project: iTAP-controller   File: SyncOfferMessage.java   View Source Code Vote up 6 votes
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, SyncOfferMessage struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  struct.header.write(oprot);
  struct.store.write(oprot);
  BitSet optionals = new BitSet();
  if (struct.isSetVersions()) {
    optionals.set(0);
  }
  oprot.writeBitSet(optionals, 1);
  if (struct.isSetVersions()) {
    {
      oprot.writeI32(struct.versions.size());
      for (KeyedVersions _iter44 : struct.versions)
      {
        _iter44.write(oprot);
      }
    }
  }
}
 
Example 15
Project: ditb   File: Hbase.java   View Source Code Vote up 5 votes
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, getRows_args struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetTableName()) {
    optionals.set(0);
  }
  if (struct.isSetRows()) {
    optionals.set(1);
  }
  if (struct.isSetAttributes()) {
    optionals.set(2);
  }
  oprot.writeBitSet(optionals, 3);
  if (struct.isSetTableName()) {
    oprot.writeBinary(struct.tableName);
  }
  if (struct.isSetRows()) {
    {
      oprot.writeI32(struct.rows.size());
      for (ByteBuffer _iter235 : struct.rows)
      {
        oprot.writeBinary(_iter235);
      }
    }
  }
  if (struct.isSetAttributes()) {
    {
      oprot.writeI32(struct.attributes.size());
      for (Map.Entry<ByteBuffer, ByteBuffer> _iter236 : struct.attributes.entrySet())
      {
        oprot.writeBinary(_iter236.getKey());
        oprot.writeBinary(_iter236.getValue());
      }
    }
  }
}
 
Example 16
Project: grift   File: Message.java   View Source Code Vote up 5 votes
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, Message struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetI()) {
    optionals.set(0);
  }
  if (struct.isSetB()) {
    optionals.set(1);
  }
  if (struct.isSetS()) {
    optionals.set(2);
  }
  if (struct.isSetL()) {
    optionals.set(3);
  }
  oprot.writeBitSet(optionals, 4);
  if (struct.isSetI()) {
    oprot.writeI32(struct.i);
  }
  if (struct.isSetB()) {
    oprot.writeBool(struct.b);
  }
  if (struct.isSetS()) {
    oprot.writeString(struct.s);
  }
  if (struct.isSetL()) {
    {
      oprot.writeI32(struct.l.size());
      for (int _iter4 : struct.l)
      {
        oprot.writeI32(_iter4);
      }
    }
  }
}
 
Example 17
Project: ditb   File: THBaseService.java   View Source Code Vote up 5 votes
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, getScannerRows_result struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetSuccess()) {
    optionals.set(0);
  }
  if (struct.isSetIo()) {
    optionals.set(1);
  }
  if (struct.isSetIa()) {
    optionals.set(2);
  }
  oprot.writeBitSet(optionals, 3);
  if (struct.isSetSuccess()) {
    {
      oprot.writeI32(struct.success.size());
      for (TResult _iter176 : struct.success)
      {
        _iter176.write(oprot);
      }
    }
  }
  if (struct.isSetIo()) {
    struct.io.write(oprot);
  }
  if (struct.isSetIa()) {
    struct.ia.write(oprot);
  }
}
 
Example 18
Project: ditb   File: Hbase.java   View Source Code Vote up 5 votes
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, scannerGet_result struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetSuccess()) {
    optionals.set(0);
  }
  if (struct.isSetIo()) {
    optionals.set(1);
  }
  if (struct.isSetIa()) {
    optionals.set(2);
  }
  oprot.writeBitSet(optionals, 3);
  if (struct.isSetSuccess()) {
    {
      oprot.writeI32(struct.success.size());
      for (TRowResult _iter570 : struct.success)
      {
        _iter570.write(oprot);
      }
    }
  }
  if (struct.isSetIo()) {
    struct.io.write(oprot);
  }
  if (struct.isSetIa()) {
    struct.ia.write(oprot);
  }
}
 
Example 19
Project: ditb   File: Hbase.java   View Source Code Vote up 4 votes
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, getRowsWithColumns_args struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetTableName()) {
    optionals.set(0);
  }
  if (struct.isSetRows()) {
    optionals.set(1);
  }
  if (struct.isSetColumns()) {
    optionals.set(2);
  }
  if (struct.isSetAttributes()) {
    optionals.set(3);
  }
  oprot.writeBitSet(optionals, 4);
  if (struct.isSetTableName()) {
    oprot.writeBinary(struct.tableName);
  }
  if (struct.isSetRows()) {
    {
      oprot.writeI32(struct.rows.size());
      for (ByteBuffer _iter265 : struct.rows)
      {
        oprot.writeBinary(_iter265);
      }
    }
  }
  if (struct.isSetColumns()) {
    {
      oprot.writeI32(struct.columns.size());
      for (ByteBuffer _iter266 : struct.columns)
      {
        oprot.writeBinary(_iter266);
      }
    }
  }
  if (struct.isSetAttributes()) {
    {
      oprot.writeI32(struct.attributes.size());
      for (Map.Entry<ByteBuffer, ByteBuffer> _iter267 : struct.attributes.entrySet())
      {
        oprot.writeBinary(_iter267.getKey());
        oprot.writeBinary(_iter267.getValue());
      }
    }
  }
}
 
Example 20
Project: ditb   File: Hbase.java   View Source Code Vote up 4 votes
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, scannerOpenTs_args struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetTableName()) {
    optionals.set(0);
  }
  if (struct.isSetStartRow()) {
    optionals.set(1);
  }
  if (struct.isSetColumns()) {
    optionals.set(2);
  }
  if (struct.isSetTimestamp()) {
    optionals.set(3);
  }
  if (struct.isSetAttributes()) {
    optionals.set(4);
  }
  oprot.writeBitSet(optionals, 5);
  if (struct.isSetTableName()) {
    oprot.writeBinary(struct.tableName);
  }
  if (struct.isSetStartRow()) {
    oprot.writeBinary(struct.startRow);
  }
  if (struct.isSetColumns()) {
    {
      oprot.writeI32(struct.columns.size());
      for (ByteBuffer _iter539 : struct.columns)
      {
        oprot.writeBinary(_iter539);
      }
    }
  }
  if (struct.isSetTimestamp()) {
    oprot.writeI64(struct.timestamp);
  }
  if (struct.isSetAttributes()) {
    {
      oprot.writeI32(struct.attributes.size());
      for (Map.Entry<ByteBuffer, ByteBuffer> _iter540 : struct.attributes.entrySet())
      {
        oprot.writeBinary(_iter540.getKey());
        oprot.writeBinary(_iter540.getValue());
      }
    }
  }
}