Search in sources :

Example 51 with WALKey

use of org.apache.hadoop.hbase.wal.WALKey in project phoenix by apache.

the class SystemCatalogWALEntryFilterIT method getEntry.

public WAL.Entry getEntry(TableName tableName, Get get) throws IOException {
    WAL.Entry entry = null;
    try (Connection conn = ConnectionFactory.createConnection(getUtility().getConfiguration())) {
        Table htable = conn.getTable(tableName);
        Result result = htable.get(get);
        WALEdit edit = new WALEdit();
        if (result != null) {
            List<Cell> cellList = result.listCells();
            Assert.assertNotNull("Didn't retrieve any cells from SYSTEM.CATALOG", cellList);
            for (Cell c : cellList) {
                edit.add(c);
            }
        }
        Assert.assertTrue("Didn't retrieve any cells from SYSTEM.CATALOG", edit.getCells().size() > 0);
        WALKey key = new WALKey(REGION, tableName, 0, 0, uuid);
        entry = new WAL.Entry(key, edit);
    }
    return entry;
}
Also used : WALKey(org.apache.hadoop.hbase.wal.WALKey) WAL(org.apache.hadoop.hbase.wal.WAL) PTable(org.apache.phoenix.schema.PTable) WALEdit(org.apache.hadoop.hbase.regionserver.wal.WALEdit) Cell(org.apache.hadoop.hbase.Cell)

Aggregations

WALKey (org.apache.hadoop.hbase.wal.WALKey)51 WALEdit (org.apache.hadoop.hbase.regionserver.wal.WALEdit)29 Test (org.junit.Test)26 WAL (org.apache.hadoop.hbase.wal.WAL)22 TreeMap (java.util.TreeMap)17 HRegionInfo (org.apache.hadoop.hbase.HRegionInfo)17 KeyValue (org.apache.hadoop.hbase.KeyValue)16 HTableDescriptor (org.apache.hadoop.hbase.HTableDescriptor)15 IOException (java.io.IOException)14 Path (org.apache.hadoop.fs.Path)14 TableName (org.apache.hadoop.hbase.TableName)12 ArrayList (java.util.ArrayList)10 Cell (org.apache.hadoop.hbase.Cell)10 HColumnDescriptor (org.apache.hadoop.hbase.HColumnDescriptor)10 FileSystem (org.apache.hadoop.fs.FileSystem)9 Get (org.apache.hadoop.hbase.client.Get)9 Result (org.apache.hadoop.hbase.client.Result)9 MultiVersionConcurrencyControl (org.apache.hadoop.hbase.regionserver.MultiVersionConcurrencyControl)8 WALFactory (org.apache.hadoop.hbase.wal.WALFactory)8 Put (org.apache.hadoop.hbase.client.Put)7