/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package witsml131;
import java.io.IOException;
import java.util.ArrayList;
import javax.security.auth.login.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.client.Delete;
import org.apache.hadoop.hbase.client.HTable;
import org.apache.hadoop.hbase.util.Bytes;
/**
*
* @author shashwat
*/
public class DeleteFromHbase {
public static void main(String[] args) throws IOException {
HTable table = new HTable("well");
ArrayList<String> rowsToDelete = new ArrayList(); //array with all rows names to delete.
Delete del = new Delete(Bytes.toBytes("2"));//for single row named 2
table.delete(del);
//deleting all rows in rowsToDelete in array list rowsToDelete
for (String rows : rowsToDelete) {
del = new Delete(Bytes.toBytes(rows));//for single row named 2
table.delete(del);
}
table.close();
}
}
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package witsml131;
import java.io.IOException;
import java.util.ArrayList;
import javax.security.auth.login.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.client.Delete;
import org.apache.hadoop.hbase.client.HTable;
import org.apache.hadoop.hbase.util.Bytes;
/**
*
* @author shashwat
*/
public class DeleteFromHbase {
public static void main(String[] args) throws IOException {
HTable table = new HTable("well");
ArrayList<String> rowsToDelete = new ArrayList(); //array with all rows names to delete.
Delete del = new Delete(Bytes.toBytes("2"));//for single row named 2
table.delete(del);
//deleting all rows in rowsToDelete in array list rowsToDelete
for (String rows : rowsToDelete) {
del = new Delete(Bytes.toBytes(rows));//for single row named 2
table.delete(del);
}
table.close();
}
}
No comments:
Post a Comment
Thank you for Commenting Will reply soon ......