public TColumnIncrement deepCopy() { return new TColumnIncrement(this); }
/** * Performs a deep copy on <i>other</i>. */ public TIncrement(TIncrement other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetRow()) { this.row = org.apache.thrift.TBaseHelper.copyBinary(other.row); } if (other.isSetColumns()) { java.util.List<TColumnIncrement> __this__columns = new java.util.ArrayList<TColumnIncrement>(other.columns.size()); for (TColumnIncrement other_element : other.columns) { __this__columns.add(new TColumnIncrement(other_element)); } this.columns = __this__columns; } if (other.isSetAttributes()) { java.util.Map<java.nio.ByteBuffer,java.nio.ByteBuffer> __this__attributes = new java.util.HashMap<java.nio.ByteBuffer,java.nio.ByteBuffer>(other.attributes); this.attributes = __this__attributes; } if (other.isSetDurability()) { this.durability = other.durability; } if (other.isSetCellVisibility()) { this.cellVisibility = new TCellVisibility(other.cellVisibility); } this.returnResults = other.returnResults; }
for (int _i72 = 0; _i72 < _list70.size; ++_i72) _elem71 = new TColumnIncrement(); _elem71.read(iprot); struct.columns.add(_elem71);
byte[] family = entry.getKey(); for (Cell cell : entry.getValue()) { TColumnIncrement columnValue = new TColumnIncrement(); columnValue.setFamily(family).setQualifier(CellUtil.cloneQualifier(cell)); columnValue.setAmount(
@Test public void testIncrementWithReadOnly() throws Exception { ThriftHBaseServiceHandler handler = createHandler(); byte[] rowName = Bytes.toBytes("testIncrement"); ByteBuffer table = wrap(tableAname); List<TColumnIncrement> incrementColumns = new ArrayList<>(1); incrementColumns.add(new TColumnIncrement(wrap(familyAname), wrap(qualifierAname))); TIncrement increment = new TIncrement(wrap(rowName), incrementColumns); boolean exceptionCaught = false; try { handler.increment(table, increment); } catch (TIOError e) { exceptionCaught = true; assertTrue(e.getCause() instanceof DoNotRetryIOException); assertEquals("Thrift Server is in Read-only mode.", e.getMessage()); } finally { assertTrue(exceptionCaught); } }
@Test public void testIncrement() throws Exception { ThriftHBaseServiceHandler handler = createHandler(); byte[] rowName = Bytes.toBytes("testIncrement"); ByteBuffer table = wrap(tableAname); List<TColumnValue> columnValues = new ArrayList<>(1); columnValues.add(new TColumnValue(wrap(familyAname), wrap(qualifierAname), wrap(Bytes.toBytes(1L)))); TPut put = new TPut(wrap(rowName), columnValues); put.setColumnValues(columnValues); handler.put(table, put); List<TColumnIncrement> incrementColumns = new ArrayList<>(1); incrementColumns.add(new TColumnIncrement(wrap(familyAname), wrap(qualifierAname))); TIncrement increment = new TIncrement(wrap(rowName), incrementColumns); handler.increment(table, increment); TGet get = new TGet(wrap(rowName)); TResult result = handler.get(table, get); assertArrayEquals(rowName, result.getRow()); assertEquals(1, result.getColumnValuesSize()); TColumnValue columnValue = result.getColumnValues().get(0); assertArrayEquals(Bytes.toBytes(2L), columnValue.getValue()); }
for (int _i83 = 0; _i83 < _list81.size; ++_i83) _elem82 = new TColumnIncrement(); _elem82.read(iprot); struct.columns.add(_elem82);
@Test public void testIncrementWithTagsWithNotMatchLabels() throws Exception { ThriftHBaseServiceHandler handler = createHandler(); byte[] rowName = Bytes.toBytes("testIncrementWithTagsWithNotMatchLabels"); ByteBuffer table = wrap(tableAname); List<TColumnValue> columnValues = new ArrayList<>(1); columnValues.add(new TColumnValue(wrap(familyAname), wrap(qualifierAname), wrap(Bytes.toBytes(1L)))); TPut put = new TPut(wrap(rowName), columnValues); put.setColumnValues(columnValues); put.setCellVisibility(new TCellVisibility().setExpression(PRIVATE)); handler.put(table, put); List<TColumnIncrement> incrementColumns = new ArrayList<>(1); incrementColumns.add(new TColumnIncrement(wrap(familyAname), wrap(qualifierAname))); TIncrement increment = new TIncrement(wrap(rowName), incrementColumns); increment.setCellVisibility(new TCellVisibility().setExpression(SECRET)); handler.increment(table, increment); TGet get = new TGet(wrap(rowName)); TAuthorization tauth = new TAuthorization(); List<String> labels = new ArrayList<>(1); labels.add(PUBLIC); tauth.setLabels(labels); get.setAuthorizations(tauth); TResult result = handler.get(table, get); assertNull(result.getRow()); }
public TColumnIncrement deepCopy() { return new TColumnIncrement(this); }
@Test public void testIncrementWithTags() throws Exception { ThriftHBaseServiceHandler handler = createHandler(); byte[] rowName = Bytes.toBytes("testIncrementWithTags"); ByteBuffer table = wrap(tableAname); List<TColumnValue> columnValues = new ArrayList<>(1); columnValues.add(new TColumnValue(wrap(familyAname), wrap(qualifierAname), wrap(Bytes.toBytes(1L)))); TPut put = new TPut(wrap(rowName), columnValues); put.setColumnValues(columnValues); put.setCellVisibility(new TCellVisibility().setExpression(PRIVATE)); handler.put(table, put); List<TColumnIncrement> incrementColumns = new ArrayList<>(1); incrementColumns.add(new TColumnIncrement(wrap(familyAname), wrap(qualifierAname))); TIncrement increment = new TIncrement(wrap(rowName), incrementColumns); increment.setCellVisibility(new TCellVisibility().setExpression(SECRET)); handler.increment(table, increment); TGet get = new TGet(wrap(rowName)); TAuthorization tauth = new TAuthorization(); List<String> labels = new ArrayList<>(1); labels.add(SECRET); tauth.setLabels(labels); get.setAuthorizations(tauth); TResult result = handler.get(table, get); assertArrayEquals(rowName, result.getRow()); assertEquals(1, result.getColumnValuesSize()); TColumnValue columnValue = result.getColumnValues().get(0); assertArrayEquals(Bytes.toBytes(2L), columnValue.getValue()); }
incrementColumns.add(new TColumnIncrement(wrap(familyAname), wrap(qualifierAname))); TIncrement tIncrement = new TIncrement(wrap(rowName), incrementColumns); tIncrement.setAttributes(attributes);
public TColumnIncrement deepCopy() { return new TColumnIncrement(this); }
incrementColumns.add(new TColumnIncrement(wrap(familyAname), wrap(qualifierAname)));
/** * Performs a deep copy on <i>other</i>. */ public TIncrement(TIncrement other) { if (other.isSetRow()) { this.row = org.apache.thrift.TBaseHelper.copyBinary(other.row); } if (other.isSetColumns()) { List<TColumnIncrement> __this__columns = new ArrayList<TColumnIncrement>(other.columns.size()); for (TColumnIncrement other_element : other.columns) { __this__columns.add(new TColumnIncrement(other_element)); } this.columns = __this__columns; } if (other.isSetAttributes()) { Map<ByteBuffer,ByteBuffer> __this__attributes = new HashMap<ByteBuffer,ByteBuffer>(other.attributes); this.attributes = __this__attributes; } if (other.isSetDurability()) { this.durability = other.durability; } if (other.isSetCellVisibility()) { this.cellVisibility = new TCellVisibility(other.cellVisibility); } }
/** * Performs a deep copy on <i>other</i>. */ public TIncrement(TIncrement other) { if (other.isSetRow()) { this.row = org.apache.thrift.TBaseHelper.copyBinary(other.row); } if (other.isSetColumns()) { List<TColumnIncrement> __this__columns = new ArrayList<TColumnIncrement>(other.columns.size()); for (TColumnIncrement other_element : other.columns) { __this__columns.add(new TColumnIncrement(other_element)); } this.columns = __this__columns; } if (other.isSetAttributes()) { Map<ByteBuffer,ByteBuffer> __this__attributes = new HashMap<ByteBuffer,ByteBuffer>(other.attributes); this.attributes = __this__attributes; } if (other.isSetDurability()) { this.durability = other.durability; } if (other.isSetCellVisibility()) { this.cellVisibility = new TCellVisibility(other.cellVisibility); } }
for (int _i72 = 0; _i72 < _list70.size; ++_i72) _elem71 = new TColumnIncrement(); _elem71.read(iprot); struct.columns.add(_elem71);
for (int _i72 = 0; _i72 < _list70.size; ++_i72) _elem71 = new TColumnIncrement(); _elem71.read(iprot); struct.columns.add(_elem71);
for (int _i83 = 0; _i83 < _list81.size; ++_i83) _elem82 = new TColumnIncrement(); _elem82.read(iprot); struct.columns.add(_elem82);
for (int _i83 = 0; _i83 < _list81.size; ++_i83) _elem82 = new TColumnIncrement(); _elem82.read(iprot); struct.columns.add(_elem82);
public TColumnIncrement deepCopy() { return new TColumnIncrement(this); }