private Path createReferences(final MasterServices services, final TableDescriptor td,
    final RegionInfo parent, final RegionInfo daughter, final byte[] midkey, final boolean top)
    throws IOException {
    Path rootdir = services.getMasterFileSystem().getRootDir();
    Path tabledir = CommonFSUtils.getTableDir(rootdir, parent.getTable());
    Path storedir =
      HRegionFileSystem.getStoreHomedir(tabledir, daughter, td.getColumnFamilies()[0].getName());
    Reference ref =
      top ? Reference.createTopReference(midkey) : Reference.createBottomReference(midkey);
    long now = EnvironmentEdgeManager.currentTime();
    // Reference name has this format: StoreFile#REF_NAME_PARSER
    Path p = new Path(storedir, Long.toString(now) + "." + parent.getEncodedName());
    FileSystem fs = services.getMasterFileSystem().getFileSystem();
    HRegionFileSystem regionFS =
      HRegionFileSystem.create(services.getConfiguration(), fs, tabledir, daughter);
    StoreContext storeContext =
      StoreContext.getBuilder().withColumnFamilyDescriptor(td.getColumnFamilies()[0])
        .withFamilyStoreDirectoryPath(storedir).withRegionFileSystem(regionFS).build();
    StoreFileTracker sft =
      StoreFileTrackerFactory.create(services.getConfiguration(), false, storeContext);
    sft.createReference(ref, p);
    return p;
  }
Test that if a store file with the same name is present as those already backed up cause the
already archived files to be timestamped backup
hbase-server/src/test/java/org/apache/hadoop/hbase/master/janitor/TestCatalogJanitor.java