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

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

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

FileUtils.atomicMoveWithFallback介绍

[英]Move a file atomically, if it fails, it falls back to a non-atomic operation
[中]以原子方式移动文件,如果失败,则返回到非原子操作

代码示例

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

public static void renameWithOutConfirm(String from, String to)
{
  try
  {
    atomicMoveWithFallback(new File(from).toPath(), new File(to).toPath());
  }
  catch (IOException e)
  {
    if (logger.isTraceEnabled())
      logger.trace("Could not move file "+from+" to "+to, e);
  }
}

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

public static void renameWithOutConfirm(String from, String to)
{
  try
  {
    atomicMoveWithFallback(new File(from).toPath(), new File(to).toPath());
  }
  catch (IOException e)
  {
    if (logger.isTraceEnabled())
      logger.trace("Could not move file "+from+" to "+to, e);
  }
}

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

public static void renameWithOutConfirm(String from, String to)
{
  try
  {
    atomicMoveWithFallback(new File(from).toPath(), new File(to).toPath());
  }
  catch (IOException e)
  {
    if (logger.isTraceEnabled())
      logger.trace("Could not move file "+from+" to "+to, e);
  }
}

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

public static void renameWithOutConfirm(String from, String to)
{
  try
  {
    atomicMoveWithFallback(new File(from).toPath(), new File(to).toPath());
  }
  catch (IOException e)
  {
    if (logger.isTraceEnabled())
      logger.trace("Could not move file "+from+" to "+to, e);
  }
}

代码示例来源:origin: com.netflix.sstableadaptor/sstable-adaptor-cassandra

public static void renameWithOutConfirm(String from, String to)
{
  try
  {
    atomicMoveWithFallback(new File(from).toPath(), new File(to).toPath());
  }
  catch (IOException e)
  {
    if (logger.isTraceEnabled())
      logger.trace("Could not move file "+from+" to "+to, e);
  }
}

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

public static void renameWithConfirm(File from, File to)
{
  assert from.exists();
  if (logger.isTraceEnabled())
    logger.trace("Renaming {} to {}", from.getPath(), to.getPath());
  // this is not FSWE because usually when we see it it's because we didn't close the file before renaming it,
  // and Windows is picky about that.
  try
  {
    atomicMoveWithFallback(from.toPath(), to.toPath());
  }
  catch (IOException e)
  {
    throw new RuntimeException(String.format("Failed to rename %s to %s", from.getPath(), to.getPath()), e);
  }
}

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

public static void renameWithConfirm(File from, File to)
{
  assert from.exists();
  if (logger.isTraceEnabled())
    logger.trace("Renaming {} to {}", from.getPath(), to.getPath());
  // this is not FSWE because usually when we see it it's because we didn't close the file before renaming it,
  // and Windows is picky about that.
  try
  {
    atomicMoveWithFallback(from.toPath(), to.toPath());
  }
  catch (IOException e)
  {
    throw new RuntimeException(String.format("Failed to rename %s to %s", from.getPath(), to.getPath()), e);
  }
}

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

public static void renameWithConfirm(File from, File to)
{
  assert from.exists();
  if (logger.isTraceEnabled())
    logger.trace("Renaming {} to {}", from.getPath(), to.getPath());
  // this is not FSWE because usually when we see it it's because we didn't close the file before renaming it,
  // and Windows is picky about that.
  try
  {
    atomicMoveWithFallback(from.toPath(), to.toPath());
  }
  catch (IOException e)
  {
    throw new RuntimeException(String.format("Failed to rename %s to %s", from.getPath(), to.getPath()), e);
  }
}

代码示例来源:origin: com.netflix.sstableadaptor/sstable-adaptor-cassandra

public static void renameWithConfirm(File from, File to)
{
  assert from.exists();
  if (logger.isTraceEnabled())
    logger.trace("Renaming {} to {}", from.getPath(), to.getPath());
  // this is not FSWE because usually when we see it it's because we didn't close the file before renaming it,
  // and Windows is picky about that.
  try
  {
    atomicMoveWithFallback(from.toPath(), to.toPath());
  }
  catch (IOException e)
  {
    throw new RuntimeException(String.format("Failed to rename %s to %s", from.getPath(), to.getPath()), e);
  }
}

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

public static void renameWithConfirm(File from, File to)
{
  assert from.exists();
  if (logger.isDebugEnabled())
    logger.debug((String.format("Renaming %s to %s", from.getPath(), to.getPath())));
  // this is not FSWE because usually when we see it it's because we didn't close the file before renaming it,
  // and Windows is picky about that.
  try
  {
    atomicMoveWithFallback(from.toPath(), to.toPath());
  }
  catch (IOException e)
  {
    throw new RuntimeException(String.format("Failed to rename %s to %s", from.getPath(), to.getPath()), e);
  }
}

相关文章