org.apache.directory.server.core.api.partition.Partition.repair()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(1.1k)|赞(0)|评价(0)|浏览(217)

本文整理了Java中org.apache.directory.server.core.api.partition.Partition.repair()方法的一些代码示例,展示了Partition.repair()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Partition.repair()方法的具体详情如下:
包路径:org.apache.directory.server.core.api.partition.Partition
类名称:Partition
方法名:repair

Partition.repair介绍

[英]Repair this partition.
[中]修复这个分区。

代码示例

代码示例来源:origin: org.apache.directory.server/apacheds-service

/**
 * Try to repair the partitions. Precondition is that this service was started before.
 *
 * @param instanceLayout the on disk location's layout of the intance to be repaired
 * @throws Exception If the repair failed
 */
public void repair( InstanceLayout instanceLayout ) throws Exception
{
  File partitionsDir = instanceLayout.getPartitionsDirectory();
  System.out.println( "Repairing partition dir " + partitionsDir.getAbsolutePath() );
  Set<? extends Partition> partitions = getDirectoryService().getPartitions();
  // Iterate on the partitions to repair them
  for ( Partition partition : partitions )
  {
    try
    {
      partition.repair();
    }
    catch ( Exception e )
    {
      System.out.println( "Failed to repair the partition " + partition.getId() );
      e.printStackTrace();
      return;
    }
  }
}

代码示例来源:origin: keeps/roda

rodaPartition.repair();

相关文章