public BatchMutation deepCopy() { return new BatchMutation(this); }
@Override public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof BatchMutation) return this.equals((BatchMutation)that); return false; }
@org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case ROW: return getRow(); case MUTATIONS: return getMutations(); } throw new java.lang.IllegalStateException(); }
@Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((isSetRow()) ? 131071 : 524287); if (isSetRow()) hashCode = hashCode * 8191 + row.hashCode(); hashCode = hashCode * 8191 + ((isSetMutations()) ? 131071 : 524287); if (isSetMutations()) hashCode = hashCode * 8191 + mutations.hashCode(); return hashCode; }
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case ROW: if (value == null) { unsetRow(); } else { if (value instanceof byte[]) { setRow((byte[])value); } else { setRow((java.nio.ByteBuffer)value); } } break; case MUTATIONS: if (value == null) { unsetMutations(); } else { setMutations((java.util.List<Mutation>)value); } break; } }
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.row = iprot.readBinary(); struct.setRowIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); struct.setMutationsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); struct.validate();
@Override public void read(org.apache.thrift.protocol.TProtocol prot, BatchMutation struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.row = iprot.readBinary(); struct.setRowIsSet(true); } if (incoming.get(1)) { { org.apache.thrift.protocol.TList _list5 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); struct.mutations = new java.util.ArrayList<Mutation>(_list5.size); @org.apache.thrift.annotation.Nullable Mutation _elem6; for (int _i7 = 0; _i7 < _list5.size; ++_i7) { _elem6 = new Mutation(); _elem6.read(iprot); struct.mutations.add(_elem6); } } struct.setMutationsIsSet(true); } } }
public byte[] getRow() { setRow(org.apache.thrift.TBaseHelper.rightSize(row)); return row == null ? null : row.array(); }
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } }
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new java.lang.IllegalArgumentException(); } switch (field) { case ROW: return isSetRow(); case MUTATIONS: return isSetMutations(); } throw new java.lang.IllegalStateException(); }
public void setFieldValue(_Fields field, Object value) { switch (field) { case ROW: if (value == null) { unsetRow(); } else { setRow((ByteBuffer)value); } break; case MUTATIONS: if (value == null) { unsetMutations(); } else { setMutations((List<Mutation>)value); } break; } }
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.row = iprot.readBinary(); struct.setRowIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); struct.setMutationsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); struct.validate();
@Override public void read(org.apache.thrift.protocol.TProtocol prot, BatchMutation struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.row = iprot.readBinary(); struct.setRowIsSet(true); } if (incoming.get(1)) { { org.apache.thrift.protocol.TList _list5 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); struct.mutations = new ArrayList<Mutation>(_list5.size); Mutation _elem6; for (int _i7 = 0; _i7 < _list5.size; ++_i7) { _elem6 = new Mutation(); _elem6.read(iprot); struct.mutations.add(_elem6); } } struct.setMutationsIsSet(true); } } }
public byte[] getRow() { setRow(org.apache.thrift.TBaseHelper.rightSize(row)); return row == null ? null : row.array(); }
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } }
public boolean equals(BatchMutation that) { if (that == null) return false; if (this == that) return true; boolean this_present_row = true && this.isSetRow(); boolean that_present_row = true && that.isSetRow(); if (this_present_row || that_present_row) { if (!(this_present_row && that_present_row)) return false; if (!this.row.equals(that.row)) return false; } boolean this_present_mutations = true && this.isSetMutations(); boolean that_present_mutations = true && that.isSetMutations(); if (this_present_mutations || that_present_mutations) { if (!(this_present_mutations && that_present_mutations)) return false; if (!this.mutations.equals(that.mutations)) return false; } return true; }
public void setFieldValue(_Fields field, Object value) { switch (field) { case ROW: if (value == null) { unsetRow(); } else { setRow((ByteBuffer)value); } break; case MUTATIONS: if (value == null) { unsetMutations(); } else { setMutations((List<Mutation>)value); } break; } }
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.row = iprot.readBinary(); struct.setRowIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); struct.setMutationsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); struct.validate();
/** * @return a List of BatchMutations with the following effects: * (rowA, columnA): delete * (rowA, columnB): place valueC * (rowB, columnA): place valueC * (rowB, columnB): place valueD */ private static List<BatchMutation> getBatchMutations() { List<BatchMutation> batchMutations = new ArrayList<>(3); // Mutations to rowA. You can't mix delete and put anymore. List<Mutation> rowAmutations = new ArrayList<>(1); rowAmutations.add(new Mutation(true, columnAname, null, true)); batchMutations.add(new BatchMutation(rowAname, rowAmutations)); rowAmutations = new ArrayList<>(1); rowAmutations.add(new Mutation(false, columnBname, valueCname, true)); batchMutations.add(new BatchMutation(rowAname, rowAmutations)); // Mutations to rowB List<Mutation> rowBmutations = new ArrayList<>(2); rowBmutations.add(new Mutation(false, columnAname, valueCname, true)); rowBmutations.add(new Mutation(false, columnBname, valueDname, true)); batchMutations.add(new BatchMutation(rowBname, rowBmutations)); return batchMutations; }
public Object getFieldValue(_Fields field) { switch (field) { case ROW: return getRow(); case MUTATIONS: return getMutations(); } throw new IllegalStateException(); }