@Override public void delete(List<Delete> deletes) throws IOException { for (Delete delete: deletes) { delete(delete); } }
@Override public void run() throws Exception { Delete delete = new Delete(Bytes.toBytes("delete")); remoteTable.delete(delete); } });
public void delete(List<Delete> deletes) throws IOException { for (Delete delete: deletes) { delete(delete); } }
@Override public void delete(List<Delete> deletes) throws IOException { for (Delete delete: deletes) { delete(delete); } }
@Override public void delete(List<Delete> deletes) throws IOException { for (Delete delete: deletes) { delete(delete); } }
@Override public void run() throws Exception { Delete delete = new Delete(Bytes.toBytes("delete")); remoteTable.delete(delete); } });
public static void deleteRowFromHBase(String remoteHost, int remotePort, String remoteTable, List<String> rowsToDelete) throws IOException { RemoteHTable table = new RemoteHTable( new Client( new Cluster().add(remoteHost, remotePort)), remoteTable); List<byte[]> rowBytes = new ArrayList<byte[]>(); for (String s : rowsToDelete) { rowBytes.add(Bytes.toBytes(s)); } for (byte[] b : rowBytes) { table.delete(new Delete(b)); } table.close(); } }
public static void deleteRowFromHBase(String remoteHost, int remotePort, String remoteTable, String rowToDelete) throws IOException { RemoteHTable table = new RemoteHTable( new Client( new Cluster().add(remoteHost, remotePort)), remoteTable); byte[] row3 = Bytes.toBytes(rowToDelete); table.delete(new Delete(row3)); table.close(); }
@Override public void deleteRow(String tableName, Row row) { final RemoteHTable table; synchronized (mutex) { table = new RemoteHTable(client, tableName); } try { table.delete(new Delete(row.getId())); } catch (IOException e) { throw new ModifyTableException(EXCEPTION_DURING_DELETING_ROW, e); } finally { try { table.close(); } catch (IOException e) { throw new ModifyTableException(EXCEPTION_DURING_CLOSING_TABLE, e); } } }
public static void main(String[] args) throws IOException { RemoteHTable table = new RemoteHTable( new Client( new Cluster().add("localhost", 8080)), "test"); Person john = Person.newBuilder().setId(1234).setName("John Doe").setEmail("jdoe@example.com").addPhone( Person.PhoneNumber.newBuilder().setNumber("555-4321").setType(Person.PhoneType.HOME)).build(); byte[] row = Bytes.toBytes("row3"); table.delete(new Delete(row)); Put put = new Put(row); byte[] family = Bytes.toBytes("data"); byte[] qualifier = Bytes.toBytes("3"); byte[] value = john.toByteArray(); put.add(family, qualifier, value); table.put(put); table.close(); } }