org.apache.cassandra.io.util.FileUtils.deleteWithConfirm()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(5.2k)|赞(0)|评价(0)|浏览(178)

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

FileUtils.deleteWithConfirm介绍

暂无

代码示例

代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server

/**
 * Completely discards a segment file by deleting it. (Potentially blocking operation)
 */
void delete()
{
  FileUtils.deleteWithConfirm(logFile);
}

代码示例来源:origin: org.apache.cassandra/cassandra-all

public void run()
  {
    deleteWithConfirm(new File(file));
  }
};

代码示例来源:origin: com.strapdata.cassandra/cassandra-all

/**
 * Simply delete untracked segment files w/standard, as it'll be flushed to sstables during recovery
 *
 * @param file segment file that is no longer in use.
 */
void handleReplayedSegment(final File file)
{
  // (don't decrease managed size, since this was never a "live" segment)
  logger.trace("(Unopened) segment {} is no longer needed and will be deleted now", file);
  FileUtils.deleteWithConfirm(file);
}

代码示例来源:origin: jsevellec/cassandra-unit

public void run()
  {
    deleteWithConfirm(new File(file));
  }
};

代码示例来源:origin: jsevellec/cassandra-unit

public static Throwable deleteWithConfirm(String filePath, boolean expect, Throwable accumulate)
{
  return deleteWithConfirm(new File(filePath), expect, accumulate);
}

代码示例来源:origin: com.strapdata.cassandra/cassandra-all

public void run()
  {
    deleteWithConfirm(new File(file));
  }
};

代码示例来源:origin: org.apache.cassandra/cassandra-all

/**
 * Simply delete untracked segment files w/standard, as it'll be flushed to sstables during recovery
 *
 * @param file segment file that is no longer in use.
 */
void handleReplayedSegment(final File file)
{
  // (don't decrease managed size, since this was never a "live" segment)
  logger.trace("(Unopened) segment {} is no longer needed and will be deleted now", file);
  FileUtils.deleteWithConfirm(file);
}

代码示例来源:origin: jsevellec/cassandra-unit

/**
 * Simply delete untracked segment files w/standard, as it'll be flushed to sstables during recovery
 *
 * @param file segment file that is no longer in use.
 */
void handleReplayedSegment(final File file)
{
  // (don't decrease managed size, since this was never a "live" segment)
  logger.trace("(Unopened) segment {} is no longer needed and will be deleted now", file);
  FileUtils.deleteWithConfirm(file);
}

代码示例来源:origin: jsevellec/cassandra-unit

public static void deleteWithConfirm(String file)
{
  deleteWithConfirm(new File(file));
}

代码示例来源:origin: org.apache.cassandra/cassandra-all

public static void deleteWithConfirm(String file)
{
  deleteWithConfirm(new File(file));
}

代码示例来源:origin: jsevellec/cassandra-unit

public static void deleteWithConfirm(File file)
{
  maybeFail(deleteWithConfirm(file, true, null));
}

代码示例来源:origin: org.apache.cassandra/cassandra-all

public static void deleteWithConfirm(File file)
{
  maybeFail(deleteWithConfirm(file, true, null));
}

代码示例来源:origin: jsevellec/cassandra-unit

/**
 * Discards a segment file when the log no longer requires it. The file may be left on disk if the archive script
 * requires it. (Potentially blocking operation)
 */
void discard(boolean deleteFile)
{
  close();
  if (deleteFile)
    FileUtils.deleteWithConfirm(logFile);
  manager.addSize(-onDiskSize());
}

代码示例来源:origin: org.apache.cassandra/cassandra-all

/**
 * Discards a segment file when the log no longer requires it. The file may be left on disk if the archive script
 * requires it. (Potentially blocking operation)
 */
void discard(boolean deleteFile)
{
  close();
  if (deleteFile)
    FileUtils.deleteWithConfirm(logFile);
  manager.addSize(-onDiskSize());
}

代码示例来源:origin: jsevellec/cassandra-unit

public void discard(CommitLogSegment segment, boolean delete)
{
  segment.close();
  if (delete)
    FileUtils.deleteWithConfirm(segment.logFile);
  addSize(-segment.onDiskSize());
}

代码示例来源:origin: org.apache.cassandra/cassandra-all

public void discard(CommitLogSegment segment, boolean delete)
{
  segment.close();
  if (delete)
    FileUtils.deleteWithConfirm(segment.logFile);
  addSize(-segment.onDiskSize());
}

代码示例来源:origin: com.strapdata.cassandra/cassandra-all

public void discard(CommitLogSegment segment, boolean delete)
{
  segment.close();
  if (delete)
    FileUtils.deleteWithConfirm(segment.logFile);
  addSize(-segment.onDiskSize());
}

代码示例来源:origin: com.strapdata.cassandra/cassandra-all

/**
 * Discards a segment file when the log no longer requires it. The file may be left on disk if the archive script
 * requires it. (Potentially blocking operation)
 */
void discard(boolean deleteFile)
{
  close();
  if (deleteFile)
    FileUtils.deleteWithConfirm(logFile);
  manager.addSize(-onDiskSize());
}

代码示例来源:origin: jsevellec/cassandra-unit

public void discard(CommitLogSegment segment, boolean delete)
{
  segment.close();
  addSize(-segment.onDiskSize());
  cdcSizeTracker.processDiscardedSegment(segment);
  if (segment.getCDCState() == CDCState.CONTAINS)
    FileUtils.renameWithConfirm(segment.logFile.getAbsolutePath(), DatabaseDescriptor.getCDCLogLocation() + File.separator + segment.logFile.getName());
  else
  {
    if (delete)
      FileUtils.deleteWithConfirm(segment.logFile);
  }
}

代码示例来源:origin: org.apache.cassandra/cassandra-all

public void discard(CommitLogSegment segment, boolean delete)
{
  segment.close();
  addSize(-segment.onDiskSize());
  cdcSizeTracker.processDiscardedSegment(segment);
  if (segment.getCDCState() == CDCState.CONTAINS)
    FileUtils.renameWithConfirm(segment.logFile.getAbsolutePath(), DatabaseDescriptor.getCDCLogLocation() + File.separator + segment.logFile.getName());
  else
  {
    if (delete)
      FileUtils.deleteWithConfirm(segment.logFile);
  }
}

相关文章