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 indexFolderName() throws Exception{
          assertEquals("abc", IndexRootDirectory.getIndexFolderBaseName("/abc"));
          assertEquals("abc12", IndexRootDirectory.getIndexFolderBaseName("/abc12"));
          assertEquals("xyabc12", IndexRootDirectory.getIndexFolderBaseName("/xy:abc12"));
          assertEquals("xyabc12", IndexRootDirectory.getIndexFolderBaseName("/xy:abc#^&12"));
          assertEquals("xyabc12", IndexRootDirectory.getIndexFolderBaseName("/oak:index/xy:abc12"));
          assertEquals("content_xyabc12", IndexRootDirectory.getIndexFolderBaseName("/content/oak:index/xy:abc12"));
          assertEquals("sales_xyabc12", IndexRootDirectory.getIndexFolderBaseName("/content/sales/oak:index/xy:abc12"));
          assertEquals("appsales_xyabc12", IndexRootDirectory.getIndexFolderBaseName
                  ("/content/app:sales/oak:index/xy:abc12"));
      }
test_case.class_method_signature: IndexRootDirectoryTest.indexFolderName()
test_case.full_signature: @Test public void indexFolderName()
test_case.identifier: indexFolderName
test_case.invocations: assertEquals getIndexFolderBaseName assertEquals getIndexFolderBaseName assertEquals getIndexFolderBaseName assertEquals getIndexFolderBaseName assertEquals getIndexFolderBaseName assertEquals getIndexFolderBaseName assertEquals getIndexFolderBaseName assertEquals getIndexFolderBaseName
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void indexFolderName()
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: static String getIndexFolderBaseName(String indexPath) {
          List<String> elements = Lists.newArrayList(PathUtils.elements(indexPath));
          Collections.reverse(elements);
          List<String> result = Lists.newArrayListWithCapacity(2);
  
          //Max 3 nodeNames including oak:index which is the immediate parent for any indexPath
          for (String e : Iterables.limit(elements, 3)) {
              if ("oak:index".equals(e)) {
                  continue;
              }
              //Strip of any char outside of a-zA-Z0-9-
              result.add(getFSSafeName(e));
          }
  
          Collections.reverse(result);
          String name = Joiner.on('_').join(result);
          if (name.length() > MAX_NAME_LENGTH){
              name = name.substring(0, MAX_NAME_LENGTH);
          }
          return name;
      }
focal_method.class_method_signature: IndexRootDirectory.getIndexFolderBaseName(String indexPath)
focal_method.full_signature: static String getIndexFolderBaseName(String indexPath)
focal_method.identifier: getIndexFolderBaseName
focal_method.invocations: newArrayList elements reverse newArrayListWithCapacity limit equals add getFSSafeName reverse join on length substring
focal_method.modifiers: static
focal_method.parameters: (String indexPath)
focal_method.return: String
focal_method.signature: String getIndexFolderBaseName(String indexPath)