code: protected void addPartitionInternal(final String partitionId, final String suffix) throws Exception { //NOSONAR
  
          final DirectoryService service = this.getDirectoryService();
  
          final CacheService cacheService = service.getCacheService();
          final SchemaManager schemaManager = service.getSchemaManager();
          final DnFactory dnFactory = service.getDnFactory();
  
          final URI partitionPath = new File(service.getInstanceLayout().getPartitionsDirectory(), partitionId).toURI();
          final AvlPartition partition = new AvlPartition(schemaManager, dnFactory);
          partition.setId(partitionId);
          partition.setSuffixDn(dnFactory.create(suffix));
          partition.setCacheService(cacheService);
          partition.setCacheSize(1000);
          partition.setSyncOnWrite(true);
          partition.setPartitionPath(partitionPath);
          partition.addIndex(new AvlIndex<Entry>("objectClass", false));
          partition.initialize();
          LOG.info("Created partition {} in {}", partitionId, partitionPath);
          service.addPartition(partition);
      }
docs: Creates an AVL implementation based in-memory partition. A partition is required to add entries or import LIDF
  data. Once the partition was added, the context entry has to be created. If you're using the ldif import, the use
  of this method and the ldif file may look like
  <pre>
  <code>
  directory.addPartition(&quot;scribble&quot;, &quot;dc=scribble&quot);
  ...
  // LDIF File
  dn: dc=scribble
  objectClass: top
  objectClass: dcObject
  objectClass: organization
  o: inkstand.io
  </code>
  </pre>
  The method may be invoked after the service is started, i.e. in the setUp method of a test.
  
  @param partitionId
  the id of the partition
  @param suffix
  the suffix dn of all partition entries
  
  @throws Exception
  if the partition could not be created