HBASE-23197 'IllegalArgumentException: Wrong FS' on edits replay when… (#740)
[hbase.git] / hbase-server / src / main / java / org / apache / hadoop / hbase / regionserver / HRegionWALFileSystem.java
blobf1f5eb5585bf2a43b08031b0da66974406fdf2bb
1 /**
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
18 package org.apache.hadoop.hbase.regionserver;
20 import java.io.IOException;
21 import java.util.Collection;
22 import org.apache.hadoop.conf.Configuration;
23 import org.apache.hadoop.fs.FileSystem;
24 import org.apache.hadoop.fs.Path;
25 import org.apache.hadoop.hbase.backup.HFileArchiver;
26 import org.apache.hadoop.hbase.client.RegionInfo;
27 import org.apache.hadoop.hbase.util.Bytes;
28 import org.apache.yetus.audience.InterfaceAudience;
30 /**
31 * A Wrapper for the region FileSystem operations adding WAL specific operations
33 @InterfaceAudience.Private
34 public class HRegionWALFileSystem extends HRegionFileSystem {
36 HRegionWALFileSystem(Configuration conf, FileSystem fs, Path tableDir, RegionInfo regionInfo) {
37 super(conf, fs, tableDir, regionInfo);
40 /**
41 * Closes and archives the specified store files from the specified family.
42 * @param familyName Family that contains the store filesMeta
43 * @param storeFiles set of store files to remove
44 * @throws IOException if the archiving fails
46 public void archiveRecoveredEdits(String familyName, Collection<HStoreFile> storeFiles)
47 throws IOException {
48 HFileArchiver.archiveRecoveredEdits(this.conf, this.fs, this.regionInfoForFs,
49 Bytes.toBytes(familyName), storeFiles);