/** * Test that we add and remove strings from settings properly. * @throws Exception */ @Test public void testRemoveString() throws Exception { byte[] key = Bytes.toBytes("Some"); byte[] value = Bytes.toBytes("value"); TableDescriptor desc = TableDescriptorBuilder.newBuilder(TableName.valueOf(name.getMethodName())) .setValue(key, value) .build(); assertTrue(Bytes.equals(value, desc.getValue(key))); desc = TableDescriptorBuilder.newBuilder(desc) .removeValue(key) .build(); assertTrue(desc.getValue(key) == null); }
private void setTransactional(byte[] physicalTableName, TableDescriptorBuilder tableDescriptorBuilder, PTableType tableType, String txValue, Map<String, Object> tableProps) throws SQLException { if (txValue == null) { tableDescriptorBuilder.removeValue(Bytes.toBytes(PhoenixTransactionContext.READ_NON_TX_DATA)); } else { tableDescriptorBuilder.setValue(PhoenixTransactionContext.READ_NON_TX_DATA, txValue); } this.addCoprocessors(physicalTableName, tableDescriptorBuilder, tableType, tableProps); }
/** * Test that we add and remove strings from settings properly. * @throws Exception */ @Test public void testRemoveString() throws Exception { byte[] key = Bytes.toBytes("Some"); byte[] value = Bytes.toBytes("value"); TableDescriptor desc = TableDescriptorBuilder.newBuilder(TableName.valueOf(name.getMethodName())) .setValue(key, value) .build(); assertTrue(Bytes.equals(value, desc.getValue(key))); desc = TableDescriptorBuilder.newBuilder(desc) .removeValue(key) .build(); assertTrue(desc.getValue(key) == null); }
private void setTransactional(byte[] physicalTableName, TableDescriptorBuilder tableDescriptorBuilder, PTableType tableType, String txValue, Map<String, Object> tableProps) throws SQLException { if (txValue == null) { tableDescriptorBuilder.removeValue(Bytes.toBytes(PhoenixTransactionContext.READ_NON_TX_DATA)); } else { tableDescriptorBuilder.setValue(PhoenixTransactionContext.READ_NON_TX_DATA, txValue); } this.addCoprocessors(physicalTableName, tableDescriptorBuilder, tableType, tableProps); }
private void setTransactional(byte[] physicalTableName, TableDescriptorBuilder tableDescriptorBuilder, PTableType tableType, String txValue, Map<String, Object> tableProps) throws SQLException { if (txValue == null) { tableDescriptorBuilder.removeValue(Bytes.toBytes(PhoenixTransactionContext.READ_NON_TX_DATA)); } else { tableDescriptorBuilder.setValue(PhoenixTransactionContext.READ_NON_TX_DATA, txValue); } this.addCoprocessors(physicalTableName, tableDescriptorBuilder, tableType, tableProps); }
.setTableName(SchemaUtil.getTableNameFromFullName(physicalTableName)).build().buildException(); newDesc.removeValue(Bytes.toBytes(PhoenixTransactionContext.READ_NON_TX_DATA));
.setTableName(SchemaUtil.getTableNameFromFullName(physicalTableName)).build().buildException(); newDesc.removeValue(Bytes.toBytes(PhoenixTransactionContext.READ_NON_TX_DATA));
.setTableName(SchemaUtil.getTableNameFromFullName(physicalTableName)).build().buildException(); newDesc.removeValue(Bytes.toBytes(PhoenixTransactionContext.READ_NON_TX_DATA));