当前位置: 首页>>代码示例>>Java>>正文


Java FBUtilities.getToolsOutputDirectory方法代码示例

本文整理汇总了Java中org.apache.cassandra.utils.FBUtilities.getToolsOutputDirectory方法的典型用法代码示例。如果您正苦于以下问题:Java FBUtilities.getToolsOutputDirectory方法的具体用法?Java FBUtilities.getToolsOutputDirectory怎么用?Java FBUtilities.getToolsOutputDirectory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.cassandra.utils.FBUtilities的用法示例。


在下文中一共展示了FBUtilities.getToolsOutputDirectory方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: printHistory

import org.apache.cassandra.utils.FBUtilities; //导入方法依赖的package包/类
private static void printHistory(String... args)
{
    //don't bother to print if no args passed (meaning, nodetool is just printing out the sub-commands list)
    if (args.length == 0)
        return;

    String cmdLine = Joiner.on(" ").skipNulls().join(args);
    cmdLine = cmdLine.replaceFirst("(?<=(-pw|--password))\\s+\\S+", " <hidden>");

    try (FileWriter writer = new FileWriter(new File(FBUtilities.getToolsOutputDirectory(), HISTORYFILE), true))
    {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss,SSS");
        writer.append(sdf.format(new Date())).append(": ").append(cmdLine).append(System.lineSeparator());
    }
    catch (IOException | IOError ioe)
    {
        //quietly ignore any errors about not being able to write out history
    }
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:20,代码来源:NodeTool.java

示例2: printHistory

import org.apache.cassandra.utils.FBUtilities; //导入方法依赖的package包/类
private static void printHistory(String[] args, ToolCommandLine cmd)
{
    //don't bother to print if no args passed (meaning, nodetool is just printing out the sub-commands list)
    if (args.length == 0)
        return;
    String cmdLine = Joiner.on(" ").skipNulls().join(args);
    final String password = cmd.getOptionValue(PASSWORD_OPT.left);
    if (password != null)
        cmdLine = cmdLine.replace(password, "<hidden>");

    try (FileWriter writer = new FileWriter(new File(FBUtilities.getToolsOutputDirectory(), HISTORYFILE), true))
    {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss,SSS");
        writer.append(sdf.format(new Date()) + ": " + cmdLine + "\n");
    }
    catch (IOException ioe)
    {
        //quietly ignore any errors about not being able to write out history
    }
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:21,代码来源:NodeCmd.java

示例3: handleHistoryFiles

import org.apache.cassandra.utils.FBUtilities; //导入方法依赖的package包/类
private static File handleHistoryFiles()
{
    File outputDir = FBUtilities.getToolsOutputDirectory();
    File historyFile = new File(outputDir, HISTORYFILE);
    File oldHistoryFile = new File(System.getProperty("user.home"), OLD_HISTORYFILE);
    if(oldHistoryFile.exists())
        FileUtils.renameWithConfirm(oldHistoryFile, historyFile);

    return historyFile;
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:11,代码来源:CliMain.java

示例4: CfAssumptions

import org.apache.cassandra.utils.FBUtilities; //导入方法依赖的package包/类
public CfAssumptions()
{
    assumptions = new HashMap<String, Map<String, Map<String, String>>>();
    assumptionsChanged = false;
    assumptionDirectory = FBUtilities.getToolsOutputDirectory();

    File oldAssumptionDir = new File(System.getProperty("user.home") + File.separator + ".cassandra-cli");
    if (oldAssumptionDir.exists())
    {
        File oldAssumptionFile = new File(oldAssumptionDir, ASSUMPTIONS_FILENAME);
        if (oldAssumptionFile.exists())
            FileUtils.renameWithConfirm(oldAssumptionFile, new File(assumptionDirectory, ASSUMPTIONS_FILENAME));
        FileUtils.deleteRecursive(oldAssumptionDir);
    }
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:16,代码来源:CliClient.java


注:本文中的org.apache.cassandra.utils.FBUtilities.getToolsOutputDirectory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。