public TAppend deepCopy() { return new TAppend(this); }
@Test public void testAppendWithReadOnly() throws Exception { ThriftHBaseServiceHandler handler = createHandler(); byte[] rowName = Bytes.toBytes("testAppend"); ByteBuffer table = wrap(tableAname); byte[] v1 = Bytes.toBytes("42"); List<TColumnValue> appendColumns = new ArrayList<>(1); appendColumns.add(new TColumnValue(wrap(familyAname), wrap(qualifierAname), wrap(v1))); TAppend append = new TAppend(wrap(rowName), appendColumns); boolean exceptionCaught = false; try { handler.append(table, append); } 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 testAppend() throws Exception { ThriftHBaseServiceHandler handler = createHandler(); byte[] rowName = Bytes.toBytes("testAppend"); ByteBuffer table = wrap(tableAname); byte[] v1 = Bytes.toBytes("42"); byte[] v2 = Bytes.toBytes("23"); List<TColumnValue> columnValues = new ArrayList<>(1); columnValues.add(new TColumnValue(wrap(familyAname), wrap(qualifierAname), wrap(v1))); TPut put = new TPut(wrap(rowName), columnValues); put.setColumnValues(columnValues); handler.put(table, put); List<TColumnValue> appendColumns = new ArrayList<>(1); appendColumns.add(new TColumnValue(wrap(familyAname), wrap(qualifierAname), wrap(v2))); TAppend append = new TAppend(wrap(rowName), appendColumns); handler.append(table, append); 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.add(v1, v2), columnValue.getValue()); }
public static TAppend appendFromHBase(Append in) throws IOException { TAppend out = new TAppend(); out.setRow(in.getRow());
public TAppend deepCopy() { return new TAppend(this); }
public TAppend deepCopy() { return new TAppend(this); }
appendColumns.add(new TColumnValue(wrap(familyAname), wrap(qualifierAname), wrap(v2))); TAppend append = new TAppend(wrap(rowName), appendColumns); append.setCellVisibility(new TCellVisibility().setExpression(SECRET)); handler.append(table, append);
/** * Performs a deep copy on <i>other</i>. */ public append_args(append_args other) { if (other.isSetTable()) { this.table = org.apache.thrift.TBaseHelper.copyBinary(other.table); } if (other.isSetAppend()) { this.append = new TAppend(other.append); } }
/** * Performs a deep copy on <i>other</i>. */ public append_args(append_args other) { if (other.isSetTable()) { this.table = org.apache.thrift.TBaseHelper.copyBinary(other.table); } if (other.isSetAppend()) { this.append = new TAppend(other.append); } }
case 2: // APPEND if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.append = new TAppend(); struct.append.read(iprot); struct.setAppendIsSet(true);
case 2: // APPEND if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.append = new TAppend(); struct.append.read(iprot); struct.setAppendIsSet(true);
@Override public void read(org.apache.thrift.protocol.TProtocol prot, append_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; struct.table = iprot.readBinary(); struct.setTableIsSet(true); struct.append = new TAppend(); struct.append.read(iprot); struct.setAppendIsSet(true); } }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, append_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; struct.table = iprot.readBinary(); struct.setTableIsSet(true); struct.append = new TAppend(); struct.append.read(iprot); struct.setAppendIsSet(true); } }
public TAppend deepCopy() { return new TAppend(this); }
public TAppend deepCopy() { return new TAppend(this); }
/** * Performs a deep copy on <i>other</i>. */ public append_args(append_args other) { if (other.isSetTable()) { this.table = org.apache.thrift.TBaseHelper.copyBinary(other.table); } if (other.isSetTappend()) { this.tappend = new TAppend(other.tappend); } }
/** * Performs a deep copy on <i>other</i>. */ public append_args(append_args other) { if (other.isSetTable()) { this.table = org.apache.thrift.TBaseHelper.copyBinary(other.table); } if (other.isSetTappend()) { this.tappend = new TAppend(other.tappend); } }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, append_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; struct.table = iprot.readBinary(); struct.setTableIsSet(true); struct.tappend = new TAppend(); struct.tappend.read(iprot); struct.setTappendIsSet(true); } }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, append_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; struct.table = iprot.readBinary(); struct.setTableIsSet(true); struct.tappend = new TAppend(); struct.tappend.read(iprot); struct.setTappendIsSet(true); } }
@Test public void testAppendWithReadOnly() throws Exception { ThriftHBaseServiceHandler handler = createHandler(); byte[] rowName = Bytes.toBytes("testAppend"); ByteBuffer table = wrap(tableAname); byte[] v1 = Bytes.toBytes("42"); List<TColumnValue> appendColumns = new ArrayList<>(1); appendColumns.add(new TColumnValue(wrap(familyAname), wrap(qualifierAname), wrap(v1))); TAppend append = new TAppend(wrap(rowName), appendColumns); boolean exceptionCaught = false; try { handler.append(table, append); } catch (TIOError e) { exceptionCaught = true; assertTrue(e.getCause() instanceof DoNotRetryIOException); assertEquals("Thrift Server is in Read-only mode.", e.getMessage()); } finally { assertTrue(exceptionCaught); } }