本文整理了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
[英]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();
内容来源于网络,如有侵权,请联系作者删除!