code: public static BuildContext newDirectoryInstance(Cache<?, ?> metadataCache, Cache<?, ?> chunksCache, Cache<?, ?> distLocksCache, String indexName) {
        validateIndexCaches(indexName, metadataCache, chunksCache, distLocksCache);
        return new DirectoryBuilderImpl(metadataCache, chunksCache, distLocksCache, indexName);
     }
docs: Starting point to create a Directory instance.
  
  @param metadataCache  contains the metadata of stored elements
  @param chunksCache    cache containing the bulk of the index; this is the larger part of data
  @param distLocksCache cache to store locks; should be replicated and not using a persistent CacheStore
  @param indexName      identifies the index; you can store different indexes in the same set of caches using
  different identifiers