Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,24 @@ private void updateFileLists(List<String> activeFiles, List<String> archiveFiles
}
}

if (newlyArchived.size() > 0) {
if (!newlyArchived.isEmpty()) {
String rootDir = CommonFSUtils.getRootDir(conf).toString();

activeFiles.removeAll(newlyArchived);
archiveFiles.addAll(newlyArchived);
for (String file : newlyArchived) {
String archivedFile = file.substring(rootDir.length() + 1);
Path archivedFilePath = new Path(HFileArchiveUtil.getArchivePath(conf), archivedFile);
archivedFile = archivedFilePath.toString();

if (!fs.exists(archivedFilePath)) {
throw new IOException(
String.format("File %s not longer exists, and no archived file %s exists for it", file,
archivedFile));
}

LOG.debug("Archived file {} has been updated", archivedFile);
archiveFiles.add(archivedFile);
}
}

LOG.debug(newlyArchived.size() + " files have been archived.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import static org.apache.hadoop.hbase.regionserver.HStoreFile.BULKLOAD_TIME_KEY;
import static org.apache.hadoop.hbase.regionserver.HStoreFile.EXCLUDE_FROM_MINOR_COMPACTION_KEY;
import static org.apache.hadoop.hbase.regionserver.HStoreFile.MAJOR_COMPACTION_KEY;

import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.InetSocketAddress;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
import org.apache.yetus.audience.InterfaceAudience;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.hbase.thirdparty.com.google.common.collect.ImmutableSet;

import org.apache.hbase.thirdparty.com.google.common.collect.ImmutableSet;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.PrintStream;
Expand Down