test_class.declarator: temporaryFolder = new TemporaryFolder(new File("target"))
test_class.modifier: @Rule
      public
test_class.original_string: @Rule
      public TemporaryFolder temporaryFolder = new TemporaryFolder(new File("target"));
test_class.type: TemporaryFolder
test_class.var_name: temporaryFolder
test_class.declarator: dir
test_class.modifier: private
test_class.original_string: private IndexRootDirectory dir;
test_class.type: IndexRootDirectory
test_class.var_name: dir
test_class.declarator: root = INITIAL_CONTENT
test_class.modifier: private
test_class.original_string: private NodeState root = INITIAL_CONTENT;
test_class.type: NodeState
test_class.var_name: root
test_class.declarator: builder = EMPTY_NODE.builder()
test_class.modifier: private
test_class.original_string: private NodeBuilder builder = EMPTY_NODE.builder();
test_class.type: NodeBuilder
test_class.var_name: builder
test_class.file: oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/directory/IndexRootDirectoryTest.java
test_class.identifier: IndexRootDirectoryTest
test_case.body: @Test
      public void gcNRTDirsOnStart() throws Exception{
          configureUniqueId();
  
          File fa0 = dir.getIndexDir(getDefn(), "/a", "default");
          File nrt0 = dir.getIndexDir(getDefn(), "/a", NRTIndex.generateDirName());
          File nrt1 = dir.getIndexDir(getDefn(), "/a", NRTIndex.generateDirName());
  
          //Now reinitialize
          dir = new IndexRootDirectory(temporaryFolder.getRoot());
          assertFalse(nrt0.exists());
          assertFalse(nrt1.exists());
          assertTrue(fa0.exists());
      }
test_case.class_method_signature: IndexRootDirectoryTest.gcNRTDirsOnStart()
test_case.full_signature: @Test public void gcNRTDirsOnStart()
test_case.identifier: gcNRTDirsOnStart
test_case.invocations: configureUniqueId getIndexDir getDefn getIndexDir getDefn generateDirName getIndexDir getDefn generateDirName getRoot assertFalse exists assertFalse exists assertTrue exists
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void gcNRTDirsOnStart()
focal_class.declarator: MAX_NAME_LENGTH = 127
focal_class.modifier: static final
focal_class.original_string: static final int MAX_NAME_LENGTH = 127;
focal_class.type: int
focal_class.var_name: MAX_NAME_LENGTH
focal_class.declarator: INDEX_METADATA_FILE_NAME = "index-details.txt"
focal_class.modifier: public static final
focal_class.original_string: public static final String INDEX_METADATA_FILE_NAME = "index-details.txt";
focal_class.type: String
focal_class.var_name: INDEX_METADATA_FILE_NAME
focal_class.declarator: LOCAL_DIR_FILTER = new FileFilter() {
          @Override
          public boolean accept(File file) {
              if (!file.isDirectory()) {
                  return false;
              }
              File metaFile = new File(file, INDEX_METADATA_FILE_NAME);
              return metaFile.exists();
          }
      }
focal_class.modifier: private static final
focal_class.original_string: private static final FileFilter LOCAL_DIR_FILTER = new FileFilter() {
          @Override
          public boolean accept(File file) {
              if (!file.isDirectory()) {
                  return false;
              }
              File metaFile = new File(file, INDEX_METADATA_FILE_NAME);
              return metaFile.exists();
          }
      };
focal_class.type: FileFilter
focal_class.var_name: LOCAL_DIR_FILTER
focal_class.declarator: log = LoggerFactory.getLogger(getClass())
focal_class.modifier: private final
focal_class.original_string: private final Logger log = LoggerFactory.getLogger(getClass());
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: indexRootDir
focal_class.modifier: private final
focal_class.original_string: private final File indexRootDir;
focal_class.type: File
focal_class.var_name: indexRootDir
focal_class.file: oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/directory/IndexRootDirectory.java
focal_class.identifier: IndexRootDirectory
focal_class.class_method_signature: IndexRootDirectory.IndexRootDirectory(File indexRootDir)
focal_class.full_signature: public  IndexRootDirectory(File indexRootDir)
focal_class.identifier: IndexRootDirectory
focal_class.modifiers: public
focal_class.parameters: (File indexRootDir)
focal_class.signature:  IndexRootDirectory(File indexRootDir)
focal_class.class_method_signature: IndexRootDirectory.IndexRootDirectory(File indexRootDir, boolean gcOnStart)
focal_class.full_signature: public  IndexRootDirectory(File indexRootDir, boolean gcOnStart)
focal_class.identifier: IndexRootDirectory
focal_class.modifiers: public
focal_class.parameters: (File indexRootDir, boolean gcOnStart)
focal_class.signature:  IndexRootDirectory(File indexRootDir, boolean gcOnStart)
focal_class.class_method_signature: IndexRootDirectory.getSize()
focal_class.full_signature: public long getSize()
focal_class.identifier: getSize
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: long
focal_class.signature: long getSize()
focal_class.class_method_signature: IndexRootDirectory.getIndexDir(IndexDefinition definition, String indexPath, String dirName)
focal_class.full_signature: public File getIndexDir(IndexDefinition definition, String indexPath, String dirName)
focal_class.identifier: getIndexDir
focal_class.modifiers: public
focal_class.parameters: (IndexDefinition definition, String indexPath, String dirName)
focal_class.return: File
focal_class.signature: File getIndexDir(IndexDefinition definition, String indexPath, String dirName)
focal_class.class_method_signature: IndexRootDirectory.getAllLocalIndexes()
focal_class.full_signature: public List<LocalIndexDir> getAllLocalIndexes()
focal_class.identifier: getAllLocalIndexes
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: List<LocalIndexDir>
focal_class.signature: List<LocalIndexDir> getAllLocalIndexes()
focal_class.class_method_signature: IndexRootDirectory.getLocalIndexes(String jcrPath)
focal_class.full_signature: public List<LocalIndexDir> getLocalIndexes(String jcrPath)
focal_class.identifier: getLocalIndexes
focal_class.modifiers: public
focal_class.parameters: (String jcrPath)
focal_class.return: List<LocalIndexDir>
focal_class.signature: List<LocalIndexDir> getLocalIndexes(String jcrPath)
focal_class.class_method_signature: IndexRootDirectory.gcEmptyDirs(File subDir)
focal_class.full_signature: public long gcEmptyDirs(File subDir)
focal_class.identifier: gcEmptyDirs
focal_class.modifiers: public
focal_class.parameters: (File subDir)
focal_class.return: long
focal_class.signature: long gcEmptyDirs(File subDir)
focal_class.class_method_signature: IndexRootDirectory.getIndexFolderBaseName(String indexPath)
focal_class.full_signature: static String getIndexFolderBaseName(String indexPath)
focal_class.identifier: getIndexFolderBaseName
focal_class.modifiers: static
focal_class.parameters: (String indexPath)
focal_class.return: String
focal_class.signature: String getIndexFolderBaseName(String indexPath)
focal_class.class_method_signature: IndexRootDirectory.getPathHash(String indexPath)
focal_class.full_signature: static String getPathHash(String indexPath)
focal_class.identifier: getPathHash
focal_class.modifiers: static
focal_class.parameters: (String indexPath)
focal_class.return: String
focal_class.signature: String getPathHash(String indexPath)
focal_class.class_method_signature: IndexRootDirectory.getIndexesPerPath()
focal_class.full_signature: private Map<String, List<LocalIndexDir>> getIndexesPerPath()
focal_class.identifier: getIndexesPerPath
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: Map<String, List<LocalIndexDir>>
focal_class.signature: Map<String, List<LocalIndexDir>> getIndexesPerPath()
focal_class.class_method_signature: IndexRootDirectory.gcIndexDirs()
focal_class.full_signature: private void gcIndexDirs()
focal_class.identifier: gcIndexDirs
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void gcIndexDirs()
focal_class.class_method_signature: IndexRootDirectory.gcNRTIndexDirs(LocalIndexDir idxDir)
focal_class.full_signature: private long gcNRTIndexDirs(LocalIndexDir idxDir)
focal_class.identifier: gcNRTIndexDirs
focal_class.modifiers: private
focal_class.parameters: (LocalIndexDir idxDir)
focal_class.return: long
focal_class.signature: long gcNRTIndexDirs(LocalIndexDir idxDir)
focal_class.class_method_signature: IndexRootDirectory.findMatchingIndexDir(File dir)
focal_class.full_signature: @Nullable private LocalIndexDir findMatchingIndexDir(File dir)
focal_class.identifier: findMatchingIndexDir
focal_class.modifiers: @Nullable private
focal_class.parameters: (File dir)
focal_class.return: LocalIndexDir
focal_class.signature: LocalIndexDir findMatchingIndexDir(File dir)
focal_class.class_method_signature: IndexRootDirectory.deleteOldFormatDir(String jcrPath)
focal_class.full_signature: private long deleteOldFormatDir(String jcrPath)
focal_class.identifier: deleteOldFormatDir
focal_class.modifiers: private
focal_class.parameters: (String jcrPath)
focal_class.return: long
focal_class.signature: long deleteOldFormatDir(String jcrPath)
focal_class.class_method_signature: IndexRootDirectory.getOldFormatDir(String indexPath)
focal_class.full_signature: private File getOldFormatDir(String indexPath)
focal_class.identifier: getOldFormatDir
focal_class.modifiers: private
focal_class.parameters: (String indexPath)
focal_class.return: File
focal_class.signature: File getOldFormatDir(String indexPath)
focal_class.class_method_signature: IndexRootDirectory.getFSSafeName(String e)
focal_class.full_signature: static String getFSSafeName(String e)
focal_class.identifier: getFSSafeName
focal_class.modifiers: static
focal_class.parameters: (String e)
focal_class.return: String
focal_class.signature: String getFSSafeName(String e)
focal_class.class_method_signature: IndexRootDirectory.getTime()
focal_class.full_signature: private static long getTime()
focal_class.identifier: getTime
focal_class.modifiers: private static
focal_class.parameters: ()
focal_class.return: long
focal_class.signature: long getTime()
focal_method.body: public File getIndexDir(IndexDefinition definition, String indexPath, String dirName) throws IOException {
          String uid = definition.getUniqueId();
  
          if (uid == null) {
              //Old format
              File baseFolder = getOldFormatDir(indexPath);
              String version = String.valueOf(definition.getReindexCount());
              File indexDir = new File(baseFolder, version);
              if (!indexDir.exists()){
                  checkState(indexDir.mkdirs(), "Not able to create folder [%s]", indexDir);
              }
              return indexDir;
          } else {
              String fileSystemSafeName = getIndexFolderBaseName(indexPath);
              String folderName = fileSystemSafeName + "-" + uid;
              File baseFolder = new File(indexRootDir, folderName);
  
              //Create a base folder <index node name>-<uid>
              //and add a readme file having index info
              if (!baseFolder.exists()){
                  checkState(baseFolder.mkdir(), "Not able to create folder [%s]", baseFolder);
                  File readMe = new File(baseFolder, INDEX_METADATA_FILE_NAME);
                  IndexMeta meta = new IndexMeta(indexPath, getTime());
                  meta.writeTo(readMe);
              }
  
              //Create index folder under that
              File indexFolder = new File(baseFolder, getFSSafeName(dirName));
              if (!indexFolder.exists()) {
                  checkState(indexFolder.mkdir(), "Not able to create folder [%s]", indexFolder);
              }
  
              return indexFolder;
          }
      }
focal_method.class_method_signature: IndexRootDirectory.getIndexDir(IndexDefinition definition, String indexPath, String dirName)
focal_method.full_signature: public File getIndexDir(IndexDefinition definition, String indexPath, String dirName)
focal_method.identifier: getIndexDir
focal_method.invocations: getUniqueId getOldFormatDir valueOf getReindexCount exists checkState mkdirs getIndexFolderBaseName exists checkState mkdir getTime writeTo getFSSafeName exists checkState mkdir
focal_method.modifiers: public
focal_method.parameters: (IndexDefinition definition, String indexPath, String dirName)
focal_method.return: File
focal_method.signature: File getIndexDir(IndexDefinition definition, String indexPath, String dirName)