Search in sources :

Example 11 with RegionEventDescriptor

use of org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.RegionEventDescriptor in project hbase by apache.

the class HRegion method writeRegionCloseMarker.

private void writeRegionCloseMarker(WAL wal) throws IOException {
    Map<byte[], List<Path>> storeFiles = getStoreFiles();
    RegionEventDescriptor regionEventDesc = ProtobufUtil.toRegionEventDescriptor(RegionEventDescriptor.EventType.REGION_CLOSE, getRegionInfo(), mvcc.getReadPoint(), getRegionServerServices().getServerName(), storeFiles);
    // we do not care region close event at secondary replica side so just pass a null
    // RegionReplicationSink
    WALUtil.writeRegionEventMarker(wal, getReplicationScope(), getRegionInfo(), regionEventDesc, mvcc, null);
    // table is still online
    if (getWalFileSystem().exists(getWALRegionDir())) {
        WALSplitUtil.writeRegionSequenceIdFile(getWalFileSystem(), getWALRegionDir(), mvcc.getReadPoint());
    }
}
Also used : RegionEventDescriptor(org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.RegionEventDescriptor) ArrayList(java.util.ArrayList) List(java.util.List)

Example 12 with RegionEventDescriptor

use of org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.RegionEventDescriptor in project hbase by apache.

the class HRegion method writeRegionOpenMarker.

protected void writeRegionOpenMarker(WAL wal, long openSeqId) throws IOException {
    Map<byte[], List<Path>> storeFiles = getStoreFiles();
    RegionEventDescriptor regionOpenDesc = ProtobufUtil.toRegionEventDescriptor(RegionEventDescriptor.EventType.REGION_OPEN, getRegionInfo(), openSeqId, getRegionServerServices().getServerName(), storeFiles);
    WALUtil.writeRegionEventMarker(wal, getReplicationScope(), getRegionInfo(), regionOpenDesc, mvcc, regionReplicationSink.orElse(null));
}
Also used : RegionEventDescriptor(org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.RegionEventDescriptor) ArrayList(java.util.ArrayList) List(java.util.List)

Aggregations

RegionEventDescriptor (org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.RegionEventDescriptor)12 WAL (org.apache.hadoop.hbase.wal.WAL)7 Test (org.junit.Test)7 ArrayList (java.util.ArrayList)5 List (java.util.List)5 FlushDescriptor (org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.FlushDescriptor)5 StoreDescriptor (org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.StoreDescriptor)4 ServerName (org.apache.hadoop.hbase.ServerName)3 StoreFlushDescriptor (org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.FlushDescriptor.StoreFlushDescriptor)3 Path (org.apache.hadoop.fs.Path)2 Cell (org.apache.hadoop.hbase.Cell)2 Put (org.apache.hadoop.hbase.client.Put)2 RegionInfo (org.apache.hadoop.hbase.client.RegionInfo)2 TableDescriptor (org.apache.hadoop.hbase.client.TableDescriptor)2 BulkLoadDescriptor (org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.BulkLoadDescriptor)2 CompactionDescriptor (org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.CompactionDescriptor)2 WALEdit (org.apache.hadoop.hbase.wal.WALEdit)2 Configuration (org.apache.hadoop.conf.Configuration)1 ByteBufferCell (org.apache.hadoop.hbase.ByteBufferCell)1 ByteBufferExtendedCell (org.apache.hadoop.hbase.ByteBufferExtendedCell)1